Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
elided_label.h
1 /* elided_label.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef ELIDED_LABEL_H
11 #define ELIDED_LABEL_H
12 
13 #include <QLabel>
14 
15 class ElidedLabel : public QLabel
16 {
17  Q_OBJECT
18 public:
19  explicit ElidedLabel(QWidget *parent = 0);
20  void setUrl(const QString &url);
21  void setSmallText(bool small_text = true) { small_text_ = small_text; }
22 
23 protected:
24  void resizeEvent(QResizeEvent *);
25 
26 private:
27  bool small_text_;
28  QString full_text_;
29  QString url_;
30 
31  void updateText();
32 
33 signals:
34 
35 public slots:
36  void clear();
37  void setText(const QString &text);
38 };
39 
40 #endif // ELIDED_LABEL_H
Definition: elided_label.h:15