4#include <QStyleOptionFrame>
33void ClearLineEdit::handleTextChanged(
const QString &
text)
38void ClearLineEdit::handleClearButtonClicked()
43void ClearLineEdit::handleCustomLayoutCreated()
45 const QStyle *
const s = style();
46 QStyleOptionFrame opt;
48 setContentsMarginsFromEditFieldRectAndFrameWidth(s->subElementRect(QStyle::SE_LineEditContents, &opt,
this),
49 s->pixelMetric(QStyle::PM_DefaultFrameWidth, &opt, m_widget), s->pixelMetric(QStyle::PM_LayoutVerticalSpacing, &opt, m_widget));
50 connect(
this, &ClearLineEdit::textChanged,
this, &ClearLineEdit::handleTextChanged);
55 return text().isEmpty();
~ClearLineEdit() override
Destroys the clear combo box.
bool isCleared() const override
Returns whether the related widget is cleared.