Qt Utilities: widgets/clearlineedit.h Source File

Qt Utilities 6.21.1 Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models

Loading...
Searching...
No Matches
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
8QT_FORWARD_DECLARE_CLASS(QHBoxLayout)
9
10namespace QtUtilities {
11
12class IconButton;
13
14 class QT_UTILITIES_EXPORT ClearLineEdit : public QLineEdit, public ButtonOverlay {
15 Q_OBJECT
16 Q_PROPERTY(bool cleared READ isCleared)
17
18public:
19 explicit ClearLineEdit(QWidget *parent = nullptr);
20 ~ClearLineEdit() override;
21 bool isCleared() const override;
22
23private Q_SLOTS:
24 void handleTextChanged(const QString &text);
25 void handleClearButtonClicked() override;
26 void handleCustomLayoutCreated() override;
27};
28} // namespace QtUtilities
29
30#endif // WIDGETS_CLEARLINEEDIT_H
buttonoverlay.h
QtUtilities::ButtonOverlay::ButtonOverlay
ButtonOverlay(QWidget *widget)
Constructs a button overlay for the specified widget.
Definition buttonoverlay.cpp:49
QtUtilities::ClearLineEdit::ClearLineEdit
ClearLineEdit(QWidget *parent=nullptr)
Constructs a clear line edit.
Definition clearlineedit.cpp:16
QtUtilities::ClearLineEdit::cleared
bool cleared
Definition clearlineedit.h:16
QtUtilities::ClearLineEdit::isCleared
bool isCleared() const override
Returns whether the related widget is cleared.
Definition clearlineedit.cpp:53
QtUtilities::IconButton
A simple QAbstractButton implementation displaying a QPixmap.
Definition iconbutton.h:15
QT_UTILITIES_EXPORT
#define QT_UTILITIES_EXPORT
Marks the symbol to be exported by the qtutilities library.
Definition global.h:14
QtUtilities
!
Definition trylocker.h:8
text
#define text
Definition xmlparsermacros.h:18