Results 1 to 2 of 2

Thread: How to add new arrow to QScrollBar

  1. #1
    Join Date
    Apr 2021
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default How to add new arrow to QScrollBar

    Hello,
    I'd like to add new arrows in order to have more flexible control for my tableview. For example, it may be scrollng to top and bottom of table.
    I have no idea, how i an do it.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,936
    Thanks
    276
    Thanked 803 Times in 792 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: How to add new arrow to QScrollBar

    Probably the most straightforward way would be to subclass QScrollBar and make a composite widget with "scroll to top" tool button, a normal QScrollBar, and a "scroll to bottom" tool button stacked in a vertical layout. Use QAbstractScrollArea::setVerticalScrollBar() to replace the default scroll bar with your custom one. Your custom scroll bar will have to emit new signals for the two tool button clicks, and of course your view will have to respond to them, so you may need to subclass QTableView as well.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. QScrollBar up/down, left/right arrow customization
    By GUIDeveloper in forum Newbie
    Replies: 1
    Last Post: 3rd November 2018, 07:01
  2. QScrollBar arrow keys
    By jstarr in forum Qt Programming
    Replies: 7
    Last Post: 5th October 2018, 17:22
  3. QScrollBar up-down arrow icon
    By zgulser in forum Qt Programming
    Replies: 5
    Last Post: 1st April 2010, 12:13
  4. QScrollBar arrow display
    By sgg245 in forum Qt Programming
    Replies: 2
    Last Post: 16th February 2009, 06:57
  5. QScrollBar arrow display
    By sgg245 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 16th February 2009, 06:36

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.