| 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
18 class ElidedLabel : public QLabel
19{
20 Q_OBJECT
21 public:
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
40 protected:
46 virtual bool event(QEvent *event) override;
47
51 virtual void resizeEvent(QResizeEvent *) override;
52
53 private:
55 bool small_text_;
56
58 QString full_text_;
59
61 QString url_;
62
66 void updateText();
67
68signals:
69
70 public slots:
74 void clear();
75
80 void setText(const QString &text);
81};
82
83#endif // ELIDED_LABEL_H
ElidedLabel::setSmallText
void setSmallText(bool small_text=true)
setSmallText Specifies a small or normal text size.
Definition elided_label.h:38
ElidedLabel::event
virtual bool event(QEvent *event) override
Handles general events for the widget.
Definition elided_label.cpp:34
ElidedLabel::clear
void clear()
clear Clear the label.
Definition elided_label.cpp:70
ElidedLabel::resizeEvent
virtual void resizeEvent(QResizeEvent *) override
Handles resize events to recalculate the elided text.
Definition elided_label.cpp:47
ElidedLabel::ElidedLabel
ElidedLabel(QWidget *parent=0)
Constructs a new ElidedLabel.
Definition elided_label.cpp:18
ElidedLabel::setText
void setText(const QString &text)
setText Set the label's plain text.
Definition elided_label.cpp:78
ElidedLabel::setUrl
void setUrl(const QString &url)
setUrl Set the label's URL.
Definition elided_label.cpp:28