aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dist/changes-5.8.0208
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-button-focused.pngbin1482 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-button-normal.pngbin1257 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-button-pressed.pngbin1196 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-switch-disabled.pngbin2633 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-switch-focused.pngbin2532 -> 0 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-switch-normal.pngbin2249 -> 0 bytes
-rw-r--r--src/imports/controls/material/DialogButtonBox.qml1
-rw-r--r--src/imports/controls/universal/DialogButtonBox.qml1
-rw-r--r--src/quicktemplates2/qquickstackview.cpp11
-rw-r--r--tests/auto/controls/data/tst_combobox.qml6
-rw-r--r--tests/auto/controls/data/tst_stackview.qml34
12 files changed, 254 insertions, 7 deletions
diff --git a/dist/changes-5.8.0 b/dist/changes-5.8.0
new file mode 100644
index 00000000..5b431fca
--- /dev/null
+++ b/dist/changes-5.8.0
@@ -0,0 +1,208 @@
+Qt 5.8 introduces many new features and improvements as well as bugfixes
+over the 5.7.x series. For more details, refer to the online documentation
+included in this distribution. The documentation is also available online:
+
+ http://doc.qt.io/qt-5/index.html
+
+The Qt version 5.8 series is binary compatible with the 5.7.x series.
+Applications compiled for 5.7 will continue to run with 5.8.
+
+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.
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+ - Control:
+ * Control::hoverEnabled has been made to inherit to children, to make it
+ possible to disable hover effects for a tree of controls in one place.
+
+ - Tumbler:
+ * Changed the default value of visibleItemCount to 5 to make it visually
+ clearer that it's a Tumbler.
+ * [QTBUG-53587] Changed the default value of wrap to be false when count
+ is less than visibleItemCount. Explicitly setting wrap overrides this
+ behavior.
+
+****************************************************************************
+* Controls *
+****************************************************************************
+
+ - AbstractButton:
+ * A plain AbstractButton now calculates its implicit size based on the
+ implicit size of the content item plus paddings, and the implicit size
+ of the background item.
+ * [QTBUG-51554] The checkable property has been made accessible from
+ QML. Previously it was only exposed for Button and MenuItem, but it is
+ now available for any AbstractButton to make it possible to create
+ custom QML-based checkable buttons.
+ * [QTBUG-57085] Fixed auto-repeat to not cancel on the tiniest mouse/touch
+ move, but keep repeating until moved outside the button.
+ * Fixed press-and-hold for checkable buttons to not toggle the checked
+ state on release after press-and-hold.
+
+ - ButtonGroup:
+ * Added clicked(AbstractButton) signal for centralized click handling for
+ grouped buttons.
+
+ - ComboBox:
+ * [QTBUG-56884] Added handling for Home and End keys.
+ * [QTBUG-56884] Added missing keyboard search functionality.
+ * [QTBUG-54935] Added a flat property that provides more suitable looks
+ for using ComboBox in a ToolBar.
+
+ - Container:
+ * Added incrementCurrentIndex() and decrementCurrentIndex() methods for
+ changing the current index without losing its property binding.
+ * A plain Container now calculates its implicit size based on the
+ implicit size of the content item plus paddings, and the implicit size
+ of the background item.
+
+ - Control:
+ * A plain Control now calculates its implicit size based on the implicit
+ size of the content item plus paddings, and the implicit size of the
+ background item.
+
+ - Dialog:
+ * Added a new Dialog type to provide convenience for handling dialog
+ popups. Dialog integrates with DialogButtonBox, and provides convenient
+ accepted() and rejected() signals.
+
+ - DialogButtonBox:
+ * Added DialogButtonBox to provide convenience for handling dialog buttons.
+ DialogButtonBox is able to create a set of standard buttons with a single
+ line of QML code, and provides convenient accepted() and rejected() signals.
+
+ - Drawer:
+ * [QTBUG-55360] Made it possible to control the vertical position of a
+ horizontal drawer, and vice versa. This allows placing a drawer below
+ a header/toolbar, for instance.
+
+ - MenuSeparator:
+ * [QTBUG-54862] Added MenuSeparator to visually distinguish between groups
+ of items in a menu.
+
+ - Page:
+ * [QTBUG-56709] Page has been made to calculate its implicit size based
+ on the implicit size of the header, content, and footer plus paddings,
+ and the implicit size of the background item.
+
+ - Popup:
+ * [QTBUG-56025] Fixed to respect explicitly set width and height.
+ * [QTBUG-56562] The QML Shortcut type from QtQuick has been fixed to
+ respect modal popups from QtQuick Controls 2.
+ * [QTBUG-56755] Fixed binding loops with size-dependent positioning.
+
+ - RangeSlider:
+ * [QTBUG-50003] Added first.hovered and second.hovered properties that
+ hold whether the respective handles are hovered.
+
+ - RoundButton:
+ * [QTBUG-54967] Added RoundButton.
+
+ - Slider:
+ * [QTBUG-53847] Added valueAt() method for converting any position to a
+ value in the slider's range. It is also possible to use valueAt() to get
+ continuous value updates.
+
+ - SpinBox:
+ * [QTBUG-50003] Added up.hovered and down.hovered properties that hold
+ whether the respective buttons are hovered.
+ * [QTBUG-57085] Fixed auto-repeat to not cancel on the tiniest mouse/touch
+ move, but keep repeating until moved outside the button.
+
+ - StackView:
+ * Added attached StackView.activated(), StackView.deactivated(),
+ StackView.activating(), and StackView.deactivating() signals that are
+ convenient for initializing and cleaning up item-specific resources.
+ * [QTBUG-55405] Added StackView.removed() attached signal to provide a
+ way to delete items that StackView won't.
+ * Made it possible to choose the visual transition type for any operation.
+ This allows using for example push and pop transitions with replace(),
+ which allows implementing an "infinite" back and forward navigation
+ pattern while keeping the amount of instantiated items constant.
+
+ - SwipeDelegate:
+ * [QTBUG-54651] Added swipe.close() for setting swipe.position to 0.
+ * [QTBUG-54651] Added swipe.completed() for responding to completion of
+ swipes.
+ * [QTBUG-54651] Added attached SwipeDelegate.pressed property and
+ SwipeDelegate.clicked() signal for detecting when non-interactive
+ left/right/behind items are pressed and clicked.
+ * [QTBUG-56312][QTBUG-57285] Fixed spurious clicked() signal emission when
+ released outside the delegate.
+ * [QTBUG-57271] Fixed swipes that begin over a child item of a delegate.
+
+ - SwipeView:
+ * Added SwipeView.isNextItem and SwipeView.isPreviousItem attached
+ properties to make it straight-forward to use Loader for unloading
+ pages that are outside the reach.
+ * [QTBUG-54268] Added interactive property for controlling whether swipe
+ interaction is enabled.
+
+ - TextArea:
+ * [QTBUG-51009] Added pressed() and released() signals.
+
+ - TextField:
+ * [QTBUG-51009] Added pressed() and released() signals.
+ * Aligned the name of the pressAndHold() argument with TextArea
+
+ - ToolSeparator:
+ * [QTBUG-54862] Added ToolSeparator to visually distinguish between groups
+ of items in a toolbar by separating them with a line. It can be used in
+ horizontal or vertical toolbars.
+
+ - Tumbler:
+ * [QTBUG-53587] Added wrap property to control whether or not tumbler
+ wraps when it reaches the top and bottom.
+
+****************************************************************************
+* Styles *
+****************************************************************************
+
+ - Added support for specifying the fallback style for custom styles via
+ :/qtquickcontrols2.conf, QT_QUICK_CONTROLS_FALLBACK_STYLE or
+ QQuickStyle::setFallbackStyle().
+
+Material
+--------
+
+ - [QTBUG-50003] Implemented ripple and hover effects.
+ - Fixed (optional) elevation effects for Frame, GroupBox, Pane, and
+ TabBar.
+ - Added Material.System theme enum value, that can be used to let the
+ Material style choose either the light or dark theme based on the
+ system theme colors.
+
+Universal
+---------
+
+ - [QTBUG-50003] Implemented hover effects
+ - Added Universal.System theme enum value, that can be used to let the
+ Universal style choose either the light or dark theme based on the
+ system theme colors.
+
+****************************************************************************
+* Platform *
+****************************************************************************
+
+ - Introduced a new experimental Qt Labs Platform module that provides the
+ following native (Qt Widgets fallback when not available) QML types:
+ * ColorDialog
+ * FileDialog
+ * FolderDialog
+ * FontDialog
+ * Menu
+ * MenuBar
+ * MenuItem
+ * MenuItemGroup
+ * MenuSeparator
+ * MessageDialog
+ * StandardPaths
+ * SystemTrayIcon
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-button-focused.png b/src/imports/controls/doc/images/qtquickcontrols2-button-focused.png
deleted file mode 100644
index a487bd27..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-button-focused.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-button-normal.png b/src/imports/controls/doc/images/qtquickcontrols2-button-normal.png
deleted file mode 100644
index 7e7e281b..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-button-normal.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-button-pressed.png b/src/imports/controls/doc/images/qtquickcontrols2-button-pressed.png
deleted file mode 100644
index 2dff7764..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-button-pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-switch-disabled.png b/src/imports/controls/doc/images/qtquickcontrols2-switch-disabled.png
deleted file mode 100644
index 060d2b2a..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-switch-disabled.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-switch-focused.png b/src/imports/controls/doc/images/qtquickcontrols2-switch-focused.png
deleted file mode 100644
index 2384f76a..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-switch-focused.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-switch-normal.png b/src/imports/controls/doc/images/qtquickcontrols2-switch-normal.png
deleted file mode 100644
index 5f84f62a..00000000
--- a/src/imports/controls/doc/images/qtquickcontrols2-switch-normal.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/controls/material/DialogButtonBox.qml b/src/imports/controls/material/DialogButtonBox.qml
index 34ee0913..82d988cc 100644
--- a/src/imports/controls/material/DialogButtonBox.qml
+++ b/src/imports/controls/material/DialogButtonBox.qml
@@ -36,6 +36,7 @@
import QtQuick 2.9
import QtQuick.Templates 2.2 as T
+import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2
import QtQuick.Controls.Material.impl 2.2
diff --git a/src/imports/controls/universal/DialogButtonBox.qml b/src/imports/controls/universal/DialogButtonBox.qml
index 4c7d3a21..0ab84db8 100644
--- a/src/imports/controls/universal/DialogButtonBox.qml
+++ b/src/imports/controls/universal/DialogButtonBox.qml
@@ -36,6 +36,7 @@
import QtQuick 2.9
import QtQuick.Templates 2.2 as T
+import QtQuick.Controls 2.2
import QtQuick.Controls.Universal 2.2
T.DialogButtonBox {
diff --git a/src/quicktemplates2/qquickstackview.cpp b/src/quicktemplates2/qquickstackview.cpp
index b5bf0af7..0838e762 100644
--- a/src/quicktemplates2/qquickstackview.cpp
+++ b/src/quicktemplates2/qquickstackview.cpp
@@ -466,6 +466,8 @@ QQuickItem *QQuickStackView::find(const QJSValue &callback, LoadBehavior behavio
\value StackView.ReplaceTransition An operation with replace transitions (since QtQuick.Controls 2.1).
\value StackView.PopTransition An operation with pop transitions (since QtQuick.Controls 2.1).
+ \note Items that already exist in the stack are not pushed.
+
\sa initialItem, {Pushing Items}
*/
void QQuickStackView::push(QQmlV4Function *args)
@@ -486,6 +488,15 @@ void QQuickStackView::push(QQmlV4Function *args)
operation = static_cast<Operation>(lastArg->toInt32());
QList<QQuickStackElement *> elements = d->parseElements(args);
+ // Remove any items that are already in the stack, as they can't be in two places at once.
+ for (int i = 0; i < elements.size(); ) {
+ QQuickStackElement *element = elements.at(i);
+ if (element->item && d->findElement(element->item))
+ elements.removeAt(i);
+ else
+ ++i;
+ }
+
if (elements.isEmpty()) {
qmlInfo(this) << "push: nothing to push";
args->setReturnValue(QV4::Encode::null());
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml
index 68fe4c76..1a9040fa 100644
--- a/tests/auto/controls/data/tst_combobox.qml
+++ b/tests/auto/controls/data/tst_combobox.qml
@@ -1036,15 +1036,13 @@ TestCase {
var listview = control.popup.contentItem
verify(listview)
- waitForRendering(listview)
- compare(listview.contentItem.children.length, resetmodel.count + 1) // + highlight item
+ tryCompare(listview.contentItem.children, "length", resetmodel.count + 1) // + highlight item
resetmodel.clear()
resetmodel.append({text: "Fourth"})
resetmodel.append({text: "Fifth"})
- waitForRendering(listview)
- compare(listview.contentItem.children.length, resetmodel.count + 1) // + highlight item
+ tryCompare(listview.contentItem.children, "length", resetmodel.count + 1) // + highlight item
control.destroy()
}
diff --git a/tests/auto/controls/data/tst_stackview.qml b/tests/auto/controls/data/tst_stackview.qml
index b0e18389..44089e57 100644
--- a/tests/auto/controls/data/tst_stackview.qml
+++ b/tests/auto/controls/data/tst_stackview.qml
@@ -223,9 +223,9 @@ TestCase {
compare(control.depth, 0)
control.push(item, StackView.Immediate)
compare(control.depth, 1)
- control.push(item, StackView.Immediate)
- compare(control.depth, 2)
- control.pop(StackView.Immediate)
+ control.clear()
+ compare(control.depth, 0)
+ control.push(component, StackView.Immediate)
compare(control.depth, 1)
control.push(component, StackView.Immediate)
compare(control.depth, 2)
@@ -1020,4 +1020,32 @@ TestCase {
control.destroy()
}
+
+ function test_pushSameItem() {
+ var control = stackView.createObject(testCase)
+ verify(control)
+
+ control.push(item, StackView.Immediate)
+ compare(control.currentItem, item)
+ compare(control.depth, 1)
+
+ // Pushing the same Item should do nothing.
+ ignoreWarning(Qt.resolvedUrl("tst_stackview.qml") + ":59:9: QML StackView: push: nothing to push")
+ control.push(item, StackView.Immediate)
+ compare(control.currentItem, item)
+ compare(control.depth, 1)
+
+ // Push a component so that it becomes current.
+ var current = control.push(component, StackView.Immediate)
+ compare(control.currentItem, current)
+ compare(control.depth, 2)
+
+ // Push a bunch of stuff. "item" is already in the stack, so it should be ignored.
+ current = control.push(component, item, StackView.Immediate)
+ verify(current !== item)
+ compare(control.currentItem, current)
+ compare(control.depth, 3)
+
+ control.destroy()
+ }
}