Refer to standard Qt images from QStyleSheet
-
Hi,
I am trying to style a QComboBox (for something as mundane as adding a focus border). Ideally I would not like to change anything but adding a border highlighting the widget when it is in focus. However since since styling it the slightest seems to wipe the entire default styling I have to recreate it. Is there a way in the style sheet to refer to the "built in" Qt down arrow? I am doing a plugin for a Qt/Python application so I have no control over the main app and the resources included but since an unstyled QComboBox in fact renders an arrow it is indeed there somewhere.
Cheers!
-
-
Thanks,
Yes at least I managed to piece together an URL that I actually get an image from:QComboBox:down-arrow {image: url(:/qt-project.org/styles/commonstyle/images/down-16.png);}
However in that directory the QComboBox arrow is inexistent and I can't seem to find it anywhere in the source, let alone piece together which URL would be correct to reach "other folders in the source tree" (the source path in 6.2 to the above button is6.2.2\Src\qtbase\src\widgets\styles\images
). Additionally, I am unable to get all of the icons in the above images folders to display, for instanceQComboBox:down-arrow {image: url(:/qt-project.org/styles/commonstyle/images/titlebar-unshade-16.png);}
renders nothing even though that icon exists in the same directory as down-16.png.Does anyone have any ideas on where the default icon might be located? Or should I be going down the older QStyle path rather than QStyleSheet?
Thanks
-
Did you try to use QDir to go through the resource file structure ?