PDA

View Full Version : QSpinBox and setStylesheet problem



Ace-X
15th January 2007, 09:19
Hi all,

Can anyone explain why QSpinBox hides its up-down buttons when I try to change its border width by the following code:


QSpinBox* spinBox=new QSpinBox();
spinBox->setStyleSheet("*{border:1px solid black}");


Thanks!

jpn
19th January 2007, 10:57
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 (http://doc.trolltech.com/4.2/widgets-stylesheet.html). 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 (http://www.trolltech.com/developer/task-tracker).

wysota
19th January 2007, 11:21
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.