Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
elided_label.h
Go to the documentation of this file.
1
9
10#ifndef ELIDED_LABEL_H
11#define ELIDED_LABEL_H
12
13#include <QLabel>
14
18class ElidedLabel : public QLabel
19{
20 Q_OBJECT
21public:
26 explicit ElidedLabel(QWidget *parent = 0);
27
32 void setUrl(const QString &url);
33
38 void setSmallText(bool small_text = true) { small_text_ = small_text; }
39
40protected:
46 virtual bool event(QEvent *event) override;
47
51 virtual void resizeEvent(QResizeEvent *) override;
52
53private:
55 bool small_text_;
56
58 QString full_text_;
59
61 QString url_;
62
66 void updateText();
67
68signals:
69
70public slots:
74 void clear();
75
80 void setText(const QString &text);
81};
82
83#endif // ELIDED_LABEL_H
void setSmallText(bool small_text=true)
setSmallText Specifies a small or normal text size.
Definition elided_label.h:38
virtual bool event(QEvent *event) override
Handles general events for the widget.
Definition elided_label.cpp:34
void clear()
clear Clear the label.
Definition elided_label.cpp:70
virtual void resizeEvent(QResizeEvent *) override
Handles resize events to recalculate the elided text.
Definition elided_label.cpp:47
ElidedLabel(QWidget *parent=0)
Constructs a new ElidedLabel.
Definition elided_label.cpp:18
void setText(const QString &text)
setText Set the label's plain text.
Definition elided_label.cpp:78
void setUrl(const QString &url)
setUrl Set the label's URL.
Definition elided_label.cpp:28