diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-04-23 22:39:42 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-04-26 13:31:01 +0000 |
commit | 1780a817fce77f4875f001c2b95b41cd2cd06f2b (patch) | |
tree | 094393e6df2f93f678be0863e26c7e3fac0557d9 /src/quickcontrols2/qquickstyleselector_p_p.h | |
parent | 1c90f5386d95acbef11b70869897c487f4fe0e6e (diff) |
Optimize QQuickStyleSelector
QQuickStyle::name() accesses a Q_GLOBAL_STATIC and splits the style
path. Don't call it repeatedly, but store the value in constructor to
share it for all consequent select() calls. QQuickStyleSelector is
allocated on the stack in QtQuickControls2Plugin::registerTypes(), so
memory usage is no concern.
Change-Id: I31c1693bca277911232e3cbd7cb6f55b2aa7ed2a
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/quickcontrols2/qquickstyleselector_p_p.h')
-rw-r--r-- | src/quickcontrols2/qquickstyleselector_p_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quickcontrols2/qquickstyleselector_p_p.h b/src/quickcontrols2/qquickstyleselector_p_p.h index 0b37b13e..cc3f0a58 100644 --- a/src/quickcontrols2/qquickstyleselector_p_p.h +++ b/src/quickcontrols2/qquickstyleselector_p_p.h @@ -56,6 +56,7 @@ public: QString select(const QString &filePath) const; QUrl baseUrl; + QString style; }; QT_END_NAMESPACE |