Where is a reference for the customizable stylesheet properties for Qt widgets?

我是研究僧i 提交于 2019-12-24 12:24:31

问题


I've been struggling with learning how to use stylesheets to customize the look of my widgets in Qt.

For example, after much effort, I just figured out that the name of the property that determines what color the text on a QComboBox drop-down menu is when it is mouse-over'd is selection-color, and the background color is selection-background-color. But most of that I discovered by random guess-and-check.

Where can I find documentation that will actually tell me these things so I don't have to guess? Does Qt follow some sort of standard naming convention?


回答1:


http://doc.qt.nokia.com/latest/stylesheet-reference.html




回答2:


http://doc.qt.io/qt-5/stylesheet-examples.html

The above link gives examples for pretty much every control. For the combobox it mentions the QAbstractItemView, and mentions that you need selection-background-color etc... to style it - with an example.

It doesn't always explain what each property does however, which is where the doc that baysmith linked to comes in.

So with these two documents together you should be in good shape.



来源:https://stackoverflow.com/questions/6655408/where-is-a-reference-for-the-customizable-stylesheet-properties-for-qt-widgets

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!