Results 1 to 2 of 2

Thread: QSlider slot trigger issue

  1. #1
    Join Date
    Sep 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default QSlider slot trigger issue

    I am using a QSlider for my animation time line. The value can be changed in 2 ways, one is the user drags the slider physically changing its value, and the other is the system updates the slider value when u hit the play button.
    The problem is I only want the valueChanged Signal to trigger the slot function when the user is dragging the slider. Not when the system is simply updating the slider value during playback.
    How do I make sure only the user action triggers the slot.

    Thanks

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QSlider slot trigger issue

    Quote Originally Posted by depsch View Post
    The problem is I only want the valueChanged Signal to trigger the slot function when the user is dragging the slider. Not when the system is simply updating the slider value during playback.
    Probably you have connected the signal valueChanged() of slider.
    You need to use signal sliderMoved() instead.
    This will ensure the slot invocation only when slider moved not by value changed.

Similar Threads

  1. Signal and Slot Issue
    By dlrlsqa1 in forum Newbie
    Replies: 5
    Last Post: 23rd March 2009, 12:44

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.