From 2b91e5392105d4d1ea85397e6db4ab831cc8737e Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 23 Aug 2016 16:12:50 +0200 Subject: QQuickStylePlugin: avoid re-creating the proxy theme QQuickStylePlugin::initializeEngine() is called multiple times due to multiple QQmlEngine instances (like in qml2puppet). Don't attempt to re-create the proxy theme on the second round. Thanks to QScopedPointer, the old proxy theme instance was automatically destroyed and thus, the new proxy theme crashed. Task-number: QTBUG-54995 Change-Id: I1648c789df062fdfda54302c77f471139a8de88f Reviewed-by: Mitch Curtis --- src/quickcontrols2/qquickstyleplugin.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/quickcontrols2/qquickstyleplugin.cpp b/src/quickcontrols2/qquickstyleplugin.cpp index 7f6e1323..3a4a0952 100644 --- a/src/quickcontrols2/qquickstyleplugin.cpp +++ b/src/quickcontrols2/qquickstyleplugin.cpp @@ -60,6 +60,11 @@ void QQuickStylePlugin::initializeEngine(QQmlEngine *engine, const char *uri) Q_UNUSED(engine); Q_UNUSED(uri); + // make sure not to re-create the proxy theme if initializeEngine() + // is called multiple times, like in case of qml2puppet (QTBUG-54995) + if (!m_theme.isNull()) + return; + const QString style = name(); if (!style.isEmpty() && style.compare(QQuickStyle::name(), Qt::CaseInsensitive) == 0) { m_theme.reset(createTheme()); -- cgit v1.2.3 From 6beb454e2ca4ce6a25ae1637d8dd9d395a18443c Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 24 Aug 2016 12:02:20 +0200 Subject: Fix typo in deployment documentation Change-Id: If80bbdc82efed0451c27650d59c2bee5ad44c765 Reviewed-by: J-P Nurmi --- src/imports/controls/doc/src/qtquickcontrols2-deployment.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imports/controls/doc/src/qtquickcontrols2-deployment.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-deployment.qdoc index 51a9b613..fe78ca55 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-deployment.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-deployment.qdoc @@ -30,7 +30,7 @@ \title Deploying Qt Quick Controls 2 Applications Deployment of Qt Quick Controls 2 applications is very similar to - deploment of other types of Qt applications. However, there are a few + deployment of other types of Qt applications. However, there are a few factors to consider. \section1 Deploying an Application with Several Styles -- cgit v1.2.3 From 6b4a6b0deb54f9a65d75d9c9f1e60b32ced1a781 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 24 Aug 2016 13:37:43 +0200 Subject: TabBar: improve the behavior of flickable tabs When using flickable tabs, make sure the next or previous tab is a bit visible to make it clear that there are more tabs and ensure that the content is not flickable when there is less content than available size. Change-Id: I231ac8e99007103517ff49e747282af43cc6f8ea Task-number: QTBUG-55129 Reviewed-by: Mitch Curtis --- src/imports/controls/TabBar.qml | 8 +++++++- src/imports/controls/material/TabBar.qml | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/imports/controls/TabBar.qml b/src/imports/controls/TabBar.qml index 6f3e040b..6a575167 100644 --- a/src/imports/controls/TabBar.qml +++ b/src/imports/controls/TabBar.qml @@ -34,7 +34,7 @@ ** ****************************************************************************/ -import QtQuick 2.6 +import QtQuick 2.7 import QtQuick.Templates 2.0 as T T.TabBar { @@ -58,7 +58,13 @@ T.TabBar { spacing: control.spacing orientation: ListView.Horizontal boundsBehavior: Flickable.StopAtBounds + flickableDirection: Flickable.AutoFlickIfNeeded snapMode: ListView.SnapToItem + + highlightMoveDuration: 0 + highlightRangeMode: ListView.ApplyRange + preferredHighlightBegin: 40 + preferredHighlightEnd: width - 40 } //! [contentItem] diff --git a/src/imports/controls/material/TabBar.qml b/src/imports/controls/material/TabBar.qml index 22a80efa..901e3328 100644 --- a/src/imports/controls/material/TabBar.qml +++ b/src/imports/controls/material/TabBar.qml @@ -34,7 +34,7 @@ ** ****************************************************************************/ -import QtQuick 2.6 +import QtQuick 2.7 import QtQuick.Templates 2.0 as T import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material.impl 2.0 @@ -59,11 +59,16 @@ T.TabBar { spacing: control.spacing orientation: ListView.Horizontal boundsBehavior: Flickable.StopAtBounds + flickableDirection: Flickable.AutoFlickIfNeeded snapMode: ListView.SnapToItem highlightMoveDuration: 250 highlightResizeDuration: 0 highlightFollowsCurrentItem: true + highlightRangeMode: ListView.ApplyRange + preferredHighlightBegin: 48 + preferredHighlightEnd: width - 48 + highlight: Item { z: 2 Rectangle { -- cgit v1.2.3