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()
    {
        requestSlot();
    }
    
    void VGrid::sliderMoved_slot()
    {
        disconnect(ui->verticalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(sliderSingleStep_slot()));
        drawGrid();
        m_Timer.start(500);
        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

    Hi,

    In that case have a look at "actionTriggered":http://qt-project.org/doc/qt-4.8/qabstractslider.html#actionTriggered


  • Moderators

    seems that the "solution with actionTriggered":http://qt-project.org/forums/viewthread/28225/ wasn't successful?!



  • that's right


Log in to reply
 

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