Results 1 to 5 of 5

Thread: QSlider and right mouse button

  1. #1

    Question QSlider and right mouse button

    This is my first post here, so want to hi everyine

    I have small problem with QSlider widget.

    I cannot modify it's value while right mouse is pressed down.

    Slider is nested in context menu, which closes when right mouse button is depressed.

    I can only change slider values using keyboard.

    So is there solution for that ? How to enable modifying slider values using mouse + right mouse button pressed ?


    Thank all in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSlider and right mouse button

    If you just click with the right button (instead of pressing and holding it) the menu should remain open. Try it, maybe it works for you.

    If not, you'll probably have to subclass QSlider and reimplement some of the mouse events and filter out the right mouse button from the set of pressed buttons in the event object.

  3. #3

    Default Re: QSlider and right mouse button

    Quote Originally Posted by wysota View Post
    If you just click with the right button (instead of pressing and holding it) the menu should remain open. Try it, maybe it works for you.

    If not, you'll probably have to subclass QSlider and reimplement some of the mouse events and filter out the right mouse button from the set of pressed buttons in the event object.
    Yeah we already agreed to change specs and make it like you suggested. Anyway why it is impossible to change sliders ? If I can set chekboxes, and other widgets I should be able to set sliders too.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSlider and right mouse button

    The slider probably checks which buttons are pressed and works if only the left button is pressed. But you can check that yourself in the sources, I'm just guessing.

  5. #5
    Join Date
    Feb 2009
    Posts
    79
    Thanks
    11
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSlider and right mouse button

    Hi, I hope you are still subscribed to this thread...

    Did I get that right?

    You said that you have a QSlider in a Context Menu.
    Does this mean that if you eg. right-click somewhere, a menu opens that has a QSlider as item?

    How do you realise that, I am exactly searching for something like this.

    Best regards,

    Olli

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.