Reputation: 6386
I am implementing slider in my app like below...
Slider = new QSlider(this);
Slider->setOrientation ( Qt::Horizontal );
when I run the app it shows the slider but i cant able to move the slider handle...
what I am doing wrong ...
Upvotes: 0
Views: 1424
Reputation: 36
If you wanted to do it all in the constructor:
QSlider::QSlider( int minValue, int maxValue, int pageStep, int value, Orientation orientation, QWidget * parent, const char * name = 0 )
like this:
Slider= new QSlider( 0, 100, 1, 0, Qt::Horizontal, this);
Assuming you are using a percentage of 0<->100,
Upvotes: 0
Reputation: 6326
You need to set the minimum and maximum values with:
void setMaximum ( int )
void setMinimum ( int )
Optionally set the initial value with void setValue ( int )
Upvotes: 5