Merge remote-tracking branch 'origin/5.6' into 5.7

Conflicts:
	tests/auto/controls/data/tst_combobox.qml

Change-Id: I9d0c9a8adbe098720f0766e38db8aa2be4ed7408
This commit is contained in:
Liang Qi 2016-03-08 21:52:42 +01:00
commit c767e996ca
7 changed files with 41 additions and 5 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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;

View File

@ -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()));
}

View File

@ -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()
}
}