Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
elided_label.h
Go to the documentation of this file.
1
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);
47
51 virtual void resizeEvent(QResizeEvent *);
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
A QLabel subclass that elides text when it exceeds the widget's width, and optionally acts as a hyper...
Definition elided_label.h:19
void setSmallText(bool small_text=true)
setSmallText Specifies a small or normal text size.
Definition elided_label.h:38
virtual bool event(QEvent *event)
Handles general events for the widget.
Definition elided_label.cpp:34
virtual void resizeEvent(QResizeEvent *)
Handles resize events to recalculate the elided text.
Definition elided_label.cpp:47
void clear()
clear Clear the label.
Definition elided_label.cpp:70
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