- clearButton->setStyleSheet("QToolButton { border: none; padding: 0px; }");
- clearButton->hide();
-
- connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));
- connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(updateClearButton(const QString&)));
-
- int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
- setStyleSheet(QString("QLineEdit { padding-right: %1px; } ").arg(clearButton->sizeHint().width() + frameWidth + 1));
- QSize msz = minimumSizeHint();
- setMinimumSize(qMax(msz.width(), clearButton->sizeHint().height() + frameWidth * 2 + 2),
- qMax(msz.height(), clearButton->sizeHint().height() + frameWidth * 2 + 2));
+ clearButton->setStyleSheet("QToolButton { border: none; padding: 0px; }");
+ clearButton->hide();
+
+ connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));
+ connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(updateClearButton(const QString &)));
+
+ int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
+ setStyleSheet(QString("QLineEdit { padding-right: %1px; } ").arg(clearButton->sizeHint().width() + frameWidth + 1));
+ QSize msz = minimumSizeHint();
+ setMinimumSize(qMax(msz.width(), clearButton->sizeHint().height() + frameWidth * 2 + 2),
+ qMax(msz.height(), clearButton->sizeHint().height() + frameWidth * 2 + 2));