Update README sections to better describe extending stylesheets.

main
Alex Huszagh 2022-04-29 11:45:08 -05:00
parent 0e3d5150c1
commit 9ed3ed5e86
1 changed files with 5 additions and 6 deletions

View File

@ -15,7 +15,7 @@ This stylesheet aims to be similar across all platforms, and provide a nice UI f
- [PyQt5 Installation](#pyqt5-installation) - [PyQt5 Installation](#pyqt5-installation)
- [PyQt6 Installation](#pyqt6-installation) - [PyQt6 Installation](#pyqt6-installation)
- [Features](#features) - [Features](#features)
- [Limitations](#limitations) - [Extending Stylesheets](#extending-stylesheets)
- [Debugging](#debugging) - [Debugging](#debugging)
- [Development Guide](#development-guide) - [Development Guide](#development-guide)
- [Configuring](#configuring) - [Configuring](#configuring)
@ -391,7 +391,7 @@ def main():
- Cross-platform icon packs for standard icons. - Cross-platform icon packs for standard icons.
- Extensible stylesheets: add your own plugins or rules and automatically configure them using the same configuration syntax. - Extensible stylesheets: add your own plugins or rules and automatically configure them using the same configuration syntax.
# Limitations # Extending Stylesheets
There are some limitations of using Qt stylesheets in general, which cannot be solved by stylesheets. To get more fine-grained style control, you should subclass `QCommonStyle`: There are some limitations of using Qt stylesheets in general, which cannot be solved by stylesheets. To get more fine-grained style control, you should subclass `QCommonStyle`:
@ -402,16 +402,15 @@ class ApplicationStyle: public QCommonStyle
} }
``` ```
For an example of using QCommonStyle to override standard icons in a PyQt application, see [standard_icons.py](/example/standard_icons.py).
An extensive reference can be found [here](https://doc.qt.io/qt-5/style-reference.html). A reference of QStyle, and the default styles Qt provides can be found [here](https://doc.qt.io/qt-5/qstyle.html).
The limitations of stylesheets include: The limitations of stylesheets include:
- Using custom standard icons.
- Scaling icons with the theme size. - Scaling icons with the theme size.
- QToolButton cannot control the icon size without also affecting the arrow size. - QToolButton cannot control the icon size without also affecting the arrow size.
- Close and dock float icon sizes scale poorly with font size. - Close and dock float icon sizes scale poorly with font size.
For an example of using QCommonStyle to override standard icons in a PyQt application, see [standard_icons.py](/example/standard_icons.py). An extensive reference can be found [here](https://doc.qt.io/qt-5/style-reference.html). A reference of QStyle, and the default styles Qt provides can be found [here](https://doc.qt.io/qt-5/qstyle.html).
# Debugging # Debugging
Have an issue with the styles? Here's a few suggestions, prior to filing a bug report: Have an issue with the styles? Here's a few suggestions, prior to filing a bug report: