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
QtWS25 Last Chance

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 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
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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
      • raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on 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 last edited by
          #4

          that's right

          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