QSlider is not sliding



  • Somehow my QSlider is not sliding. I am only able to click on the slider and then the slider changes his position. It is only possible to move the slider by clicking with abrupt movements. It is not possible to press down the mousebutton and achieve a smooth movement.The functionality works. The only thing that is not working is the smooth slide movement. I can only jump with the mouse to new slider positions. I have checked with examples. I am not doing anything different with the qslider.
    Here is one of my QSliders:
    @
    QSlider *obj_scale_x= new QSlider(Qt::Horizontal);
    obj_scale_x->setValue(10);
    obj_scale_x->setToolTip(tr("Scale object"));
    obj_scale_x->setRange(1,50);
    obj_scale_x->setTickPosition(QSlider::TicksAbove);
    connect(obj_scale_x, SIGNAL(valueChanged(int)), this, SLOT(objScale_x(int)));
    @
    I thought the problem might be the mouse. But this is not working either.
    @
    void OpenGLScene::mousePressEvent(QMouseEvent *event)
    {
    lastPos = event->pos();
    }

    void OpenGLScene::mouseMoveEvent(QMouseEvent *event)
    {
    lastPos = event->pos();
    }
    @
    I am definining the Slider in QGraphicsScene-based class. it might be this, but I am at my wit's end.



  • Maybe you lost your focus. And every time when you click on slider it has focus, then change value and then again lost it's focus.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.