aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dist/changes-5.12.260
-rw-r--r--src/imports/controls/DialogButtonBox.qml5
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc17
-rw-r--r--src/imports/controls/universal/DialogButtonBox.qml5
-rw-r--r--src/quicktemplates2/qquickcontainer.cpp2
-rw-r--r--src/quicktemplates2/qquickdialogbuttonbox.cpp7
-rw-r--r--src/quicktemplates2/qquicksplitview.cpp2
-rw-r--r--tests/auto/controls/data/tst_dialogbuttonbox.qml136
-rw-r--r--tests/auto/sanity/tst_sanity.cpp6
9 files changed, 224 insertions, 16 deletions
diff --git a/dist/changes-5.12.2 b/dist/changes-5.12.2
new file mode 100644
index 00000000..420ded77
--- /dev/null
+++ b/dist/changes-5.12.2
@@ -0,0 +1,60 @@
+Qt 5.12.2 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.12.0 through 5.12.1.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.12 series is binary compatible with the 5.11.x series.
+Applications compiled for 5.11 will continue to run with 5.12.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Controls *
+****************************************************************************
+
+ - [QTBUG-73849] Fixed incorrect documentation link to
+ Number.toLocaleString().
+ - [QTBUG-72536] Fixed bug with long text in ScrollView.
+ - [QTBUG-73447] Fixed Menu's appearance not changing when enabled state
+ changes
+ - [QTBUG-70181] Fixed disabled menu items getting focus.
+ - [QTBUG-69540] Fixed disabled sub-menu items being highlighted.
+ - [QTBUG-72023] Fixed font and palette settings in .conf files not being
+ respected.
+ - [QTBUG-69682] Fixed Menu not being dismissed when the triggered item
+ disables itself.
+ - [QTBUG-73412] Fixed Dial's new properties not being detected by Creator.
+ - [QTBUG-73202] Documented how to move active focus out of TextArea with
+ tab.
+ - [QTBUG-72786] Fixed palette colors not propagating to ComboBox's popup.
+ - [QTBUG-73179] Fixed Qt.labs.platform.FileDialog not honoring folder
+ property.
+ - [QTBUG-72811] Fixed AbstractButton's clicked() signal not being emitted
+ after long press.
+ - [QTBUG-72746] Fixed crash on exit when using popups.
+ - [QTBUG-72372] Fixed issue where a button would go outside of
+ DialogButtonBox.
+ - [QTBUG-71902] Fixed incorrect font size in certain styles on Windows.
+ - [QTBUG-72750] Fixed Slider's wheel event propagation.
+
+****************************************************************************
+* Controls *
+****************************************************************************
+
+Fusion
+------
+
+ - [QTBUG-70819] Made Active and Disabled button colors closer to Widgets'
+ Fusion style.
+ - [QTBUG-70819] Use white ButtonText when a dark system theme is in use.
+ - [QTBUG-70652] Use system palette for highlightedText instead of a fixed
+ white color.
diff --git a/src/imports/controls/DialogButtonBox.qml b/src/imports/controls/DialogButtonBox.qml
index 1b783b3b..3c9d5b48 100644
--- a/src/imports/controls/DialogButtonBox.qml
+++ b/src/imports/controls/DialogButtonBox.qml
@@ -41,9 +41,10 @@ T.DialogButtonBox {
id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
- (control.count === 1 ? contentWidth * 2 : contentWidth) + leftPadding + rightPadding)
+ (control.count === 1 ? implicitContentWidth * 2 : implicitContentWidth) + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
- contentHeight + topPadding + bottomPadding)
+ implicitContentHeight + topPadding + bottomPadding)
+ contentWidth: contentItem.contentWidth
spacing: 1
padding: 12
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc
index e30285de..40080840 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc
@@ -338,9 +338,19 @@
\li
\row
\li \l [QML QtQuickControls1] {SplitView}
- \li \mdash
- \li
+ \li \l [QML QtQuickControls2] {SplitView}
\li
+ \li \list
+ \li \b {Qt Quick Controls 1}: Uses \l Layout attached properties
+ to specify size hints.
+ \li \b {Qt Quick Controls 2}: Uses dedicated
+ \l [QML QtQuickControls2] {SplitView} attached properties
+ to specify size hints.
+ Allows \l {SplitView::saveState()}{saving} and
+ \l {SplitView::restoreState()}{restoring} state.
+ Separate attached \l SplitHandle API for managing split
+ handles.
+ \endlist
\row
\li \l [QML QtQuickControls1] {StackView},\br
\l [QML QtQuickControls1] {StackViewDelegate},\br
@@ -377,7 +387,8 @@
\row
\li \l [QML QtQuickControls1] {TableView}
\li \mdash
- \li
+ \li The new \l [QML QtQuick] {TableView} can be found in the Qt Quick
+ module.
\li
\row
\li \l [QML QtQuickControls1] {TextArea}
diff --git a/src/imports/controls/universal/DialogButtonBox.qml b/src/imports/controls/universal/DialogButtonBox.qml
index ac2dc541..0458c39d 100644
--- a/src/imports/controls/universal/DialogButtonBox.qml
+++ b/src/imports/controls/universal/DialogButtonBox.qml
@@ -43,9 +43,10 @@ T.DialogButtonBox {
id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
- (control.count === 1 ? contentWidth * 2 : contentWidth) + leftPadding + rightPadding)
+ (control.count === 1 ? implicitContentWidth * 2 : implicitContentWidth) + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
- contentHeight + topPadding + bottomPadding)
+ implicitContentHeight + topPadding + bottomPadding)
+ contentWidth: contentItem.contentWidth
spacing: 4
padding: 24
diff --git a/src/quicktemplates2/qquickcontainer.cpp b/src/quicktemplates2/qquickcontainer.cpp
index c4af6151..2c357f82 100644
--- a/src/quicktemplates2/qquickcontainer.cpp
+++ b/src/quicktemplates2/qquickcontainer.cpp
@@ -793,6 +793,7 @@ void QQuickContainer::setContentWidth(qreal width)
return;
d->contentWidth = width;
+ d->resizeContent();
emit contentWidthChanged();
}
@@ -832,6 +833,7 @@ void QQuickContainer::setContentHeight(qreal height)
return;
d->contentHeight = height;
+ d->resizeContent();
emit contentHeightChanged();
}
diff --git a/src/quicktemplates2/qquickdialogbuttonbox.cpp b/src/quicktemplates2/qquickdialogbuttonbox.cpp
index 8559ad15..03f5f8e8 100644
--- a/src/quicktemplates2/qquickdialogbuttonbox.cpp
+++ b/src/quicktemplates2/qquickdialogbuttonbox.cpp
@@ -241,11 +241,8 @@ void QQuickDialogButtonBoxPrivate::resizeContent()
return;
QRectF geometry = q->boundingRect().adjusted(q->leftPadding(), q->topPadding(), -q->rightPadding(), -q->bottomPadding());
- if (alignment != 0) {
- qreal cw = (alignment & Qt::AlignHorizontal_Mask) == 0 ? q->availableWidth() : contentItem->property("contentWidth").toReal();
- qreal ch = (alignment & Qt::AlignVertical_Mask) == 0 ? q->availableHeight() : contentItem->property("contentHeight").toReal();
- geometry = alignedRect(q->isMirrored() ? Qt::RightToLeft : Qt::LeftToRight, alignment, QSizeF(cw, ch), geometry);
- }
+ if (alignment != 0)
+ geometry = alignedRect(q->isMirrored() ? Qt::RightToLeft : Qt::LeftToRight, alignment, QSizeF(contentWidth, contentHeight), geometry);
contentItem->setPosition(geometry.topLeft());
contentItem->setSize(geometry.size());
diff --git a/src/quicktemplates2/qquicksplitview.cpp b/src/quicktemplates2/qquicksplitview.cpp
index 6d9e983e..cbba1671 100644
--- a/src/quicktemplates2/qquicksplitview.cpp
+++ b/src/quicktemplates2/qquicksplitview.cpp
@@ -248,8 +248,6 @@ QT_BEGIN_NAMESPACE
}
\endcode
- As the state is saved into a string, it can be written to any kind of file.
-
\sa SplitHandle, {Customizing SplitView}, {Container Controls}
*/
diff --git a/tests/auto/controls/data/tst_dialogbuttonbox.qml b/tests/auto/controls/data/tst_dialogbuttonbox.qml
index 62789a47..6eca8569 100644
--- a/tests/auto/controls/data/tst_dialogbuttonbox.qml
+++ b/tests/auto/controls/data/tst_dialogbuttonbox.qml
@@ -54,8 +54,8 @@ import QtQuick.Controls 2.12
TestCase {
id: testCase
- width: 200
- height: 200
+ width: 600
+ height: 400
visible: true
when: windowShown
name: "DialogButtonBox"
@@ -292,4 +292,136 @@ TestCase {
verify(buttonPosInBox.x >= 0)
verify(buttonPosInBox.x + button.width < control.width)
}
+
+ Component {
+ id: dialogComponent
+ // Based on the Default style, where a single button fills
+ // half the dialog's width and is aligned to the right.
+ Dialog {
+ id: control
+ standardButtons: Dialog.Ok
+ visible: true
+
+ footer: DialogButtonBox {
+ id: box
+ visible: count > 0
+ alignment: count === 1 ? Qt.AlignRight : undefined
+
+ implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
+ (count === 1 ? implicitContentWidth * 2 : implicitContentWidth) + leftPadding + rightPadding)
+ implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
+ implicitContentHeight + topPadding + bottomPadding)
+ contentWidth: contentItem.contentWidth
+
+ delegate: Button {
+ width: box.count === 1 ? box.availableWidth / 2 : undefined
+ }
+ }
+ }
+ }
+
+ // QTBUG-73860
+ function test_oneButtonAlignedRightInImplicitWidthBox() {
+ var dialog = createTemporaryObject(dialogComponent, testCase)
+ verify(dialog)
+
+ var box = dialog.footer
+ var listView = box.contentItem
+ waitForRendering(listView)
+
+ var button = box.itemAt(0)
+ verify(button)
+
+ // The button should never go outside of the box.
+ var buttonPosInBox = button.mapToItem(box, 0, 0)
+ verify(buttonPosInBox.x >= 0, "Expected button to be inside left edge "
+ + "of DialogButtonBox, but it's " + buttonPosInBox.x)
+ verify(buttonPosInBox.x + button.width <= box.width, "Expected button to be inside right edge "
+ + "of DialogButtonBox (" + box.width + "), but it's " + (buttonPosInBox.x + button.width))
+ compare(box.width, dialog.width)
+ // There's a single button and we align it to the right.
+ compare(box.contentItem.width, button.width)
+ compare(box.contentItem.x, box.width - box.rightPadding - box.contentItem.width)
+ }
+
+ Component {
+ id: customButtonBox
+
+ DialogButtonBox {
+ objectName: "customButtonBox"
+ alignment: Qt.AlignRight
+
+ property alias okButton: okButton
+
+ Button {
+ id: okButton
+ text: "OK"
+
+ DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
+ }
+ }
+ }
+
+ // QTBUG-72886
+ function test_oneCustomButtonChangeText() {
+ var control = createTemporaryObject(customButtonBox, testCase, {})
+ verify(control)
+
+ var listView = control.contentItem
+ waitForRendering(listView)
+
+ var button = control.okButton
+ verify(button)
+ button.text = "some longer text";
+
+ // The button should never go outside of the box.
+ tryVerify(function() { return button.mapToItem(control, 0, 0).x >= 0 },
+ 1000, "Expected left edge of button to be within left edge of DialogButtonBox (i.e. greater than or equal to 0)" +
+ ", but it's " + button.mapToItem(control, 0, 0).x)
+ tryVerify(function() { return button.mapToItem(control, 0, 0).x + button.width <= control.width },
+ 1000, "Expected right edge of button to be within right edge of DialogButtonBox (i.e. less than or equal to " +
+ control.width + "), but it's " + (button.mapToItem(control, 0, 0).x + button.width))
+ }
+
+ Component {
+ id: customButtonBoxTwoButtons
+
+ DialogButtonBox {
+ objectName: "customButtonBoxTwoButtons"
+ alignment: Qt.AlignRight
+
+ property alias okButton: okButton
+
+ Button {
+ id: okButton
+ text: "OK"
+
+ DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
+ }
+ Button {
+ text: "Cancel"
+
+ DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
+ }
+ }
+ }
+
+ // QTBUG-72886
+ function test_twoCustomButtonsChangeText() {
+ var control = createTemporaryObject(customButtonBoxTwoButtons, testCase, {})
+ verify(control)
+
+ var listView = control.contentItem
+ waitForRendering(listView)
+
+ var button = control.okButton
+ button.text = "some longer text";
+ // The button should never go outside of the box.
+ tryVerify(function() { return button.mapToItem(control, 0, 0).x >= 0 },
+ 1000, "Expected left edge of button to be within left edge of DialogButtonBox (i.e. greater than or equal to 0)" +
+ ", but it's " + button.mapToItem(control, 0, 0).x)
+ tryVerify(function() { return button.mapToItem(control, 0, 0).x + button.width <= control.width },
+ 1000, "Expected right edge of button to be within right edge of DialogButtonBox (i.e. less than or equal to " +
+ control.width + "), but it's " + (button.mapToItem(control, 0, 0).x + button.width))
+ }
}
diff --git a/tests/auto/sanity/tst_sanity.cpp b/tests/auto/sanity/tst_sanity.cpp
index 69553d93..d2d962bc 100644
--- a/tests/auto/sanity/tst_sanity.cpp
+++ b/tests/auto/sanity/tst_sanity.cpp
@@ -137,6 +137,12 @@ protected:
m_errors += QString("%1:%2 : %3").arg(m_fileName).arg(node->firstSourceLocation().startLine).arg(error);
}
+ void throwRecursionDepthError()
+ {
+ m_errors += QString::fromLatin1("%1: Maximum statement or expression depth exceeded")
+ .arg(m_fileName);
+ }
+
private:
QString m_fileName;
QStringList m_errors;