diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qabstractitemview/tst_qabstractitemview.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qbuttongroup/tst_qbuttongroup.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qfontmetrics/tst_qfontmetrics.cpp | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp index 022778b..be2d882 100644 --- a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp @@ -1200,13 +1200,13 @@ void tst_QAbstractItemView::task250754_fontChange() tree.setFont(font); QTest::qWait(30); - QVERIFY(!tree.verticalScrollBar()->isVisible()); + QTRY_VERIFY(!tree.verticalScrollBar()->isVisible()); font.setPointSize(45); tree.setFont(font); QTest::qWait(30); //now with the huge items, the scrollbar must be visible - QVERIFY(tree.verticalScrollBar()->isVisible()); + QTRY_VERIFY(tree.verticalScrollBar()->isVisible()); qApp->setStyleSheet(app_css); } diff --git a/tests/auto/qbuttongroup/tst_qbuttongroup.cpp b/tests/auto/qbuttongroup/tst_qbuttongroup.cpp index 3530eb9..502c2d1 100644 --- a/tests/auto/qbuttongroup/tst_qbuttongroup.cpp +++ b/tests/auto/qbuttongroup/tst_qbuttongroup.cpp @@ -57,6 +57,8 @@ #include <qsettings.h> #endif +#include "../../shared/util.h" + class SpecialRadioButton: public QRadioButton { public: @@ -402,6 +404,8 @@ void tst_QButtonGroup::task106609() QSignalSpy spy2(buttons, SIGNAL(buttonClicked(int))); QTestEventLoop::instance().enterLoop(1); + QApplication::setActiveWindow(&dlg); + QTRY_COMPARE(QApplication::activeWindow(), &dlg); //qDebug() << "int:" << spy2.count() << "QAbstractButton*:" << spy1.count(); QCOMPARE(spy2.count(), 2); diff --git a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp index 665107a..6b2f0fe 100644 --- a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp +++ b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp @@ -211,11 +211,11 @@ void tst_QFontMetrics::elidedMultiLength() QString text1_short = "Shorter"; QString text1_small = "small"; QFontMetrics fm = QFontMetrics(QFont()); - int width_long = fm.boundingRect(text1_long).width(); + int width_long = fm.size(0, text1_long).width(); QCOMPARE(fm.elidedText(text1,Qt::ElideRight, 8000), text1_long); QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_long + 1), text1_long); QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_long - 1), text1_short); - int width_short = fm.boundingRect(text1_short).width(); + int width_short = fm.size(0, text1_short).width(); QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_short + 1), text1_short); QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_short - 1), text1_small); |