Qt Utilities  5.6.0
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
clearlineedit.h
Go to the documentation of this file.
1 #ifndef WIDGETS_CLEARLINEEDIT_H
2 #define WIDGETS_CLEARLINEEDIT_H
3 
4 #include "./buttonoverlay.h"
5 
6 #include <QLineEdit>
7 
8 QT_FORWARD_DECLARE_CLASS(QHBoxLayout)
9 
10 namespace Widgets {
11 
12 class IconButton;
13 
14 class QT_UTILITIES_EXPORT ClearLineEdit : public QLineEdit, public ButtonOverlay
15 {
16  Q_OBJECT
17 public:
18  explicit ClearLineEdit(QWidget *parent = nullptr);
19  ~ClearLineEdit();
20  bool isCleared() const;
21 
22 private Q_SLOTS:
23  void handleTextChanged(const QString &text);
24  void handleClearButtonClicked();
25 };
26 
27 }
28 
29 #endif // WIDGETS_CLEARLINEEDIT_H
#define QT_UTILITIES_EXPORT
Marks the symbol to be exported by the qtutilities library.
The ButtonOverlay class is used to display buttons on top of other widgets.
Definition: buttonoverlay.h:17
Provides a set of extended widgets such as ClearLineEdit and ClearComboBox.
Definition: buttonoverlay.h:13
#define text
A QLineEdit with an embedded button for clearing its contents.
Definition: clearlineedit.h:14