Results 1 to 2 of 2

Thread: Using Stylesheet to Customize QSpinBox

  1. #1
    Join Date
    Jul 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Using Stylesheet to Customize QSpinBox

    Hi All,

    I'm trying to customize some of the spin boxes in a dialog I'm making, but setting the stylesheet seems to completely override the stylesheet for the widget.

    I'm using the following stylesheet to try to set the width of the widget and the width of the up/down buttons, but the spin box seems to lose the border and icons completely. I've applied my new stylesheet to the top boxes, but not the bottom ones, so you can see how the modified ones differ from the default.

    Stylesheet: "QSpinBox { width: 60; } QSpinBox::up-button { width: 10; } "

    Result:
    OjEDVwE.png

    My question is: Is it possible to only set the width of the widget and buttons in the stylesheet and have the rest use the QSpinBox's defaults, or am I going to need to specify a full stylesheet with all the default values? If I do need to specify a full stylesheet, where can I get one that contains all the default values so I can modify it?

    Thanks,
    ~talyn

  2. #2
    Join Date
    Oct 2019
    Posts
    7
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Using Stylesheet to Customize QSpinBox

    There is some example of QSpinBox stylesheet here : https://qss-stock.devsecstudio.com

Similar Threads

  1. Customize QDial
    By Jayes in forum Qt Programming
    Replies: 10
    Last Post: 23rd December 2010, 05:44
  2. How to customize the X axis?
    By lvdong in forum Qwt
    Replies: 2
    Last Post: 10th August 2010, 03:53
  3. QSpinBox StyleSheet
    By The Storm in forum Qt Programming
    Replies: 2
    Last Post: 15th September 2007, 00:08
  4. how can i customize a QMainWindow
    By wygggyxtf in forum Qt Programming
    Replies: 15
    Last Post: 23rd June 2007, 07:18
  5. How could i customize my QtTabWidget?
    By Rodrigo in forum Qt Programming
    Replies: 3
    Last Post: 29th May 2007, 15:30

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.