18 QPixmap pixmap(QString::fromUtf8(
":/fileclose.png"));
22 clearButton->setStyleSheet(
"QToolButton { border: none; padding: 0px; }");
24 connect(
clearButton, SIGNAL(clicked()),
this, SLOT(clear()));
25 connect(
this, SIGNAL(textChanged(
const QString &)),
this, SLOT(
updateCloseButton(
const QString &)));
26 int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
27 setStyleSheet(QString(
"QLineEdit { padding-right: %1px; } ").arg(
clearButton->sizeHint().width() + frameWidth + 1));
28 QSize msz = minimumSizeHint();
29 setMinimumSize(qMax(msz.width(),
clearButton->sizeHint().height() + frameWidth * 2 + 2),
30 qMax(msz.height(),
clearButton->sizeHint().height() + frameWidth * 2 + 2));
35 int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);