summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-02-28 13:04:50 +0100
committerLiang Qi <liang.qi@qt.io>2017-02-28 13:04:50 +0100
commit43d417b127215f53cb01ac14a558fec705fbf4ad (patch)
treed4bee35bc3dc7d2e60b006a18a68c55ec05a2cd6
parent0abc7fc48a3502f14940d2d2c4e6bbd1a73ba438 (diff)
parent0e92d0ae2e21f01769f6768223a411c06b953989 (diff)
downloadqtquickcontrols-43d417b127215f53cb01ac14a558fec705fbf4ad.tar.gz
Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I94576b77aaa6021bbb2adb1279b3ae0918eefa54
-rw-r--r--src/dialogs/qquickplatformfiledialog.cpp7
-rw-r--r--src/dialogs/qquickplatformfiledialog_p.h1
-rw-r--r--tests/auto/extras/data/tst_gauge.qml18
3 files changed, 15 insertions, 11 deletions
diff --git a/src/dialogs/qquickplatformfiledialog.cpp b/src/dialogs/qquickplatformfiledialog.cpp
index 2d99ae1e..ab228d1f 100644
--- a/src/dialogs/qquickplatformfiledialog.cpp
+++ b/src/dialogs/qquickplatformfiledialog.cpp
@@ -213,7 +213,6 @@ QPlatformFileDialogHelper *QQuickPlatformFileDialog::helper()
if (!m_dlgHelper)
return m_dlgHelper;
m_dlgHelper->setOptions(m_options);
- connect(m_dlgHelper, SIGNAL(directoryEntered(QUrl)), this, SLOT(updateFolder(QUrl)));
connect(m_dlgHelper, SIGNAL(filterSelected(QString)), this, SIGNAL(filterSelected()));
connect(m_dlgHelper, SIGNAL(accept()), this, SLOT(accept()));
connect(m_dlgHelper, SIGNAL(reject()), this, SLOT(reject()));
@@ -222,6 +221,12 @@ QPlatformFileDialogHelper *QQuickPlatformFileDialog::helper()
return m_dlgHelper;
}
+void QQuickPlatformFileDialog::accept()
+{
+ updateFolder(folder());
+ QQuickFileDialog::accept();
+}
+
/*!
\qmlproperty bool FileDialog::visible
diff --git a/src/dialogs/qquickplatformfiledialog_p.h b/src/dialogs/qquickplatformfiledialog_p.h
index 42e59332..419843f4 100644
--- a/src/dialogs/qquickplatformfiledialog_p.h
+++ b/src/dialogs/qquickplatformfiledialog_p.h
@@ -67,6 +67,7 @@ public:
protected:
QPlatformFileDialogHelper *helper() Q_DECL_OVERRIDE;
+ virtual void accept() override;
Q_DISABLE_COPY(QQuickPlatformFileDialog)
};
diff --git a/tests/auto/extras/data/tst_gauge.qml b/tests/auto/extras/data/tst_gauge.qml
index 6fdd6be6..77dd099d 100644
--- a/tests/auto/extras/data/tst_gauge.qml
+++ b/tests/auto/extras/data/tst_gauge.qml
@@ -254,28 +254,26 @@ TestCase {
gauge.height = gaugeHeightFor100PixelHighValueBar(gauge);
compare(gauge.__panel.barLength, 100);
- // Give stuff time to re-layout after the new control height, etc.,
- // otherwise we'll be comparing against incorrect pixel positions.
- wait(0);
-
for (var tickmarkIndex = 0; tickmarkIndex < data.expectedTickmarkValues.length; ++tickmarkIndex) {
var tickmark = TestUtils.findChild(gauge, "tickmark" + tickmarkIndex);
- compare(tickmark.value, data.expectedTickmarkValues[tickmarkIndex],
- "Value of tickmark at index " + tickmarkIndex + " is " + data.expectedTickmarkValues[tickmarkIndex]);
+ // QTBUG-58859: give stuff time to re-layout after the new control height, etc.,
+ // otherwise we'll be comparing against incorrect pixel positions.
+ tryCompare(tickmark, "value", data.expectedTickmarkValues[tickmarkIndex], undefined,
+ "Value of tickmark at index " + tickmarkIndex + " should be " + data.expectedTickmarkValues[tickmarkIndex]);
var expectedValuePos = data.expectedTickmarkValuePositions[tickmarkIndex];
- compare(tickmark.valuePosition, expectedValuePos,
- "Value position of tickmark at index " + tickmarkIndex + " is " + expectedValuePos);
+ tryCompare(tickmark, "valuePosition", expectedValuePos, undefined,
+ "Value position of tickmark at index " + tickmarkIndex + " should be " + expectedValuePos);
}
for (var minorTickmarkIndex = 0; minorTickmarkIndex < data.expectedMinorTickmarkValues.length; ++minorTickmarkIndex) {
var minorTickmark = TestUtils.findChild(gauge, "minorTickmark" + minorTickmarkIndex);
compare(minorTickmark.value, data.expectedMinorTickmarkValues[minorTickmarkIndex],
- "Value of minor tickmark at index " + minorTickmarkIndex + " is " + data.expectedMinorTickmarkValues[minorTickmarkIndex]);
+ "Value of minor tickmark at index " + minorTickmarkIndex + " should be " + data.expectedMinorTickmarkValues[minorTickmarkIndex]);
expectedValuePos = data.expectedMinorTickmarkValuePositions[minorTickmarkIndex];
compare(minorTickmark.valuePosition, expectedValuePos,
- "Value position of minor tickmark at index " + minorTickmarkIndex + " is " + expectedValuePos);
+ "Value position of minor tickmark at index " + minorTickmarkIndex + " should be " + expectedValuePos);
}
}