Results 1 to 5 of 5

Thread: Make QSpinBox up/down buttons disappear

  1. #1
    Join Date
    Feb 2010
    Location
    Sydney, Australia
    Posts
    111
    Thanks
    18
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Make QSpinBox up/down buttons disappear

    Is it possible to remove the up/down buttons from a QSpinBox without having to subclass it or use specific style sheets?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Make QSpinBox up/down buttons disappear

    I dont think so.. how do you want to increase / decrease the value then ?

  3. #3
    Join Date
    Feb 2010
    Location
    Sydney, Australia
    Posts
    111
    Thanks
    18
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Make QSpinBox up/down buttons disappear

    I would like to use just the mouse scroll to change the value. I could create my own QLabel and implement all the relevant event handlers, but the QSpinBox does it all, including setting min and max values.

  4. #4
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Make QSpinBox up/down buttons disappear

    Hi,

    I think the following is what you are looking for:
    Qt Code:
    1. setButtonSymbols(QAbstractSpinBox::NoButtons)
    To copy to clipboard, switch view to plain text mode 

  5. The following user says thank you to norobro for this useful post:

    stefanadelbert (15th April 2010)

  6. #5
    Join Date
    Feb 2010
    Location
    Sydney, Australia
    Posts
    111
    Thanks
    18
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Make QSpinBox up/down buttons disappear

    @norobro: Champion!

Similar Threads

  1. Status bar message tend to disappear
    By maverick_pol in forum Qt Programming
    Replies: 4
    Last Post: 16th July 2010, 01:15
  2. items in view would disappear on scrolling
    By sepehr in forum Qt Programming
    Replies: 4
    Last Post: 21st March 2009, 08:20
  3. Replies: 4
    Last Post: 23rd June 2008, 18:11
  4. QTableWidget: set items disappear after new insertion
    By Raccoon29 in forum Qt Programming
    Replies: 6
    Last Post: 16th March 2008, 19:28
  5. QTableView : headers disappear
    By xavier in forum Qt Programming
    Replies: 2
    Last Post: 8th May 2006, 17:57

Tags for this Thread

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.