Results 1 to 3 of 3

Thread: Squeeze Slider item in QSCrollBar

  1. #1
    Join Date
    May 2014
    Posts
    4
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Squeeze Slider item in QSCrollBar

    Hi,

    I have a custom QScrollBar that should scroll the view area only, and hence move the slider also, by pressing the arrow buttons. So, the slider should be squeezed from dragging or pressing action.

    I have tried to apply triggerAction(QAbstractSlider::SliderNoAction) in the constructor of my custom QScrollBar. Unsuccess.

    Please helps me out.

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    503
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Squeeze Slider item in QSCrollBar

    Hi, you could overload the mouse events and ignore the event if it occurred somewhere between the arrow buttons.

    But why do you want to restrict the scrollbar that way? I personally find it a bit annoying when I know that I want to scroll to the other end, but cannot simply move the slider. I barely ever use the arrow buttons.

    Ginsengelf

  3. The following user says thank you to Ginsengelf for this useful post:

    paul888 (22nd July 2017)

  4. #3
    Join Date
    May 2014
    Posts
    4
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Squeeze Slider item in QSCrollBar

    Thanks.

    I did your suggestion in both MousePressEvent and MouseReleaseEvent, and pushed MouseMoveEvent to do nothing.
    In order to recognize the components of arrow button, the hitTestComplexControl is applied.

    The scrollbar behaviour should be restricted in this way due to the design requirement.

Similar Threads

  1. Replies: 4
    Last Post: 25th May 2011, 06:27
  2. Hide a slider on a QScrollBar
    By paolom in forum Qt Programming
    Replies: 8
    Last Post: 6th October 2009, 10:07
  3. how to hide slider bar on the QScrollBar
    By yxmaomao in forum Qt Programming
    Replies: 7
    Last Post: 30th May 2008, 10:02
  4. Custom (pixmap) slider handle for QScrollBar
    By Antrax in forum Qt Programming
    Replies: 1
    Last Post: 17th October 2006, 12:04
  5. QScrollBar: custom slider's size ?
    By deweyjew in forum Qt Programming
    Replies: 1
    Last Post: 9th May 2006, 10:57

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.