diff --git a/src/widgets/widgets/qabstractslider.h b/src/widgets/widgets/qabstractslider.h index dbcd14cb67..d03a1a3918 100644 --- a/src/widgets/widgets/qabstractslider.h +++ b/src/widgets/widgets/qabstractslider.h @@ -79,8 +79,6 @@ public: void setMaximum(int); int maximum() const; - void setRange(int min, int max); - void setSingleStep(int); int singleStep() const; @@ -120,6 +118,7 @@ public: public Q_SLOTS: void setValue(int); void setOrientation(Qt::Orientation); + void setRange(int min, int max); Q_SIGNALS: void valueChanged(int value); diff --git a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp index 6021f90ed4..cff847474c 100644 --- a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp +++ b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp @@ -93,6 +93,7 @@ private slots: void setValue_data(); void setValue(); void setRepeatAction(); + void connectedSliders(); private: void waitUntilTimeElapsed(const QTime& t, int ms); @@ -1259,5 +1260,17 @@ void tst_QAbstractSlider::setRepeatAction() QCOMPARE(slider->value(), 115); } +void tst_QAbstractSlider::connectedSliders() +{ + Slider *slider2 = new Slider(topLevel); + connect(slider, SIGNAL(rangeChanged(int, int)), slider2, SLOT(setRange(int, int))); + const int sliderlow = 13; + const int sliderhigh = 1017; + slider->setRange(sliderlow, sliderhigh); + QCOMPARE(slider2->minimum(), sliderlow); + QCOMPARE(slider2->maximum(), sliderhigh); + delete slider2; +} + QTEST_MAIN(tst_QAbstractSlider) #include "tst_qabstractslider.moc"