diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-11-05 16:35:28 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-11-05 16:35:28 (GMT) |
commit | 58bac5551cbeed83a99e257226bb7b40d363bab9 (patch) | |
tree | 4c4f47fc20f53a29e4d5dcfa3e59b8e7d523dee3 /tests/auto/qabstractslider/tst_qabstractslider.cpp | |
parent | ebecf192abe56c405409343acc2f97eaf9124fc3 (diff) | |
parent | 60b09b8915e2095b221eb0a16a76d49e5bb10391 (diff) | |
download | Qt-58bac5551cbeed83a99e257226bb7b40d363bab9.zip Qt-58bac5551cbeed83a99e257226bb7b40d363bab9.tar.gz Qt-58bac5551cbeed83a99e257226bb7b40d363bab9.tar.bz2 |
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts:
mkspecs/features/symbian/symbian_building.prf
src/network/access/qhttpnetworkconnectionchannel.cpp
Diffstat (limited to 'tests/auto/qabstractslider/tst_qabstractslider.cpp')
-rw-r--r-- | tests/auto/qabstractslider/tst_qabstractslider.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/auto/qabstractslider/tst_qabstractslider.cpp b/tests/auto/qabstractslider/tst_qabstractslider.cpp index cf069db..cd41d05 100644 --- a/tests/auto/qabstractslider/tst_qabstractslider.cpp +++ b/tests/auto/qabstractslider/tst_qabstractslider.cpp @@ -55,6 +55,8 @@ class Slider : public QAbstractSlider { public: + Slider(QWidget *parent) + : QAbstractSlider(parent) {} using QAbstractSlider::setRepeatAction; using QAbstractSlider::repeatAction; }; @@ -95,6 +97,7 @@ private slots: private: void waitUntilTimeElapsed(const QTime& t, int ms); + QWidget *topLevel; Slider *slider; int previousAction; int reportedMinimum; @@ -113,7 +116,8 @@ Q_DECLARE_METATYPE(QPoint) void tst_QAbstractSlider::initTestCase() { - slider = new Slider; + topLevel = new QWidget; + slider = new Slider(topLevel); slider->setObjectName("testWidget"); slider->resize(100,100); slider->show(); @@ -129,7 +133,7 @@ void tst_QAbstractSlider::initTestCase() void tst_QAbstractSlider::cleanupTestCase() { - delete slider; + delete topLevel; } void tst_QAbstractSlider::actionTriggered(int action) @@ -735,7 +739,6 @@ void tst_QAbstractSlider::wheelEvent_data() << 100 // expected position after #endif << QPoint(1,1); - QTest::newRow("Different orientation") << 0 // initial position << 0 // minimum << 100 // maximum @@ -774,7 +777,6 @@ void tst_QAbstractSlider::wheelEvent_data() #endif << QPoint(0,0); - QTest::newRow("Inverted controls") << 50 // initial position << 0 // minimum << 100 // maximum @@ -924,6 +926,7 @@ void tst_QAbstractSlider::sliderPressedReleased() QFETCH(uint, subControl); QFETCH(int, expectedCount); + QWidget topLevel; QAbstractSlider *slider; switch (control) { default: @@ -931,11 +934,11 @@ void tst_QAbstractSlider::sliderPressedReleased() return; break; case QStyle::CC_Slider: - slider = new QSlider; + slider = new QSlider(&topLevel); slider->setLayoutDirection(Qt::LeftToRight); // Makes "upside down" much easier to compute break; case QStyle::CC_ScrollBar: - slider = new QScrollBar; + slider = new QScrollBar(&topLevel); break; } @@ -949,7 +952,7 @@ void tst_QAbstractSlider::sliderPressedReleased() QSignalSpy spy2(slider, SIGNAL(sliderReleased())); // Mac Style requires the control to be active to get the correct values... - slider->show(); + topLevel.show(); slider->activateWindow(); QStyleOptionSlider option; |