QMessageBox - merge some mac and non-mac code

I have not located any significant behavior changes in this,
and it is annoying having too much similar code in different
branches.

The main change is a removal of Qt::AlignLeft, but
the icon Label should be in its own column.

Change-Id: Iaf07fc503075e61e2af1a93d5fc9e6e34a24451d
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
This commit is contained in:
Thorbjørn Martsum 2013-08-08 16:23:20 +02:00 committed by The Qt Project
parent 5ba72276c4
commit e7168ff9fe

View File

@ -300,22 +300,18 @@ void QMessageBoxPrivate::setupLayout()
Q_Q(QMessageBox);
delete q->layout();
QGridLayout *grid = new QGridLayout;
#ifndef Q_OS_MAC
grid->addWidget(iconLabel, 0, 0, 2, 1, Qt::AlignTop);
grid->addWidget(label, 0, 1, 1, 1);
// -- leave space for information label --
#ifndef Q_OS_MAC
grid->addWidget(buttonBox, 2, 0, 1, 2);
#else
grid->addWidget(buttonBox, 3, 1, 1, 1);
grid->setMargin(0);
grid->setVerticalSpacing(8);
grid->setHorizontalSpacing(0);
q->setContentsMargins(24, 15, 24, 20);
grid->addWidget(iconLabel, 0, 0, 2, 1, Qt::AlignTop | Qt::AlignLeft);
grid->addWidget(label, 0, 1, 1, 1);
// -- leave space for information label --
grid->setRowStretch(1, 100);
grid->setRowMinimumHeight(2, 6);
grid->addWidget(buttonBox, 3, 1, 1, 1);
#endif
grid->setSizeConstraint(QLayout::SetNoConstraint);