Important: Please read the Qt Code of Conduct -

Scrolling problems

  • Hey,
    i am trying to implement a slider with these requirements: (1) when i have i single step call a specific function (2) when the slider makes more steps (slidermoved) wait some time and the call the same function. Untill now i have done these:
    This is the connection of the signals,

      connect(ui->verticalScrollBar, SIGNAL(sliderMoved(int)), this, SLOT(sliderMoved_slot()));
      connect(ui->verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(sliderSingleStep_slot()));
      connect (&m_Timer, SIGNAL(timeout()), this, SLOT (requestSlot()));

    and the implementation of the slots,

    void VGrid::sliderSingleStep_slot()
    void VGrid::sliderMoved_slot()
        disconnect(ui->verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(sliderSingleStep_slot()));
        connect(ui->verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(sliderSingleStep_slot()));

    I used the disconnect() because i don't want the valueChanged() signalto be emmited when the sliders moves. I want it to be emmited only when i have a single step. I have tried also the blockSignals() function. None of these two worked.
    What am i doing wrong? Any other suggetion for the implementation of the slider are very welcomed.

  • Lifetime Qt Champion


    In that case have a look at "actionTriggered":

  • Moderators

    seems that the "solution with actionTriggered": wasn't successful?!

  • that's right

Log in to reply