diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2020-12-30 13:55:27 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2021-01-14 05:43:14 +0000 |
commit | 1bcfada9f04bd20a7a64d448fbf60c0f0820ed09 (patch) | |
tree | ff944b46ed1918663099b1b0b7020e16ae7d1d63 /src/widgets/styles/qproxystyle.cpp | |
parent | 47c6b5b91e0d1271075d98ded5aa7a25296b5ee3 (diff) |
QStyle: add name() to return the name of the style
Currently there is no way to get the name of the current style to e.g.
create a QProxyStyle for a specific widget only.
Therefore add QStyle::name() so QProxyStyle(const QString &) can be
called without hard-coding the style name.
Remove an unused doc snippet as drive-by.
Fixes: QTBUG-8004
Change-Id: I466c5e870a5392b238365bdc930f6a2ecee50cdb
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/styles/qproxystyle.cpp')
-rw-r--r-- | src/widgets/styles/qproxystyle.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/widgets/styles/qproxystyle.cpp b/src/widgets/styles/qproxystyle.cpp index ecad637957..31fe587ce2 100644 --- a/src/widgets/styles/qproxystyle.cpp +++ b/src/widgets/styles/qproxystyle.cpp @@ -72,6 +72,13 @@ QT_BEGIN_NAMESPACE or system controlled styles. It would not work on a Mac, for example, where menus are handled by the operating system. + When a proxy style should be set on a specific widget only, you have + to make sure to not set the proxy on the global application style which + is returned by QWidget::style(). You have to create a separate custom style + for the widget similar to: + + \snippet code/src_gui_qproxystyle.cpp 2 + \sa QStyle */ |