diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-03-08 21:52:42 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-03-08 21:52:42 +0100 |
commit | c767e996ca4d6372fe14748874777ac8b13e9ec3 (patch) | |
tree | 94cbac2f94416cc9c7626a21414460c50f1c21f0 | |
parent | d579c1c8aef5b497801d0484461182ed04fe4aa0 (diff) | |
parent | 01d076d0e81e5d8825fcdc16544f826530bd5ace (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
tests/auto/controls/data/tst_combobox.qml
Change-Id: I9d0c9a8adbe098720f0766e38db8aa2be4ed7408
-rw-r--r-- | src/imports/controls/Pane.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/controls.pro | 2 | ||||
-rw-r--r-- | src/imports/controls/material/Pane.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/universal/Pane.qml | 2 | ||||
-rw-r--r-- | src/templates/qquickcombobox.cpp | 2 | ||||
-rw-r--r-- | src/templates/qquickswipeview.cpp | 1 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_combobox.qml | 35 |
7 files changed, 41 insertions, 5 deletions
diff --git a/src/imports/controls/Pane.qml b/src/imports/controls/Pane.qml index fbbe0c38..7b95cd8a 100644 --- a/src/imports/controls/Pane.qml +++ b/src/imports/controls/Pane.qml @@ -37,7 +37,7 @@ import QtQuick 2.6 import Qt.labs.templates 1.0 as T -T.Frame { +T.Pane { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) diff --git a/src/imports/controls/controls.pro b/src/imports/controls/controls.pro index 9a3f9628..0fc73673 100644 --- a/src/imports/controls/controls.pro +++ b/src/imports/controls/controls.pro @@ -25,7 +25,7 @@ RESOURCES += \ $$PWD/qtlabscontrolsplugin.qrc include(controls.pri) -!ios: include(designer/designer.pri) +!static: include(designer/designer.pri) qtquickcompiler { qmlfiles.prefix = /qt-project.org/imports/Qt/labs/controls diff --git a/src/imports/controls/material/Pane.qml b/src/imports/controls/material/Pane.qml index 5f48aaf8..b936f08f 100644 --- a/src/imports/controls/material/Pane.qml +++ b/src/imports/controls/material/Pane.qml @@ -38,7 +38,7 @@ import QtQuick 2.6 import Qt.labs.templates 1.0 as T import Qt.labs.controls.material 1.0 -T.Frame { +T.Pane { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) diff --git a/src/imports/controls/universal/Pane.qml b/src/imports/controls/universal/Pane.qml index c0f87075..138b4ad4 100644 --- a/src/imports/controls/universal/Pane.qml +++ b/src/imports/controls/universal/Pane.qml @@ -38,7 +38,7 @@ import QtQuick 2.6 import Qt.labs.templates 1.0 as T import Qt.labs.controls.universal 1.0 -T.Frame { +T.Pane { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) diff --git a/src/templates/qquickcombobox.cpp b/src/templates/qquickcombobox.cpp index 75492924..f352eb6b 100644 --- a/src/templates/qquickcombobox.cpp +++ b/src/templates/qquickcombobox.cpp @@ -786,7 +786,7 @@ void QQuickComboBox::keyReleaseEvent(QKeyEvent *event) break; case Qt::Key_Enter: case Qt::Key_Return: - d->hidePopup(true); + d->hidePopup(d->isPopupVisible()); setPressed(false); event->accept(); break; diff --git a/src/templates/qquickswipeview.cpp b/src/templates/qquickswipeview.cpp index ec51da49..63dc525f 100644 --- a/src/templates/qquickswipeview.cpp +++ b/src/templates/qquickswipeview.cpp @@ -142,6 +142,7 @@ void QQuickSwipeView::geometryChanged(const QRectF &newGeometry, const QRectF &o void QQuickSwipeView::itemAdded(int, QQuickItem *item) { Q_D(QQuickSwipeView); + QQuickItemPrivate::get(item)->setCulled(true); // QTBUG-51078, QTBUG-51669 if (isComponentComplete()) item->setSize(QSizeF(d->contentItem->width(), d->contentItem->height())); } diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index 6e593967..61d9b9fa 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -786,4 +786,39 @@ TestCase { control.destroy() } + + function test_activation_data() { + return [ + { tag: "open:enter", key: Qt.Key_Enter, open: true }, + { tag: "open:return", key: Qt.Key_Return, open: true }, + { tag: "closed:enter", key: Qt.Key_Enter, open: false }, + { tag: "closed:return", key: Qt.Key_Return, open: false } + ] + } + + // QTBUG-51645 + function test_activation(data) { + var control = comboBox.createObject(applicationWindow.contentItem, {currentIndex: 1, model: ["Apple", "Orange", "Banana"]}) + verify(control) + + waitForRendering(control) + control.forceActiveFocus() + verify(control.activeFocus) + + if (data.open) + keyClick(Qt.Key_Space) + compare(control.popup.visible, data.open) + + compare(control.currentIndex, 1) + compare(control.currentText, "Orange") + compare(control.displayText, "Orange") + + keyClick(data.key) + + compare(control.currentIndex, 1) + compare(control.currentText, "Orange") + compare(control.displayText, "Orange") + + control.destroy() + } } |