From 8b6de4677142cab41790ca50ce6c7f1efbab5de8 Mon Sep 17 00:00:00 2001 From: Tero Ahola Date: Tue, 7 Aug 2012 15:10:47 +0300 Subject: Modified vertical alignments of simple widgets on OSX Adding QCheckBox, QComboBox, QLineEdit etc. into an HBox layout or grid layout makes the layout look like a snake's trail. Fixed the positioning of these widgets to make the layouts visually more appealing. Updated qmacstyle auto-test accordingly. Task-number: QTBUG-13635 Ammended-by: Gabriel de Dietrich Change-Id: I89461f9aad68ea8488070ed06257b9b8e7f493c5 Reviewed-by: Gabriel de Dietrich --- tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp | 11 +++++------ .../widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp | 4 ---- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp index 0fdce91151..c0b857d540 100644 --- a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp +++ b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp @@ -124,7 +124,7 @@ void tst_QMacStyle::sizeHints() setSize(&w, size); QLineEdit lineEdit1(&w); - QCOMPARE(sh(&lineEdit1).height(), SIZE(22, 19, 16)); // 16 in Builder, 15 in AHIG + QCOMPARE(sh(&lineEdit1).height(), SIZE(21, 19, 16)); // 16 in Builder, 15 in AHIG QProgressBar progress1(&w); progress1.setOrientation(Qt::Horizontal); @@ -135,11 +135,10 @@ void tst_QMacStyle::sizeHints() QCOMPARE(sh(&progress1).width(), SIZE(16, 10, 10)); // Builder QRadioButton radio1("Radio", &w); - QEXPECT_FAIL("", "QTBUG-25296", Abort); - QCOMPARE(sh(&radio1).height(), SIZE(15, 12, 10)); // Builder + QCOMPARE(sh(&radio1).height(), SIZE(14, 12, 10)); // Builder QCheckBox checkBox1("Switch", &w); - QCOMPARE(sh(&checkBox1).height(), SIZE(14, 12, 10)); // Builder + QCOMPARE(sh(&checkBox1).height(), SIZE(13, 12, 10)); // Builder QComboBox comboBox1(&w); comboBox1.setEditable(false); @@ -149,7 +148,7 @@ void tst_QMacStyle::sizeHints() QComboBox comboBox2(&w); comboBox2.setEditable(true); comboBox2.addItem("Foo"); - QCOMPARE(sh(&comboBox2).height(), SIZE(20, 17, 15)); + QCOMPARE(sh(&comboBox2).height(), SIZE(22, 17, 15)); // Combos in toolbars use the actual widget rect to // avoid faulty clipping: @@ -227,7 +226,7 @@ void tst_QMacStyle::sizeHints() // QMacStyle bug: label doesn't react to Small and Mini QLabel label1("Blah", &w); - QCOMPARE(sh(&label1).height(), SIZE(17, 14, 11)); + QCOMPARE(sh(&label1).height(), SIZE(16, 14, 11)); } void tst_QMacStyle::layoutMargins_data() diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp index dc8b1c12f3..4b2125ad6a 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -874,10 +874,6 @@ void tst_QStyleSheetStyle::hoverColors() QVERIFY2(testForColors(image, QColor(0xe8, 0xff, 0x66)), (QString::fromLatin1(widget->metaObject()->className()) + " did not contain background color #e8ff66").toLocal8Bit().constData()); -#ifdef Q_OS_MAC - if (qobject_cast(widget)) - QEXPECT_FAIL("", "Failure only for QPushButton and QComboBox, see QTBUG-23686", Continue); -#endif QVERIFY2(testForColors(image, QColor(0xff, 0x00, 0x84)), (QString::fromLatin1(widget->metaObject()->className()) + " did not contain text color #ff0084").toLocal8Bit().constData()); -- cgit v1.2.3