From 59d15ec7f1dc19634f47d2aa6fa17f749fa54cd4 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 5 Mar 2020 16:54:31 +0100 Subject: Fix deprecationwarning macro call This amends 52e5dc73b3f61e Change-Id: I671bf2577e845064413a2390366d147aba72d605 Reviewed-by: Mitch Curtis --- src/controls/doc/src/qtquickcontrolsstyles-index.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc b/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc index 9333ee27..c86488fa 100644 --- a/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc +++ b/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc @@ -60,7 +60,7 @@ \title Qt Quick Controls 1 Styles \brief The Qt Quick Controls Styles submodule provides custom styles for Qt Quick Controls. - \deprecation-warning + \deprecationwarning The Qt Quick Controls Styles submodule allows custom styling for \l {Qt Quick Controls 1}. @@ -132,7 +132,7 @@ \ingroup qmlmodules \brief Provides QML types for Qt Quick Controls styles. - \deprecation-warning + \deprecationwarning The \l{Qt Quick Controls 1} module provides a set of QML types for handling styles. -- cgit v1.2.1 From 9e13696c80af9242b0bf4d6f7c284d8537bb7147 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 10 Mar 2020 11:47:56 +0100 Subject: Fix build after header shuffling in qtbase Fixes: QTBUG-82787 Change-Id: I3f3f1537f1f6c8b27306aedcd38d056e0fa984b2 Reviewed-by: Ulf Hermann --- src/extras/Styles/Flat/qquicktexthandle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/extras/Styles/Flat/qquicktexthandle.cpp b/src/extras/Styles/Flat/qquicktexthandle.cpp index 6b8acb17..c55cf83d 100644 --- a/src/extras/Styles/Flat/qquicktexthandle.cpp +++ b/src/extras/Styles/Flat/qquicktexthandle.cpp @@ -39,6 +39,8 @@ #include "qquicktexthandle.h" +#include + QQuickTextHandle::QQuickTextHandle(QQuickItem *parent) : QQuickPaintedItem(parent) { -- cgit v1.2.1 From b26bfb18616e2a4baf33f9f1a2c147e3f5512de6 Mon Sep 17 00:00:00 2001 From: Alberto Mardegan Date: Sat, 29 Feb 2020 19:08:44 +0300 Subject: TreeView: update currentIndex on model changes The previous binding was not getting re-evaluated when the model was being reset or when rows were been inserted or removed. Here we use a counter variable, whose value change will force the evaluation of the binding. Fixes: QTBUG-53097 Change-Id: I76afebbda78ab477cf65631337a8bad51ca5428d Reviewed-by: Mitch Curtis --- src/controls/TreeView.qml | 8 +++++++- tests/auto/controls/data/tst_treeview.qml | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/controls/TreeView.qml b/src/controls/TreeView.qml index 6a38acff..2bedb9e6 100644 --- a/src/controls/TreeView.qml +++ b/src/controls/TreeView.qml @@ -49,7 +49,7 @@ BasicTableView { property var model: null property alias rootIndex: modelAdaptor.rootIndex - readonly property var currentIndex: modelAdaptor.mapRowToModelIndex(__currentRow) + readonly property var currentIndex: modelAdaptor.updateCount, modelAdaptor.mapRowToModelIndex(__currentRow) property ItemSelectionModel selection: null signal activated(var index) @@ -96,6 +96,12 @@ BasicTableView { id: modelAdaptor model: root.model + // Hack to force re-evaluation of the currentIndex binding + property int updateCount: 0 + onModelReset: updateCount++ + onRowsInserted: updateCount++ + onRowsRemoved: updateCount++ + onExpanded: root.expanded(index) onCollapsed: root.collapsed(index) } diff --git a/tests/auto/controls/data/tst_treeview.qml b/tests/auto/controls/data/tst_treeview.qml index 902d2178..324d9cff 100644 --- a/tests/auto/controls/data/tst_treeview.qml +++ b/tests/auto/controls/data/tst_treeview.qml @@ -848,5 +848,30 @@ Item { mouseClick(tree, semiIndent + 50, 20 + 50, Qt.LeftButton) verify(selectionModel.isSelected(parentItem)) } + + function test_QTBUG_53097_currentIndex_on_model_reset() + { + var component = Qt.createComponent("treeview/treeview_1.qml") + compare(component.status, Component.Ready) + var tree = component.createObject(container); + verify(tree !== null, "tree created is null") + tree.headerVisible = false + var model = tree.model + waitForRendering(tree) + + /* Select the first row */ + verify(!tree.currentIndex.valid) + mouseClick(tree, semiIndent + 50, 20, Qt.LeftButton) + compare(tree.currentIndex.row, 0) + + spy.clear() + spy.target = tree + spy.signalName = "currentIndexChanged" + compare(spy.count, 0) + + /* delete the row: the currentIndex must be updated */ + model.removeRows(0, 1) + compare(spy.count, 1) + } } } -- cgit v1.2.1 From eb554a20ec5c48643784ce7b29f97ccfb31e7f89 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 10 Mar 2020 13:11:45 +0100 Subject: Fix incomplete QPainterPath Fixes: QTBUG-82787 Change-Id: Ib481c9f8454ccc1b7398e2c03b1db16c310ec7e2 Reviewed-by: Jarek Kobus --- src/extras/Styles/Flat/qquicktexthandle.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/extras/Styles/Flat/qquicktexthandle.cpp b/src/extras/Styles/Flat/qquicktexthandle.cpp index c55cf83d..48a73b18 100644 --- a/src/extras/Styles/Flat/qquicktexthandle.cpp +++ b/src/extras/Styles/Flat/qquicktexthandle.cpp @@ -38,6 +38,7 @@ ****************************************************************************/ #include "qquicktexthandle.h" +#include #include -- cgit v1.2.1 From e9ad3352df0815761c1fde8ea36b040e8431f360 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Fri, 20 Mar 2020 10:41:24 +0200 Subject: Docs: recommend to use QtQuickControls 2 Dialog on Android Fixes: QTBUG-82781 Change-Id: I98bb77d9118d05b16235cc1107d6e7a74b70fc65 Reviewed-by: Andy Shaw --- src/dialogs/qquickdialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dialogs/qquickdialog.cpp b/src/dialogs/qquickdialog.cpp index 4ccc0f9d..eeb9cda8 100644 --- a/src/dialogs/qquickdialog.cpp +++ b/src/dialogs/qquickdialog.cpp @@ -56,6 +56,8 @@ QT_BEGIN_NAMESPACE The purpose of Dialog is to wrap arbitrary content into a \e {dialog window} including a row of platform-tailored buttons. + \note On Android, it is recommended to use \l {QQuickDialog}{Qt Quick Controls 2 Dialog}. + The \l contentItem is the default property (the only allowed child element), and items declared inside the Dialog will actually be children of another Item inside the \c contentItem. The row of \l standardButtons will -- cgit v1.2.1