|
|
|
@ -37,7 +37,7 @@ LineEdit::LineEdit(QWidget *parent)
@@ -37,7 +37,7 @@ LineEdit::LineEdit(QWidget *parent)
|
|
|
|
|
clearButton->setToolTip(tr("Clear the text")); |
|
|
|
|
clearButton->hide(); |
|
|
|
|
connect(clearButton, SIGNAL(clicked()), this, SLOT(clear())); |
|
|
|
|
connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(updateCloseButton(const QString&))); |
|
|
|
|
connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(updateCloseButton(const QString &))); |
|
|
|
|
|
|
|
|
|
clearButtonSizeHintWidth = clearButton->sizeHint().width(); |
|
|
|
|
clearButtonSizeHintHeight = clearButton->sizeHint().height(); |
|
|
|
@ -64,7 +64,7 @@ void LineEdit::resizeEvent(QResizeEvent *e)
@@ -64,7 +64,7 @@ void LineEdit::resizeEvent(QResizeEvent *e)
|
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void LineEdit::updateCloseButton(const QString& text) |
|
|
|
|
void LineEdit::updateCloseButton(const QString &text) |
|
|
|
|
{ |
|
|
|
|
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) |
|
|
|
|
clearButton->setVisible(!text.isEmpty()); |
|
|
|
|