[Qt-interest] Bug with Qt Style Sheets?

Eli Hooten elir.hooten at gmail.com
Wed Oct 13 01:25:27 CEST 2010


Recently, I have been doing a bit of work to customize the appearance of the
QComboBox's scroll bar in a subclass of QComboBox and I have encountered a
problem. First, I'm attempting to do this using Qt's style sheets to load
the images from a qrc file in the following manner:

  setStyleSheet(
        "QComboBox QListView QScrollBar::up-arrow {"
            "image: url(:/Images/uparrow.png);"
        "}"
        "QComboBox QListView QScrollBar::down-arrow {"
            "image: url(:/Images/downarrow.png);"
        "}"
    );

The setStyleSheet call is performed in the constructor of my QComboBox
subclass. The problem is that when using this approach, this downarrow.png
image will appear appropriately for the QScrollBar. In other words, it works
as expected. However, using the exact same approach does NOT work for the
up-arrow. Has anyone encountered this problem before? I'm at my wits end.

I have tried compiling using 32-bit versions of Qt 4.7.0 and Qt 4.6.3 in
Windows XP.

Thank you for your help.

-Eli

(As an aside, has anyone noticed that the setMaxVisibileItems function for
QComboBox has different behavior in Qt 4.6 than Qt 4.7? For example, the
calling setMaxVisibleItems(4); seems to display four items in a QComboBox
popup in Qt 4.7, but 5 in Qt 4.6. I didn't find this subtle change in the Qt
4.7 changelog, so I thought I'd mention it here.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101012/0eb65287/attachment.html 


More information about the Qt-interest-old mailing list