Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSlider is not sliding

QSlider is not sliding

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 3.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    basil_fawlty
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Anticross
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved