summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstyle.h
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2020-12-30 13:55:27 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2021-01-14 05:43:14 +0000
commit1bcfada9f04bd20a7a64d448fbf60c0f0820ed09 (patch)
treeff944b46ed1918663099b1b0b7020e16ae7d1d63 /src/widgets/styles/qstyle.h
parent47c6b5b91e0d1271075d98ded5aa7a25296b5ee3 (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/qstyle.h')
-rw-r--r--src/widgets/styles/qstyle.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h
index 0e3495306c..ec13fdb80d 100644
--- a/src/widgets/styles/qstyle.h
+++ b/src/widgets/styles/qstyle.h
@@ -73,6 +73,8 @@ public:
QStyle();
virtual ~QStyle();
+ QString name() const;
+
virtual void polish(QWidget *widget);
virtual void unpolish(QWidget *widget);
@@ -855,12 +857,16 @@ public:
const QStyle * proxy() const;
private:
+ void setName(const QString &name);
+
+private:
Q_DISABLE_COPY(QStyle)
friend class QWidget;
friend class QWidgetPrivate;
friend class QApplication;
friend class QProxyStyle;
friend class QProxyStylePrivate;
+ friend class QStyleFactory;
void setProxy(QStyle *style);
};