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. Scrolling problems
Forum Update on Monday, May 27th 2025

Scrolling problems

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.4k Views
  • 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.
  • S Offline
    S Offline
    salvador
    wrote on 10 Jun 2013, 09:26 last edited by tekojo
    #1

    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.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 10 Jun 2013, 09:31 last edited by
      #2

      Hi,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        raven-worx
        Moderators
        wrote on 10 Jun 2013, 09:47 last edited by
        #3

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

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        0
        • S Offline
          S Offline
          salvador
          wrote on 10 Jun 2013, 09:49 last edited by
          #4

          that's right

          1 Reply Last reply
          0

          4/4

          10 Jun 2013, 09:49

          • Login

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