Results 1 to 3 of 3

Thread: QSpinBox and setStylesheet problem

  1. #1
    Join Date
    Jan 2007
    Posts
    1

    Default QSpinBox and setStylesheet problem

    Hi all,

    Can anyone explain why QSpinBox hides its up-down buttons when I try to change its border width by the following code:
    Qt Code:
    1. QSpinBox* spinBox=new QSpinBox();
    2. spinBox->setStyleSheet("*{border:1px solid black}");
    To copy to clipboard, switch view to plain text mode 

    Thanks!

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QSpinBox and setStylesheet problem

    You can set for example background-color and selection-color etc. but as soon as you add border, the buttons disappear. Easy to reproduce with the stylesheet example. The same thing happens to QComboBox as well (the drop down button disappears).

    So, to me it looks like a bug, please report it to the Task Tracker.
    J-P Nurmi

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

    Default Re: QSpinBox and setStylesheet problem

    Remember that the stylesheet technology is relatively new and not really completed. There are many issues like this one and Trolls are (more or less) aware of them. You should be able to fix the arrows by using subcontrols. I was trying to do that myself when I saw this thread, but was unsuccessfull.

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.