diff options
author | Liang Qi <liang.qi@qt.io> | 2018-01-19 10:03:47 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-01-19 10:03:47 +0100 |
commit | 698a8268f786d74726eb07255df2d26ac2269079 (patch) | |
tree | 7f63974c3a13b507166e84459be7b5fc2787d2e1 /src | |
parent | 314d1bdf7d56462102639e12d34596cbfd4fce95 (diff) | |
parent | eb048e486daa3644476fdec5b0bd016b1729fc01 (diff) | |
download | qtquickcontrols-698a8268f786d74726eb07255df2d26ac2269079.tar.gz |
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
src/dialogs/qquickabstractfiledialog_p.h
tests/auto/controls/data/tst_combobox.qml
Change-Id: I62e54d0a2e89d987e05e8dfad6ae6aac1a32cc72
Diffstat (limited to 'src')
-rw-r--r-- | src/controls/Private/TableViewItemDelegateLoader.qml | 5 | ||||
-rw-r--r-- | src/controls/TreeView.qml | 22 | ||||
-rw-r--r-- | src/controls/doc/src/qtquickcontrols-index.qdoc | 2 | ||||
-rw-r--r-- | src/controls/doc/src/qtquickcontrolsstyles-index.qdoc | 2 | ||||
-rw-r--r-- | src/dialogs/doc/src/qtquickdialogs-index.qdoc | 2 | ||||
-rw-r--r-- | src/dialogs/qquickabstractdialog.cpp | 2 | ||||
-rw-r--r-- | src/dialogs/qquickabstractfiledialog.cpp | 2 | ||||
-rw-r--r-- | src/dialogs/qquickabstractfiledialog_p.h | 5 |
8 files changed, 28 insertions, 14 deletions
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 } } 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) } 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 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; } diff --git a/src/dialogs/qquickabstractfiledialog.cpp b/src/dialogs/qquickabstractfiledialog.cpp index b80bf86b..7c4aa394 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 cb7ac27e..e00db5be 100644 --- a/src/dialogs/qquickabstractfiledialog_p.h +++ b/src/dialogs/qquickabstractfiledialog_p.h @@ -75,8 +75,8 @@ class QQuickAbstractFileDialog : public QQuickAbstractDialog Q_PROPERTY(QList<QUrl> fileUrls READ fileUrls NOTIFY selectionAccepted) Q_PROPERTY(bool sidebarVisible READ sidebarVisible WRITE setSidebarVisible NOTIFY sidebarVisibleChanged) Q_PROPERTY(QString defaultSuffix READ defaultSuffix WRITE setDefaultSuffix NOTIFY defaultSuffixChanged) - 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); @@ -118,7 +118,6 @@ Q_SIGNALS: void fileModeChanged(); void selectionAccepted(); void sidebarVisibleChanged(); - void shortcutsChanged(); void defaultSuffixChanged(); protected Q_SLOTS: |