From 8a0f0553e4eb8468513bbb8ba45a9ec2bcd6ce68 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 13 Dec 2017 18:44:41 +0100 Subject: TableView: Don't unset the delegate loader source component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Once we've loaded the delegate, we want to keep it. Constantly deleting and recreating items is rather wasteful. The items could already be moved to a different location before, so keeping them around when the item is completely disabled doesn't make much of a difference. We do retain the behavior of only instantiating the delegate once we add it to the table, though. Change-Id: Ic3cd016bc6990f0a9695b5aeb0d1de3aad0f4ca1 Task-number: QTBUG-62809 Reviewed-by: Tor Arne Vestbø Reviewed-by: J-P Nurmi Reviewed-by: Louis du Verdier --- src/controls/Private/TableViewItemDelegateLoader.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controls/Private/TableViewItemDelegateLoader.qml b/src/controls/Private/TableViewItemDelegateLoader.qml index 544b08f8..462a2bb4 100644 --- a/src/controls/Private/TableViewItemDelegateLoader.qml +++ b/src/controls/Private/TableViewItemDelegateLoader.qml @@ -65,7 +65,9 @@ Loader { width: __column ? __column.width : 0 height: parent ? parent.height : 0 visible: __column ? __column.visible : false - sourceComponent: __model === undefined || styleData.row === -1 ? null + + property bool isValid: false + sourceComponent: (__model === undefined || !isValid) ? null : __column && __column.delegate ? __column.delegate : __itemDelegate // All these properties are internal @@ -95,5 +97,6 @@ Loader { readonly property var value: model && model.hasOwnProperty(role) ? model[role] // Qml ListModel and QAbstractItemModel : modelData && modelData.hasOwnProperty(role) ? modelData[role] // QObjectList / QObject : modelData != undefined ? modelData : "" // Models without role + onRowChanged: if (row !== -1) itemDelegateLoader.isValid = true } } -- cgit v1.2.1 From a60d3e0df7085d077aaed93d9243cf3d57b59464 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 12 Jan 2017 15:57:20 +0100 Subject: TreeView: allow selecting items by touch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only single items can be selected via an actual touchscreen, because the keyboard modifiers are not accessible in a mouse event synthesized from touch. With a mouse, if the system has a touchscreen, then selections done by consecutive clicking (with or without modifiers) will work, whereas dragging across a consecutive range will not work because dragging is the same as flicking. But on systems which do not have a touchscreen at all, the behavior is the same as before. Task-number: QTBUG-47243 Change-Id: Ib0fa1a75592b982fe93da46f0c2e3018219947d0 Reviewed-by: Gabriel de Dietrich Reviewed-by: Jan Arve Sæther Reviewed-by: Shawn Rutledge --- src/controls/TreeView.qml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/controls/TreeView.qml b/src/controls/TreeView.qml index aa21acc1..6a38acff 100644 --- a/src/controls/TreeView.qml +++ b/src/controls/TreeView.qml @@ -118,8 +118,8 @@ BasicTableView { z: -1 propagateComposedEvents: true focus: true - // Note: with boolean preventStealing we are keeping - // the flickable from eating our mouse press events + // If there is not a touchscreen, keep the flickable from eating our mouse drags. + // If there is a touchscreen, flicking is possible, but selection can be done only by tapping, not by dragging. preventStealing: !Settings.hasTouchScreen property var clickedIndex: undefined @@ -323,8 +323,22 @@ BasicTableView { modelAdaptor.collapse(modelIndex) else modelAdaptor.expand(modelIndex) - } else if (root.__activateItemOnSingleClick) { - root.activated(modelIndex) + } else { + if (Settings.hasTouchScreen) { + // compensate for the fact that onPressed didn't select on press: do it here instead + pressedIndex = modelAdaptor.mapRowToModelIndex(clickIndex) + pressedColumn = __listView.columnAt(mouseX) + selectOnRelease = false + __listView.forceActiveFocus() + __listView.currentIndex = clickIndex + if (!clickedIndex) + clickedIndex = pressedIndex + mouseSelect(pressedIndex, mouse.modifiers, false) + if (!mouse.modifiers) + clickedIndex = pressedIndex + } + if (root.__activateItemOnSingleClick && !mouse.modifiers) + root.activated(modelIndex) } root.clicked(modelIndex) } -- cgit v1.2.1 From 4397b10d7fee0e1183141942fde8af2d0382794d Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 12 Jan 2017 15:57:20 +0100 Subject: TreeView: avoid skipping some tests now that it has touchscreen support Task-number: QTBUG-47243 Change-Id: I19d06df099a9da253059d2d0aa4a290b41a17ada Reviewed-by: Qt CI Bot Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_treeview.qml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/auto/controls/data/tst_treeview.qml b/tests/auto/controls/data/tst_treeview.qml index dad10a6b..b46d4dc2 100644 --- a/tests/auto/controls/data/tst_treeview.qml +++ b/tests/auto/controls/data/tst_treeview.qml @@ -114,8 +114,6 @@ Item { function test_clicked_signals() { - if (Settings.hasTouchScreen) - skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -165,8 +163,6 @@ Item { function test_headerHidden() { - if (Settings.hasTouchScreen) - skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -282,8 +278,6 @@ Item { function test_keys_navigation() { - if (Settings.hasTouchScreen) - skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_2.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -338,8 +332,6 @@ Item { function test_selection_singleSelection() { - if (Settings.hasTouchScreen) - skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -465,8 +457,6 @@ Item { function test_selection_multiSelection() { - if (Settings.hasTouchScreen) - skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -576,8 +566,6 @@ Item { function test_selection_extendedSelection() { - if (Settings.hasTouchScreen) - skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -664,8 +652,6 @@ Item { function test_selection_contiguousSelection() { - if (Settings.hasTouchScreen) - skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -762,8 +748,6 @@ Item { function test_indexAt() { skip("Fails because of bug QTBUG-47523") - if (Settings.hasTouchScreen) - skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -832,8 +816,6 @@ Item { function test_QTBUG_46891_selection_collapse_parent() { - if (Settings.hasTouchScreen) - skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); -- cgit v1.2.1 From 8da20ddef88cb48b7bb09ff7dc1db6517add8e72 Mon Sep 17 00:00:00 2001 From: Antti Kokko Date: Thu, 4 Jan 2018 13:29:02 +0200 Subject: Add changes file for Qt 5.9.4 Change-Id: I9303f0747aec1b9ec296bd05f74ef934d75e5d8c Reviewed-by: J-P Nurmi Reviewed-by: Mitch Curtis --- dist/changes-5.9.4 | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 dist/changes-5.9.4 diff --git a/dist/changes-5.9.4 b/dist/changes-5.9.4 new file mode 100644 index 00000000..350760d9 --- /dev/null +++ b/dist/changes-5.9.4 @@ -0,0 +1,44 @@ +Qt 5.9.4 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.9.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +http://doc.qt.io/qt-5/index.html + +The Qt version 5.9 series is binary compatible with the 5.8.x series. +Applications compiled for 5.8 will continue to run with 5.9. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Qt 5.9.4 Changes * +**************************************************************************** + + - [QTBUG-64488] Fixed the Base style resources to get initialized in + static builds. + + - Changed the default style name to be selected at runtime instead of + compile time. This gives a more accurate mapping, especially on desktop + OSes using alternative platform plugins where the Desktop style is not + useful. + + - Calendar: + * [QTBUG-64068] Fixed a bug when NaN was displayed instead of date. + + - ScrollView: + * [QTBUG-64052] Fixed scrollbar handles when there is no content. + * [QTBUG-64596] Fixed cyclic tab navigation. + + - TableView: + * [QTBUG-62809] Improved scrolling performance by retaining delegate + loader source component once the delegate has been loaded. + + - TreeView: + * [QTBUG-47243] Changed to allow selecting items by touch. -- cgit v1.2.1 From 919cc4ac1bd3528ec367a06f32c98b5f2934d0c6 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 23 Nov 2017 11:43:38 +0100 Subject: Fix tst_combobox There was a bogus timer firing once after the test had been running 500 ms. The timer was supposed to be used as a workaround on Mac, but since it had running set to true, it was actually firing once on all platforms. The timer was originally added in 6254af5. The test function ended up being skipped on Mac, so the timer was actually pointless. Task-number: QTBUG-64664 Reviewed-by: Liang Qi (cherry picked from commit a749525164b771452599e67e277d2ea6b3866479) Change-Id: Icebda05c872ba2de690e87bd0a9968670f203ce2 Reviewed-by: J-P Nurmi --- tests/auto/controls/data/tst_combobox.qml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index 632a1d15..d6a5f6c3 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -66,14 +66,6 @@ TestCase { property var model - Timer { - id: timer - running: true - repeat: false - interval: 500 - onTriggered: testCase.keyPress(Qt.Key_Escape) - } - function init() { model = Qt.createQmlObject("import QtQuick 2.2; ListModel {}", testCase, '') model.append({ text: "Banana", color: "Yellow" }) @@ -505,17 +497,13 @@ TestCase { var comboBox = Qt.createQmlObject('import QtQuick.Controls 1.2 ; ComboBox { model: 4 }', container, ''); comboBox.activeFocusOnPress = false verify(!comboBox.activeFocus) - if (Qt.platform.os === "osx") // on mac when the menu open, the __popup function does not return - timer.start() - else // two mouse clicks to open and close the popup menu - mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1) + // two mouse clicks to open and close the popup menu + mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1) mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1) verify(!comboBox.activeFocus) comboBox.activeFocusOnPress = true - if (Qt.platform.os === "osx") // on mac when the menu open, the __popup function does not return - timer.start() - else // two mouse clicks to open and close the popup menu - mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1) + // two mouse clicks to open and close the popup menu + mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1) mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1) verify(comboBox.activeFocus) comboBox.destroy() -- cgit v1.2.1 From 5f0bd47f81469407023bc9b05b13cdf1834d50b3 Mon Sep 17 00:00:00 2001 From: Jarkko Koivikko Date: Sun, 7 Jan 2018 16:52:29 +0200 Subject: Dialogs: Fix minor memory leak in QQuickAbstractDialog If Dialogs decoration component is not an Item based object, there is a minor memory leak in error cleanup path, causing the object to leak. Change-Id: I79295378303e460ad0024d5994fed28ddd37b591 Reviewed-by: Mitch Curtis Reviewed-by: Shawn Rutledge Reviewed-by: Jarkko Koivikko --- src/dialogs/qquickabstractdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dialogs/qquickabstractdialog.cpp b/src/dialogs/qquickabstractdialog.cpp index ce87d56c..e00c17a1 100644 --- a/src/dialogs/qquickabstractdialog.cpp +++ b/src/dialogs/qquickabstractdialog.cpp @@ -230,7 +230,7 @@ void QQuickAbstractDialog::decorationLoaded() } else { qWarning() << m_decorationComponent->url() << "cannot be used as a window decoration because it's not an Item"; - delete m_windowDecoration; + delete decoration; delete m_decorationComponent; m_decorationComponent = 0; } -- cgit v1.2.1 From 38414f9262aebe9e77dcb181a1672d2e929fbb48 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 10 Jan 2018 17:03:57 +0100 Subject: Fix DefaultFileDialog binding loop warnings Remove change signals from the shortcuts and __shortcuts properties, as they don't change after being populated for the first time. Task-number: QTBUG-53707 Change-Id: If305a6d63ebd98e6082fc5b7d89a63aaab6c1f43 Reviewed-by: Qt CI Bot Reviewed-by: J-P Nurmi Reviewed-by: Shawn Rutledge --- src/dialogs/qquickabstractfiledialog.cpp | 2 -- src/dialogs/qquickabstractfiledialog_p.h | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/dialogs/qquickabstractfiledialog.cpp b/src/dialogs/qquickabstractfiledialog.cpp index 49d98a1a..722838e2 100644 --- a/src/dialogs/qquickabstractfiledialog.cpp +++ b/src/dialogs/qquickabstractfiledialog.cpp @@ -298,8 +298,6 @@ void QQuickAbstractFileDialog::populateShortcuts() for (const QFileInfo &fi : drives) addShortcut(fi.absoluteFilePath(), fi.absoluteFilePath(), fi.absoluteFilePath()); #endif - - emit shortcutsChanged(); } QJSValue QQuickAbstractFileDialog::shortcuts() diff --git a/src/dialogs/qquickabstractfiledialog_p.h b/src/dialogs/qquickabstractfiledialog_p.h index b4b7165d..84816d38 100644 --- a/src/dialogs/qquickabstractfiledialog_p.h +++ b/src/dialogs/qquickabstractfiledialog_p.h @@ -74,8 +74,8 @@ class QQuickAbstractFileDialog : public QQuickAbstractDialog Q_PROPERTY(QUrl fileUrl READ fileUrl NOTIFY selectionAccepted) Q_PROPERTY(QList fileUrls READ fileUrls NOTIFY selectionAccepted) Q_PROPERTY(bool sidebarVisible READ sidebarVisible WRITE setSidebarVisible NOTIFY sidebarVisibleChanged) - Q_PROPERTY(QJSValue shortcuts READ shortcuts NOTIFY shortcutsChanged) // map of QStandardDirectory names to QUrls - Q_PROPERTY(QJSValue __shortcuts READ __shortcuts NOTIFY shortcutsChanged) // map of details for QML dialog implementations + Q_PROPERTY(QJSValue shortcuts READ shortcuts CONSTANT) // map of QStandardDirectory names to QUrls + Q_PROPERTY(QJSValue __shortcuts READ __shortcuts CONSTANT) // map of details for QML dialog implementations public: QQuickAbstractFileDialog(QObject *parent = 0); @@ -115,7 +115,6 @@ Q_SIGNALS: void fileModeChanged(); void selectionAccepted(); void sidebarVisibleChanged(); - void shortcutsChanged(); protected Q_SLOTS: void updateFolder(const QUrl &f); -- cgit v1.2.1 From eb048e486daa3644476fdec5b0bd016b1729fc01 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 12 Jan 2018 15:54:04 +0100 Subject: Doc: Change wording on when module was introduced Change to past tense. Change-Id: I623ecbf4586b9212ceba5be15f18b0946b2de884 Reviewed-by: J-P Nurmi --- src/controls/doc/src/qtquickcontrols-index.qdoc | 2 +- src/controls/doc/src/qtquickcontrolsstyles-index.qdoc | 2 +- src/dialogs/doc/src/qtquickdialogs-index.qdoc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controls/doc/src/qtquickcontrols-index.qdoc b/src/controls/doc/src/qtquickcontrols-index.qdoc index 2dc7d13b..63753ae1 100644 --- a/src/controls/doc/src/qtquickcontrols-index.qdoc +++ b/src/controls/doc/src/qtquickcontrols-index.qdoc @@ -34,7 +34,7 @@ The Qt Quick Controls module provides a set of controls that can be used to build complete interfaces in Qt Quick. - The module is new in Qt 5.1. + The module was introduced in Qt 5.1. Visit the \l{Qt Quick Controls Overview} page to get started. diff --git a/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc b/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc index 69180295..100868a9 100644 --- a/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc +++ b/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc @@ -62,7 +62,7 @@ The Qt Quick Controls Styles submodule allows custom styling for \l {Qt Quick Controls}. - The submodule is new in Qt 5.1. + The submodule was introduced in Qt 5.1. \section1 Getting started diff --git a/src/dialogs/doc/src/qtquickdialogs-index.qdoc b/src/dialogs/doc/src/qtquickdialogs-index.qdoc index 0adf28af..7404dac9 100644 --- a/src/dialogs/doc/src/qtquickdialogs-index.qdoc +++ b/src/dialogs/doc/src/qtquickdialogs-index.qdoc @@ -31,7 +31,7 @@ \brief Qt Quick Dialogs submodule - The module is new in Qt 5.1. + The module was introduced in Qt 5.1. \section1 Dialogs -- cgit v1.2.1