summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf2
-rw-r--r--src/controls/Private/BasicTableView.qml2
-rw-r--r--src/controls/Private/TableViewItemDelegateLoader.qml2
-rw-r--r--src/controls/Private/qquickstyleitem.cpp11
-rw-r--r--src/controls/Private/qquicktreemodeladaptor.cpp4
-rw-r--r--src/dialogs/DefaultFileDialog.qml3
-rw-r--r--src/dialogs/qquickabstractfiledialog.cpp2
-rw-r--r--src/widgets/widgetsplugin.cpp9
-rw-r--r--tests/auto/controls/data/tst_scrollview.qml10
-rw-r--r--tests/auto/dialogs/tst_dialogs.cpp4
-rw-r--r--tests/auto/qquicktreemodeladaptor/tst_qquicktreemodeladaptor.cpp2
11 files changed, 33 insertions, 18 deletions
diff --git a/.qmake.conf b/.qmake.conf
index d06443e3..1bc14c0d 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -2,4 +2,4 @@ load(qt_build_config)
CONFIG += warning_clean
android|ios|qnx|isEmpty(QT.widgets.name): CONFIG += no_desktop
-MODULE_VERSION = 5.12.2
+MODULE_VERSION = 5.13.0
diff --git a/src/controls/Private/BasicTableView.qml b/src/controls/Private/BasicTableView.qml
index 37ecabbf..bc044eeb 100644
--- a/src/controls/Private/BasicTableView.qml
+++ b/src/controls/Private/BasicTableView.qml
@@ -341,7 +341,6 @@ ScrollView {
var col = getColumn(i)
var header = __listView.headerItem.headerRepeater.itemAt(i)
if (col) {
- col.__index = i
col.resizeToContents()
if (col.width < header.implicitWidth)
col.width = header.implicitWidth
@@ -613,7 +612,6 @@ ScrollView {
onItemAdded: {
var columnItem = columnModel.get(index).columnItem
- item.__index = index
item.__rowItem = rowitem
item.__column = columnItem
}
diff --git a/src/controls/Private/TableViewItemDelegateLoader.qml b/src/controls/Private/TableViewItemDelegateLoader.qml
index 462a2bb4..c5c6584a 100644
--- a/src/controls/Private/TableViewItemDelegateLoader.qml
+++ b/src/controls/Private/TableViewItemDelegateLoader.qml
@@ -71,7 +71,7 @@ Loader {
: __column && __column.delegate ? __column.delegate : __itemDelegate
// All these properties are internal
- property int __index
+ property int __index: index
property Item __rowItem: null
property var __model: __rowItem ? __rowItem.itemModel : undefined
property var __modelData: __rowItem ? __rowItem.itemModelData : undefined
diff --git a/src/controls/Private/qquickstyleitem.cpp b/src/controls/Private/qquickstyleitem.cpp
index 1e53fa69..f9596d35 100644
--- a/src/controls/Private/qquickstyleitem.cpp
+++ b/src/controls/Private/qquickstyleitem.cpp
@@ -919,7 +919,7 @@ QSize QQuickStyleItem1::sizeFromContents(int width, int height)
}
if (btn->toolButtonStyle != Qt::ToolButtonIconOnly) {
QSize textSize = btn->fontMetrics.size(Qt::TextShowMnemonic, btn->text);
- textSize.setWidth(textSize.width() + btn->fontMetrics.width(QLatin1Char(' '))*2);
+ textSize.setWidth(textSize.width() + btn->fontMetrics.horizontalAdvance(QLatin1Char(' '))*2);
if (btn->toolButtonStyle == Qt::ToolButtonTextUnderIcon) {
h += 4 + textSize.height();
if (textSize.width() > w)
@@ -939,7 +939,7 @@ QSize QQuickStyleItem1::sizeFromContents(int width, int height)
case Button: {
QStyleOptionButton *btn = qstyleoption_cast<QStyleOptionButton*>(m_styleoption);
- int contentWidth = btn->fontMetrics.width(btn->text);
+ int contentWidth = btn->fontMetrics.horizontalAdvance(btn->text);
int contentHeight = btn->fontMetrics.height();
if (!btn->icon.isNull()) {
//+4 matches a hardcoded value in QStyle and acts as a margin between the icon and the text.
@@ -958,7 +958,7 @@ QSize QQuickStyleItem1::sizeFromContents(int width, int height)
break;
case ComboBox: {
QStyleOptionComboBox *btn = qstyleoption_cast<QStyleOptionComboBox*>(m_styleoption);
- int newWidth = qMax(width, btn->fontMetrics.width(btn->currentText));
+ int newWidth = qMax(width, btn->fontMetrics.horizontalAdvance(btn->currentText));
int newHeight = qMax(height, btn->fontMetrics.height());
size = qApp->style()->sizeFromContents(QStyle::CT_ComboBox, m_styleoption, QSize(newWidth, newHeight)); }
break;
@@ -1007,7 +1007,8 @@ QSize QQuickStyleItem1::sizeFromContents(int width, int height)
case GroupBox: {
QStyleOptionGroupBox *box = qstyleoption_cast<QStyleOptionGroupBox*>(m_styleoption);
QFontMetrics metrics(box->fontMetrics);
- int baseWidth = metrics.width(box->text) + metrics.width(QLatin1Char(' '));
+ int baseWidth = metrics.horizontalAdvance(box->text)
+ + metrics.horizontalAdvance(QLatin1Char(' '));
int baseHeight = metrics.height() + m_contentHeight;
if (box->subControls & QStyle::SC_GroupBoxCheckBox) {
baseWidth += qApp->style()->pixelMetric(QStyle::PM_IndicatorWidth);
@@ -1466,7 +1467,7 @@ void QQuickStyleItem1::paint(QPainter *painter)
QPixmap pixmap;
// Only draw through style once
const QString pmKey = QLatin1Literal("itemrow") % QString::number(m_styleoption->state,16) % activeControl();
- if (!QPixmapCache::find(pmKey, pixmap) || pixmap.width() < width() || height() != pixmap.height()) {
+ if (!QPixmapCache::find(pmKey, &pixmap) || pixmap.width() < width() || height() != pixmap.height()) {
int newSize = width();
pixmap = QPixmap(newSize, height());
pixmap.fill(Qt::transparent);
diff --git a/src/controls/Private/qquicktreemodeladaptor.cpp b/src/controls/Private/qquicktreemodeladaptor.cpp
index 287b388f..c2c36494 100644
--- a/src/controls/Private/qquicktreemodeladaptor.cpp
+++ b/src/controls/Private/qquicktreemodeladaptor.cpp
@@ -741,13 +741,13 @@ void QQuickTreeModelAdaptor1::modelRowsAboutToBeMoved(const QModelIndex & source
int bufferCopyOffset;
if (destIndex > endIndex) {
for (int i = endIndex + 1; i < destIndex; i++) {
- m_items.swap(i, i - totalMovedCount); // Fast move from 1st to 2nd position
+ m_items.swapItemsAt(i, i - totalMovedCount); // Fast move from 1st to 2nd position
}
bufferCopyOffset = destIndex - totalMovedCount;
} else {
// NOTE: we will not enter this loop if startIndex == destIndex
for (int i = startIndex - 1; i >= destIndex; i--) {
- m_items.swap(i, i + totalMovedCount); // Fast move from 1st to 2nd position
+ m_items.swapItemsAt(i, i + totalMovedCount); // Fast move from 1st to 2nd position
}
bufferCopyOffset = destIndex;
}
diff --git a/src/dialogs/DefaultFileDialog.qml b/src/dialogs/DefaultFileDialog.qml
index 8911976c..da273fc9 100644
--- a/src/dialogs/DefaultFileDialog.qml
+++ b/src/dialogs/DefaultFileDialog.qml
@@ -51,8 +51,7 @@ import "qml"
AbstractFileDialog {
id: root
- Component {
- id: modelComponent
+ property Component modelComponent: Component {
FolderListModel {
showFiles: !root.selectFolder
nameFilters: root.selectedNameFilterExtensions
diff --git a/src/dialogs/qquickabstractfiledialog.cpp b/src/dialogs/qquickabstractfiledialog.cpp
index 7c4aa394..c608453f 100644
--- a/src/dialogs/qquickabstractfiledialog.cpp
+++ b/src/dialogs/qquickabstractfiledialog.cpp
@@ -118,8 +118,10 @@ QUrl QQuickAbstractFileDialog::folder() const
static QUrl fixupFolder(const QUrl &f)
{
QString lf = f.toLocalFile();
+#ifndef Q_OS_WIN // Don't mangle Windows network paths
while (lf.startsWith("//"))
lf.remove(0, 1);
+#endif
if (lf.isEmpty())
lf = QDir::currentPath();
return QUrl::fromLocalFile(lf);
diff --git a/src/widgets/widgetsplugin.cpp b/src/widgets/widgetsplugin.cpp
index 3289e6fd..6617319b 100644
--- a/src/widgets/widgetsplugin.cpp
+++ b/src/widgets/widgetsplugin.cpp
@@ -39,10 +39,19 @@
#include <QtQml/qqmlextensionplugin.h>
#include <QtQml/qqml.h>
+#include <QtWidgets/qtwidgetsglobal.h>
+#if QT_CONFIG(messagebox)
#include "qquickqmessagebox_p.h"
+#endif // QT_CONFIG(messagebox)
+#if QT_CONFIG(filedialog)
#include "qquickqfiledialog_p.h"
+#endif // QT_CONFIG(filedialog)
+#if QT_CONFIG(colordialog)
#include "qquickqcolordialog_p.h"
+#endif // QT_CONFIG(colordialog)
+#if QT_CONFIG(fontdialog)
#include "qquickqfontdialog_p.h"
+#endif // QT_CONFIG(fontdialog)
QT_BEGIN_NAMESPACE
diff --git a/tests/auto/controls/data/tst_scrollview.qml b/tests/auto/controls/data/tst_scrollview.qml
index d3bfac4b..a3c8eab3 100644
--- a/tests/auto/controls/data/tst_scrollview.qml
+++ b/tests/auto/controls/data/tst_scrollview.qml
@@ -179,6 +179,8 @@ TestCase {
}
function test_dragFetchAppend() { // QTBUG-50795
+ skip("This is flaky: QTBUG-55727. Can't use BLACKLIST because of QTBUG-74117.")
+
var scrollView = dragFetchAppendComponent.createObject(container)
verify(scrollView !== null, "view created is null")
waitForRendering(scrollView)
@@ -197,8 +199,12 @@ TestCase {
mouseRelease(scrollView, scrollView.width - 2, 8 + 16)
waitForRendering(scrollView)
- verify(Math.round(scrollView.flickableItem.contentHeight) > 60 * 20)
- verify(Math.round(scrollView.flickableItem.contentY) < -(60 * 20))
+ tryVerify(
+ function() { return Math.round(scrollView.flickableItem.contentHeight) > 60 * 20 },
+ 50, "contentHeight did not adjust to new data.")
+ tryVerify(
+ function() { return Math.round(scrollView.flickableItem.contentY) < -(60 * 20) },
+ 50, "contentY did not adjust to new data.")
scrollView.destroy()
}
diff --git a/tests/auto/dialogs/tst_dialogs.cpp b/tests/auto/dialogs/tst_dialogs.cpp
index 8303ff83..58f23534 100644
--- a/tests/auto/dialogs/tst_dialogs.cpp
+++ b/tests/auto/dialogs/tst_dialogs.cpp
@@ -159,7 +159,7 @@ void tst_dialogs::dialogButtonHandler()
root->setProperty("mustBlock", mustBlock);
QQuickWindow *window = root->findChild<QQuickWindow*>();
- QTest::qWaitForWindowExposed(window);
+ QVERIFY(QTest::qWaitForWindowExposed(window));
/* Hack to find the created buttons: since they are created by a
* QQuickRepeater, they don't appear on the hierarchy tree; therefore, we
@@ -242,7 +242,7 @@ void tst_dialogs::dialogKeyHandler()
root->setProperty("mustBlock", mustBlock);
QQuickWindow *window = root->findChild<QQuickWindow*>();
- QTest::qWaitForWindowExposed(window);
+ QVERIFY(QTest::qWaitForWindowExposed(window));
QTest::keyClick(window, Qt::Key(key));
QTRY_VERIFY(root->property("handlerWasCalled").toBool());
diff --git a/tests/auto/qquicktreemodeladaptor/tst_qquicktreemodeladaptor.cpp b/tests/auto/qquicktreemodeladaptor/tst_qquicktreemodeladaptor.cpp
index 96659a2c..0fec548d 100644
--- a/tests/auto/qquicktreemodeladaptor/tst_qquicktreemodeladaptor.cpp
+++ b/tests/auto/qquicktreemodeladaptor/tst_qquicktreemodeladaptor.cpp
@@ -1384,7 +1384,7 @@ void tst_QQuickTreeModelAdaptor::hasChildrenEmit()
QModelIndex root = model.index(0,0);
QVERIFY(root.isValid());
- QModelIndex child = root.child(0,0);
+ QModelIndex child = model.index(0, 0, root);
QVERIFY(child.isValid());
// Root not expanded , child not expanded, insert in child, expect no datachanged