summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-11-28 14:13:24 +0100
committerLiang Qi <liang.qi@qt.io>2016-11-28 14:13:30 +0100
commit35cca2149183db49ad1ca5972f66474c6f36dbe1 (patch)
tree88c2bdd71323b0e0bb2c9c207802b5f36a8d0f64
parent4e26a18ede1775ae06bef7c272994e84510ebd9a (diff)
parent84b48cadc8f68d57d1a750e6aec690f46582e0c5 (diff)
downloadqtquickcontrols-35cca2149183db49ad1ca5972f66474c6f36dbe1.tar.gz
Merge remote-tracking branch 'origin/5.8' into dev
Change-Id: I753e8b4d10714f2b8c3cf0fccfed4dc312adbd9b
-rw-r--r--src/controls/Calendar.qml4
-rw-r--r--src/controls/Private/BasicTableView.qml4
-rw-r--r--src/controls/doc/src/qtquickcontrols-tableview.qdoc4
-rw-r--r--src/dialogs/DefaultFileDialog.qml4
-rw-r--r--src/dialogs/plugin.cpp2
-rw-r--r--src/dialogs/plugins.qmltypes2
-rw-r--r--src/dialogs/qquickabstractdialog_p.h2
-rw-r--r--src/dialogs/qquickabstractfiledialog.cpp16
-rw-r--r--src/dialogs/qquickabstractfiledialog_p.h3
-rw-r--r--src/dialogs/qquickdialog.cpp30
-rw-r--r--src/dialogs/qquickdialog_p.h10
-rw-r--r--src/dialogs/qquickplatformfiledialog.cpp2
-rw-r--r--sync.profile13
-rw-r--r--tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp7
-rw-r--r--tests/auto/extras/data/tst_piemenu.qml26
15 files changed, 82 insertions, 47 deletions
diff --git a/src/controls/Calendar.qml b/src/controls/Calendar.qml
index bbc562cc..96896480 100644
--- a/src/controls/Calendar.qml
+++ b/src/controls/Calendar.qml
@@ -218,7 +218,9 @@ Control {
*/
property CalendarModel __model: CalendarModel {
locale: calendar.__locale
- visibleDate: new Date(visibleYear, visibleMonth, 1)
+
+ // TODO: don't set the hour when QTBUG-56787 is fixed
+ visibleDate: new Date(visibleYear, visibleMonth, 1, 12)
}
style: Settings.styleComponent(Settings.style, "CalendarStyle.qml", calendar)
diff --git a/src/controls/Private/BasicTableView.qml b/src/controls/Private/BasicTableView.qml
index 4ec32264..66ad0d36 100644
--- a/src/controls/Private/BasicTableView.qml
+++ b/src/controls/Private/BasicTableView.qml
@@ -474,8 +474,8 @@ ScrollView {
property bool pressed: false
}
}
- property int rowHeight: rowSizeItem.implicitHeight
- property int paddedRowCount: height/rowHeight
+ property int rowHeight: Math.floor(rowSizeItem.implicitHeight)
+ property int paddedRowCount: rowHeight != 0 ? height/rowHeight : 0
y: listView.contentHeight - listView.contentY + listView.originY
width: parent.width
diff --git a/src/controls/doc/src/qtquickcontrols-tableview.qdoc b/src/controls/doc/src/qtquickcontrols-tableview.qdoc
index ba16b115..9d43c6a6 100644
--- a/src/controls/doc/src/qtquickcontrols-tableview.qdoc
+++ b/src/controls/doc/src/qtquickcontrols-tableview.qdoc
@@ -223,8 +223,8 @@
\list
\li function \b clear() - deselects all rows
\li function \b selectAll() - selects all rows
- \li function \b select(from, to) - select a range
- \li function \b deselect(from, to) - de-selects a range
+ \li function \b select(from, to) - selects a range
+ \li function \b deselect(from, to) - deselects a range
\li function \b forEach(callback) - iterates over all selected rows
\li function \b contains(index) - checks whether the selection includes the given index
\li signal \b selectionChanged() - the current row selection changed
diff --git a/src/dialogs/DefaultFileDialog.qml b/src/dialogs/DefaultFileDialog.qml
index cc663ccb..8911976c 100644
--- a/src/dialogs/DefaultFileDialog.qml
+++ b/src/dialogs/DefaultFileDialog.qml
@@ -472,8 +472,8 @@ AbstractFileDialog {
id: okButton
text: root.selectFolder ? qsTr("Choose") : (selectExisting ? qsTr("Open") : qsTr("Save"))
onClicked: {
- if (view.model.isFolder(view.currentIndex) && !selectFolder)
- dirDown(view.model.get(view.currentIndex, "filePath"))
+ if (view.model.isFolder(view.currentRow) && !selectFolder)
+ dirDown(view.model.get(view.currentRow, "filePath"))
else if (!(root.selectExisting))
currentPathField.doAccept()
else
diff --git a/src/dialogs/plugin.cpp b/src/dialogs/plugin.cpp
index 23eeac38..5a13bc9b 100644
--- a/src/dialogs/plugin.cpp
+++ b/src/dialogs/plugin.cpp
@@ -177,7 +177,7 @@ public:
// Dialog
{
// @uri QtQuick.Dialogs.AbstractDialog
- qmlRegisterType<QQuickDialog>(uri, 1, 2, "AbstractDialog"); // implementation wrapper
+ qmlRegisterType<QQuickDialog1>(uri, 1, 2, "AbstractDialog"); // implementation wrapper
QUrl dialogQmlPath = m_useResources ?
QUrl("qrc:/QtQuick/Dialogs/DefaultDialogWrapper.qml") :
#ifndef QT_STATIC
diff --git a/src/dialogs/plugins.qmltypes b/src/dialogs/plugins.qmltypes
index 6e21c16f..82c910ed 100644
--- a/src/dialogs/plugins.qmltypes
+++ b/src/dialogs/plugins.qmltypes
@@ -325,7 +325,7 @@ Module {
Property { name: "contentItem"; type: "QQuickItem"; isPointer: true }
}
Component {
- name: "QQuickDialog"
+ name: "QQuickDialog1"
defaultProperty: "contentItem"
prototype: "QQuickAbstractDialog"
exports: ["QtQuick.Dialogs/AbstractDialog 1.2"]
diff --git a/src/dialogs/qquickabstractdialog_p.h b/src/dialogs/qquickabstractdialog_p.h
index 0a761bf3..54dbaace 100644
--- a/src/dialogs/qquickabstractdialog_p.h
+++ b/src/dialogs/qquickabstractdialog_p.h
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
class QQuickAbstractDialog : public QObject
{
Q_OBJECT
- // TODO move the enum to QQuickDialog at the same time that QQuickMessageDialog inherits from it
+ // TODO move the enum to QQuickDialog1 at the same time that QQuickMessageDialog inherits from it
Q_ENUMS(StandardButton)
Q_FLAGS(StandardButtons)
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibilityChanged)
diff --git a/src/dialogs/qquickabstractfiledialog.cpp b/src/dialogs/qquickabstractfiledialog.cpp
index 6bfc1db0..c0b3400c 100644
--- a/src/dialogs/qquickabstractfiledialog.cpp
+++ b/src/dialogs/qquickabstractfiledialog.cpp
@@ -115,20 +115,32 @@ QUrl QQuickAbstractFileDialog::folder() const
return m_options->initialDirectory();
}
-void QQuickAbstractFileDialog::setFolder(const QUrl &f)
+static QUrl fixupFolder(const QUrl &f)
{
QString lf = f.toLocalFile();
while (lf.startsWith("//"))
lf.remove(0, 1);
if (lf.isEmpty())
lf = QDir::currentPath();
- QUrl u = QUrl::fromLocalFile(lf);
+ return QUrl::fromLocalFile(lf);
+}
+
+void QQuickAbstractFileDialog::setFolder(const QUrl &f)
+{
+ QUrl u = fixupFolder(f);
if (m_dlgHelper)
m_dlgHelper->setDirectory(u);
m_options->setInitialDirectory(u);
emit folderChanged();
}
+void QQuickAbstractFileDialog::updateFolder(const QUrl &f)
+{
+ QUrl u = fixupFolder(f);
+ m_options->setInitialDirectory(u);
+ emit folderChanged();
+}
+
void QQuickAbstractFileDialog::setNameFilters(const QStringList &f)
{
m_options->setNameFilters(f);
diff --git a/src/dialogs/qquickabstractfiledialog_p.h b/src/dialogs/qquickabstractfiledialog_p.h
index 370a31cc..b4b7165d 100644
--- a/src/dialogs/qquickabstractfiledialog_p.h
+++ b/src/dialogs/qquickabstractfiledialog_p.h
@@ -117,6 +117,9 @@ Q_SIGNALS:
void sidebarVisibleChanged();
void shortcutsChanged();
+protected Q_SLOTS:
+ void updateFolder(const QUrl &f);
+
protected:
void updateModes();
void addShortcut(const QString &name, const QString &visibleName, const QString &path);
diff --git a/src/dialogs/qquickdialog.cpp b/src/dialogs/qquickdialog.cpp
index 33e3b02b..485eeb43 100644
--- a/src/dialogs/qquickdialog.cpp
+++ b/src/dialogs/qquickdialog.cpp
@@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Dialog
- \instantiates QQuickDialog
+ \instantiates QQuickDialog1
\inqmlmodule QtQuick.Dialogs
\ingroup qtquickdialogs
\brief A generic QtQuick dialog wrapper with standard buttons.
@@ -203,11 +203,11 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \class QQuickDialog
+ \class QQuickDialog1
\inmodule QtQuick.Dialogs
\internal
- The QQuickDialog class represents a container for arbitrary
+ The QQuickDialog1 class represents a container for arbitrary
dialog contents.
\since 5.3
@@ -216,7 +216,7 @@ QT_BEGIN_NAMESPACE
/*!
Constructs a dialog wrapper with parent window \a parent.
*/
-QQuickDialog::QQuickDialog(QObject *parent)
+QQuickDialog1::QQuickDialog1(QObject *parent)
: QQuickAbstractDialog(parent)
, m_enabledButtons(Ok)
, m_clickedButton(NoButton)
@@ -227,30 +227,30 @@ QQuickDialog::QQuickDialog(QObject *parent)
/*!
Destroys the dialog wrapper.
*/
-QQuickDialog::~QQuickDialog()
+QQuickDialog1::~QQuickDialog1()
{
}
-QJSValue QQuickDialog::__standardButtonsLeftModel()
+QJSValue QQuickDialog1::__standardButtonsLeftModel()
{
updateStandardButtons();
return m_standardButtonsLeftModel;
}
-QJSValue QQuickDialog::__standardButtonsRightModel()
+QJSValue QQuickDialog1::__standardButtonsRightModel()
{
updateStandardButtons();
return m_standardButtonsRightModel;
}
-void QQuickDialog::setVisible(bool v)
+void QQuickDialog1::setVisible(bool v)
{
if (v)
m_clickedButton = NoButton;
QQuickAbstractDialog::setVisible(v);
}
-void QQuickDialog::updateStandardButtons()
+void QQuickDialog1::updateStandardButtons()
{
if (m_standardButtonsRightModel.isUndefined()) {
QJSEngine *engine = qmlEngine(this);
@@ -293,7 +293,7 @@ void QQuickDialog::updateStandardButtons()
}
}
-void QQuickDialog::setTitle(const QString &arg)
+void QQuickDialog1::setTitle(const QString &arg)
{
if (m_title != arg) {
m_title = arg;
@@ -301,7 +301,7 @@ void QQuickDialog::setTitle(const QString &arg)
}
}
-void QQuickDialog::setStandardButtons(StandardButtons buttons)
+void QQuickDialog1::setStandardButtons(StandardButtons buttons)
{
m_enabledButtons = buttons;
m_standardButtonsLeftModel = QJSValue();
@@ -339,7 +339,7 @@ void QQuickDialog::setStandardButtons(StandardButtons buttons)
\endqml
*/
-void QQuickDialog::click(QPlatformDialogHelper::StandardButton button, QPlatformDialogHelper::ButtonRole role)
+void QQuickDialog1::click(QPlatformDialogHelper::StandardButton button, QPlatformDialogHelper::ButtonRole role)
{
m_clickedButton = static_cast<StandardButton>(button);
emit buttonClicked();
@@ -378,21 +378,21 @@ void QQuickDialog::click(QPlatformDialogHelper::StandardButton button, QPlatform
}
}
-void QQuickDialog::click(QQuickAbstractDialog::StandardButton button)
+void QQuickDialog1::click(QQuickAbstractDialog::StandardButton button)
{
click(static_cast<QPlatformDialogHelper::StandardButton>(button),
static_cast<QPlatformDialogHelper::ButtonRole>(
QPlatformDialogHelper::buttonRole(static_cast<QPlatformDialogHelper::StandardButton>(button))));
}
-void QQuickDialog::accept() {
+void QQuickDialog1::accept() {
// enter key is treated like OK
if (m_clickedButton == NoButton)
m_clickedButton = Ok;
QQuickAbstractDialog::accept();
}
-void QQuickDialog::reject() {
+void QQuickDialog1::reject() {
// escape key is treated like cancel
if (m_clickedButton == NoButton)
m_clickedButton = Cancel;
diff --git a/src/dialogs/qquickdialog_p.h b/src/dialogs/qquickdialog_p.h
index 262ddb63..fec4ec9a 100644
--- a/src/dialogs/qquickdialog_p.h
+++ b/src/dialogs/qquickdialog_p.h
@@ -56,7 +56,7 @@
QT_BEGIN_NAMESPACE
-class QQuickDialog : public QQuickAbstractDialog
+class QQuickDialog1 : public QQuickAbstractDialog
{
Q_OBJECT
@@ -70,8 +70,8 @@ class QQuickDialog : public QQuickAbstractDialog
Q_CLASSINFO("DefaultProperty", "contentItem") // Dialog in QML can have only one child
public:
- explicit QQuickDialog(QObject *parent = 0);
- ~QQuickDialog();
+ explicit QQuickDialog1(QObject *parent = 0);
+ ~QQuickDialog1();
StandardButtons standardButtons() const { return m_enabledButtons; }
StandardButton clickedButton() const { return m_clickedButton; }
@@ -114,11 +114,11 @@ private:
StandardButton m_clickedButton;
QJSValue m_standardButtonsLeftModel;
QJSValue m_standardButtonsRightModel;
- Q_DISABLE_COPY(QQuickDialog)
+ Q_DISABLE_COPY(QQuickDialog1)
};
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickDialog *)
+QML_DECLARE_TYPE(QQuickDialog1 *)
#endif // QQUICKDIALOG_P_H
diff --git a/src/dialogs/qquickplatformfiledialog.cpp b/src/dialogs/qquickplatformfiledialog.cpp
index d70c44d9..2d99ae1e 100644
--- a/src/dialogs/qquickplatformfiledialog.cpp
+++ b/src/dialogs/qquickplatformfiledialog.cpp
@@ -213,7 +213,7 @@ QPlatformFileDialogHelper *QQuickPlatformFileDialog::helper()
if (!m_dlgHelper)
return m_dlgHelper;
m_dlgHelper->setOptions(m_options);
- connect(m_dlgHelper, SIGNAL(directoryEntered(QUrl)), this, SIGNAL(folderChanged()));
+ 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()));
diff --git a/sync.profile b/sync.profile
index 686e079c..dfc1d5d6 100644
--- a/sync.profile
+++ b/sync.profile
@@ -2,16 +2,3 @@
);
%moduleheaders = ( # restrict the module headers to those found in relative path
);
-# Module dependencies.
-# Every module that is required to build this module should have one entry.
-# Each of the module version specifiers can take one of the following values:
-# - A specific Git revision.
-# - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch)
-# - an empty string to use the same branch under test (dependencies will become "refs/heads/master" if we are in the master branch)
-#
-%dependencies = (
- "qtbase" => "",
- "qtdeclarative" => "",
- "qtxmlpatterns" => "",
- "qtgraphicaleffects" => ""
-);
diff --git a/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp b/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
index 8405c98b..67aeb586 100644
--- a/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
+++ b/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
@@ -110,7 +110,12 @@ void tst_customcontrolsstyle::style()
void tst_customcontrolsstyle::changeStyle()
{
qputenv("QT_QUICK_CONTROLS_1_STYLE", "Base");
- qputenv("QML2_IMPORT_PATH", QFile::encodeName(directory()));
+ QByteArray importPath = qgetenv("QML2_IMPORT_PATH");
+ if (importPath.isEmpty())
+ importPath = QFile::encodeName(directory());
+ else
+ importPath.prepend(QFile::encodeName(directory()) + QDir::listSeparator().toLatin1());
+ qputenv("QML2_IMPORT_PATH", importPath);
QQmlEngine engine;
diff --git a/tests/auto/extras/data/tst_piemenu.qml b/tests/auto/extras/data/tst_piemenu.qml
index dbb3db38..1e0e224e 100644
--- a/tests/auto/extras/data/tst_piemenu.qml
+++ b/tests/auto/extras/data/tst_piemenu.qml
@@ -256,6 +256,8 @@ Item {
actionSignalSpy.clear();
}
}
+
+ pieMenuComponent.destroy()
}
function test_selectionAngle_data() {
@@ -387,6 +389,8 @@ Item {
mouseMove(root, data.mouseX, data.mouseY);
compare(pieMenu.selectionAngle, data.expectedAngle);
compare(pieMenu.currentIndex, data.expectedCurrentIndex);
+
+ pieMenuComponent.destroy()
}
function test_sectionAngles_data() {
@@ -430,6 +434,8 @@ Item {
compare(pieMenu.__protectedScope.sectionStartAngle(data.section), data.expectedSectionStartAngle);
compare(pieMenu.__protectedScope.sectionCenterAngle(data.section), data.expectedSectionCenterAngle);
compare(pieMenu.__protectedScope.sectionEndAngle(data.section), data.expectedSectionEndAngle);
+
+ pieMenuComponent.destroy()
}
function test_bounds_data() {
@@ -507,6 +513,8 @@ Item {
// Angles shouldn't change.
compare(pieMenu.__style.startAngle, originalStartAngle);
compare(pieMenu.__style.endAngle, originalEndAngle);
+
+ pieMenuComponent.destroy()
}
function test_hideItem_data() {
@@ -571,6 +579,8 @@ Item {
actionSignalSpy.clear();
}
+
+ pieMenuComponent.destroy()
}
function test_addItem() {
@@ -606,6 +616,8 @@ Item {
pieMenu.removeItem(pieMenu.menuItems[pieMenu.menuItems.length - 1]);
compare(pieMenu.menuItems.length, originalLength - (i + 1));
}
+
+ pieMenuComponent.destroy()
}
function debugMousePosition(pieMenu, mouseX, mouseY, positionText) {
@@ -688,6 +700,8 @@ Item {
compare(pieMenu.currentIndex, expectedCurrentIndex, data[i].name + ": current index should be "
+ expectedCurrentIndex + " when mouse is at " + mouseX + ", " + mouseY);
}
+
+ pieMenuComponent.destroy()
}
function test_QTRD3027() {
@@ -718,6 +732,8 @@ Item {
mouseMove(root, 100, 98)
compare(pieMenu.currentIndex, -1)
compare(selectedAngleChangedSpy.count, 0)
+
+ pieMenuComponent.destroy()
}
function test_rotatedBoundingItem() {
@@ -742,6 +758,8 @@ Item {
mouseClick(root, 230, 145);
compare(actionSignalSpy.count, 1);
compare(actionSignalSpy.signalArguments[0][0], 0);
+
+ pieMenuComponent.destroy()
}
function test_boundingItem() {
@@ -773,6 +791,8 @@ Item {
container.width = oldContainerWidth;
container.height = oldContainerHeight;
+
+ pieMenuComponent.destroy()
}
function test_longPressTriggerOnClick() {
@@ -803,6 +823,8 @@ Item {
compare(pieMenu.visible, false);
compare(pieMenu.__mouseThief.receivedPressEvent, false);
compare(pieMenu.__protectedScope.pressedIndex, -1);
+
+ pieMenuComponent.destroy()
}
function test_keepMenuOpenWhenTriggered() {
@@ -833,6 +855,8 @@ Item {
tryCompare(pieMenu, "visible", true);
compare(actionSignalSpy.count, 1);
compare(actionSignalSpy.signalArguments[0][0], 2);
+
+ pieMenuComponent.destroy()
}
function test_pressedIndex() {
@@ -856,6 +880,8 @@ Item {
compare(actionSignalSpy.count, 1);
compare(actionSignalSpy.signalArguments[0][0], 0);
compare(pieMenu.__protectedScope.pressedIndex, -1);
+
+ pieMenuComponent.destroy()
}
}
}