QErrorMessage: sort statements in ctor

This has no influence on text size, but by executing similar functions
temporally close to each other, we should make better use of the i-cache.

It's also more readable.

Change-Id: Ia211e562d798d4f16f3fd17f87f1e2cad2e0359d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
Marc Mutz 2015-04-06 19:39:02 +02:00
parent b6b17c2040
commit 7064bf2b9b

View File

@ -221,29 +221,32 @@ QErrorMessage::QErrorMessage(QWidget * parent)
: QDialog(*new QErrorMessagePrivate, parent)
{
Q_D(QErrorMessage);
QGridLayout * grid = new QGridLayout(this);
d->icon = new QLabel(this);
d->errors = new QErrorMessageTextView(this);
d->again = new QCheckBox(this);
d->ok = new QPushButton(this);
QGridLayout * grid = new QGridLayout(this);
connect(d->ok, SIGNAL(clicked()), this, SLOT(accept()));
grid->addWidget(d->icon, 0, 0, Qt::AlignTop);
grid->addWidget(d->errors, 0, 1);
grid->addWidget(d->again, 1, 1, Qt::AlignTop);
grid->addWidget(d->ok, 2, 0, 1, 2, Qt::AlignCenter);
grid->setColumnStretch(1, 42);
grid->setRowStretch(0, 42);
#ifndef QT_NO_MESSAGEBOX
d->icon->setPixmap(QMessageBox::standardIcon(QMessageBox::Information));
d->icon->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
#endif
grid->addWidget(d->icon, 0, 0, Qt::AlignTop);
d->errors = new QErrorMessageTextView(this);
grid->addWidget(d->errors, 0, 1);
d->again = new QCheckBox(this);
d->again->setChecked(true);
grid->addWidget(d->again, 1, 1, Qt::AlignTop);
d->ok = new QPushButton(this);
#if defined(Q_OS_WINCE)
d->ok->setFixedSize(0,0);
#endif
connect(d->ok, SIGNAL(clicked()), this, SLOT(accept()));
d->ok->setFocus();
grid->addWidget(d->ok, 2, 0, 1, 2, Qt::AlignCenter);
grid->setColumnStretch(1, 42);
grid->setRowStretch(0, 42);
d->retranslateStrings();
}