How to obtain entire Qt StyleSheet for QMacStyle

Is it possible to obtain a text file of the entire Qt5 StyleSheet for QMacStyle (or its equivalent QProxyStyle that's apparently used in Qt5)?

I'm hoping to get a list of all the property:value pairs ('background-color', 'border-radius', 'margin-top', 'padding', etc.), along with their default settings, that are used for each of the common widgets (QPushButton, QTabBar, etc.).

Qt5 on Mac OSX looks great due to all of the native-looking widgets (see eg Macintosh Style Widget Gallery). I'd like to perform some surgical replacements of a number of style properties in my application, but otherwise keep the native look-and-feel. (An alternate take on the problem, or at least on the same end goal, is represented in my related question How to override just one property:value pair in Qt StyleSheet.)

If I knew the entire Qt StyleSheet equivalent for a QTabBar or QPushButton, I could reconstruct the native look-and-feel in my own invocations of widget->setStyleSheet() , adding in my few necessary tweaks.

I've searched the entire Qt5.4.0 directory hoping to find a *.qss file representing OSX style, but to no avail (I found the promisingly named examples/widgets/widgets/stylesheet/qss/default.qss , however all it says inside is //* empty stylesheet *// ). I've exhausted my ideas running grep on the full Qt5 source directory, including in qt-everywhere-enterprise-src-5.4.0/qtbase/src/widgets/styles/ , which may indeed contain the details but not in very digestible form).

Thanks --


QMacStyle是一个QStyle子类,它使用Apple的HITheme进行绘制(查找文件qmacstyle_mac*以查看实现),因此没有样式表可以获取。

链接地址: http://www.djcxy.com/p/78998.html

上一篇: 使用CMake将QML文件添加到Qt Creator项目树中

下一篇: 如何为QMacStyle获取完整的Qt样式表