Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.5.3
-
None
Description
The following shows the issue, notice how the __ __ do not align perfectly.
#include <QApplication> #include <QFont> #include <QGridLayout> #include <QLabel> #include <QLatin1String> #include <QLineEdit> #include <QComboBox> int main(int argc, char ** argv) { QApplication app(argc,argv); QWidget * window = new QWidget(); QGridLayout * grid = new QGridLayout(window); grid->setHorizontalSpacing(0); QLabel *fileLabel = new QLabel ("bug part one ___"); QStringList list ; list << "___ value 1" << "___ value 2" << "___ value 3" << "___ value 4"; QComboBox *fileComboBox; fileComboBox = new QComboBox; fileComboBox->addItems(list); QGridLayout *mainLayout = new QGridLayout; grid->addWidget(fileLabel, 0, 0,1,1,Qt::AlignLeft | Qt::AlignVCenter); grid->addWidget(fileComboBox, 0, 1,1,1,Qt::AlignRight | Qt::AlignVCenter); window->show(); return app.exec(); }
The following patch seems to fix the issue:
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index ee106eb..273a7d5 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -4601,7 +4601,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, } else { rect = opt->rect; if (controlSize == QAquaSizeLarge) { - rect.adjust(+3, +2, -3, -4); + rect.adjust(+3, +5, -3, -4); } else if (controlSize == QAquaSizeSmall) { setLayoutItemMargins(+2, +1, -3, -4, &rect, opt->direction); } else {