aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/qtquickcontrols2plugin.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-12-19 17:00:15 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-12-21 10:00:10 +0000
commit1e33020fc02b56001d805d3d66badd41480b746d (patch)
treeb2545765e805b5d97b610ccb4acb33192d7b2a66 /src/imports/controls/qtquickcontrols2plugin.cpp
parentda27cace5aa65c1972b746d9fc1d4507a04b5f93 (diff)
Default: eliminate internal IDs in DelayButton
An ID in the internal Text element prevented deferred execution for the whole content item. The ID was used for two reasons. First of all, it was used to propagate implicit size from the Text element to the root of the content item. Secondly, it was used to calculate clip areas to provide the same text in two different colors. This patch provides two internal C++ helpers, ItemGroup and ClippedText, that provide these functionalities without the need of using IDs in QML. At the same time we got rid of two wrapper Items and simplified some QML bindings, which results to a nice boost (18->22) in qmlbench on TX1. Task-number: QTBUG-65341 Change-Id: Icf9c09356cf5c0ed641bde537bee7291bd260057 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls/qtquickcontrols2plugin.cpp')
-rw-r--r--src/imports/controls/qtquickcontrols2plugin.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp
index 32270be0..e9471227 100644
--- a/src/imports/controls/qtquickcontrols2plugin.cpp
+++ b/src/imports/controls/qtquickcontrols2plugin.cpp
@@ -44,6 +44,8 @@
#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview)
#include <QtQuickControls2/private/qquicktumblerview_p.h>
#endif
+#include <QtQuickControls2/private/qquickclippedtext_p.h>
+#include <QtQuickControls2/private/qquickitemgroup_p.h>
#include "qquickdefaultbusyindicator_p.h"
#include "qquickdefaultprogressbar_p.h"
@@ -164,8 +166,10 @@ void QtQuickControls2Plugin::initializeEngine(QQmlEngine *engine, const char *ur
qmlRegisterModule(import, 2, QT_VERSION_MINOR - 7); // Qt 5.7->2.0, 5.8->2.1, 5.9->2.2...
qmlRegisterType<QQuickDefaultBusyIndicator>(import, 2, 0, "BusyIndicatorImpl");
+ qmlRegisterType<QQuickClippedText>(import, 2, 2, "ClippedText");
qmlRegisterType<QQuickDefaultProgressBar>(import, 2, 0, "ProgressBarImpl");
qmlRegisterType<QQuickDialRing>(import, 2, 0, "DialRing");
+ qmlRegisterType<QQuickItemGroup>(import, 2, 2, "ItemGroup");
qmlRegisterType<QQuickPlaceholderText>(import, 2, 2, "PlaceholderText");
#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview)
qmlRegisterType<QQuickTumblerView>(import, 2, 1, "TumblerView");