Qt: ElidedLabel cleanup

Add Doxygen documentaiton and fix a clazy-qstring-arg warning.
This commit is contained in:
Gerald Combs 2022-12-31 12:16:39 -08:00 committed by AndersBroman
parent cf4d88d320
commit 1c24e49c67
2 changed files with 12 additions and 4 deletions

View File

@ -56,10 +56,7 @@ void ElidedLabel::updateText()
if (url_.length() > 0) {
label_text.prepend(ColorUtils::themeLinkStyle());
label_text.append(QString("<a href=\"%1\">%2</a>")
.arg(url_)
.arg(elided_text)
);
label_text.append(QString("<a href=\"%1\">%2</a>").arg(url_, elided_text));
} else {
label_text += elided_text;
}

View File

@ -17,7 +17,15 @@ class ElidedLabel : public QLabel
Q_OBJECT
public:
explicit ElidedLabel(QWidget *parent = 0);
/**
* @brief setUrl Set the label's URL.
* @param url The URL to set.
*/
void setUrl(const QString &url);
/**
* @brief setSmallText Specifies a small or normal text size.
* @param small_text Show the text in a smaller font size if true, or a normal size otherwise.
*/
void setSmallText(bool small_text = true) { small_text_ = small_text; }
protected:
@ -34,6 +42,9 @@ private:
signals:
public slots:
/**
* @brief clear Clear the label.
*/
void clear();
void setText(const QString &text);
};