forked from qt-creator/qt-creator
SearchResultWidget: Style cleanup
* Use Qt5-style connect * Fix spacing around braces * Remove empty destructor Change-Id: I38373aaa45e84e8d8219aea2d672df0f817d8d65 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
bab7c80976
commit
72246866c3
@@ -60,22 +60,23 @@ using namespace Utils;
|
|||||||
namespace Core {
|
namespace Core {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class WideEnoughLineEdit : public QLineEdit {
|
class WideEnoughLineEdit : public QLineEdit
|
||||||
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WideEnoughLineEdit(QWidget *parent):QLineEdit(parent){
|
WideEnoughLineEdit(QWidget *parent) : QLineEdit(parent)
|
||||||
connect(this, SIGNAL(textChanged(QString)),
|
{
|
||||||
this, SLOT(updateGeometry()));
|
connect(this, &QLineEdit::textChanged, this, &QLineEdit::updateGeometry);
|
||||||
}
|
}
|
||||||
~WideEnoughLineEdit(){}
|
|
||||||
QSize sizeHint() const {
|
QSize sizeHint() const
|
||||||
|
{
|
||||||
QSize sh = QLineEdit::minimumSizeHint();
|
QSize sh = QLineEdit::minimumSizeHint();
|
||||||
sh.rwidth() += qMax(25 * fontMetrics().width(QLatin1Char('x')),
|
sh.rwidth() += qMax(25 * fontMetrics().width(QLatin1Char('x')),
|
||||||
fontMetrics().width(text()));
|
fontMetrics().width(text()));
|
||||||
return sh;
|
return sh;
|
||||||
}
|
}
|
||||||
public slots:
|
|
||||||
void updateGeometry() { QLineEdit::updateGeometry(); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
SearchResultWidget::SearchResultWidget(QWidget *parent) :
|
SearchResultWidget::SearchResultWidget(QWidget *parent) :
|
||||||
|
Reference in New Issue
Block a user