diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-05-13 19:34:29 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-05-22 14:20:58 +0000 |
commit | 9478053838ae2d950b162c2b93a2a400c82d9bf7 (patch) | |
tree | 317481f78a4c02e6c03ee6be50ac12df205e5b75 /src/imports/controls/qquickdefaulttheme_p.h | |
parent | 1a3c1a089ff088482c9d093f4fa002e2d47cc103 (diff) |
Create and init QQuickTheme from QtQuickControls2Plugin
Instead of creating and setting the QQuickTheme instance from each
style plugin (e.g. QtQuickControls2MaterialStylePlugin), create the
QQuickTheme instance in QtQuickControls2Plugin when the style is
being resolved, and just pass the instance to be initialized by the
style plugin(s). This avoids the problem that QQuickTheme API was
virtual, and sub-classes created from plugins would have vtables
destroyed before the QQuickTheme was destroyed.
Task-number: QTBUG-67062
Task-number: QTBUG-68087
Change-Id: I19e9ced5296b708c2668c30163389cb3da6be7cf
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls/qquickdefaulttheme_p.h')
-rw-r--r-- | src/imports/controls/qquickdefaulttheme_p.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/imports/controls/qquickdefaulttheme_p.h b/src/imports/controls/qquickdefaulttheme_p.h index f372b111..3a7311c7 100644 --- a/src/imports/controls/qquickdefaulttheme_p.h +++ b/src/imports/controls/qquickdefaulttheme_p.h @@ -48,17 +48,16 @@ // We mean it. // -#include <QtQuickTemplates2/private/qquicktheme_p.h> +#include <QtCore/qglobal.h> QT_BEGIN_NAMESPACE -class QQuickDefaultTheme : public QQuickTheme +class QQuickTheme; + +class QQuickDefaultTheme { public: - explicit QQuickDefaultTheme(); - -protected: - void resolve() override; + static void initialize(QQuickTheme *theme); }; QT_END_NAMESPACE |