tags:

views:

36

answers:

2

hi...

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 ...

please help me out

+2  A: 

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 )

Casey
A: 

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,

Kms254