Merge remote-tracking branch 'origin/5.15' into dev

Change-Id: I4b20284eb05b6277c758a1ab5579b803db9a84ca
This commit is contained in:
Qt Forward Merge Bot 2020-02-08 03:04:16 +01:00
commit 271fd0924e
157 changed files with 12643 additions and 68 deletions

51
dist/changes-5.14.0 vendored Normal file
View File

@ -0,0 +1,51 @@
Qt 5.14 introduces many new features and improvements as well as bugfixes
over the 5.13.x series. 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.14 series is binary compatible with the 5.13.x series.
Applications compiled for 5.13 will continue to run with 5.14.
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 *
****************************************************************************
- ComboBox:
* Added valueRole, currentValue and indexOfValue(). These allow
convenient management of data for a role associated with the text
role.
- QQuickMenuBar:
* Fixed issue with dynamically menu bar items not losing their highlight
when their menu was dismissed.
- QQuickPopup:
* Fixed the issue that Popup doesn't respond to CloseOnEscape if the
initial value of visible is true
- [QTBUG-79790] Fixed issue where font changes would result in an extra
signal being emitted.
- [QTBUG-59330] The documentation now advises against naming root resource
directories with the same name as a style name.
- [QTBUG-79302] SplitView: fix issue where Repeater items were not created.
- [QTBUG-79302] SplitView: fix cursor shape staying as Split*Cursor in some
cases.
- [QTBUG-79270] Fixed assertion failure when hiding a SplitView with only
one item.
****************************************************************************
* Universal *
****************************************************************************
- TabBar:
* Disabled wrapping. The Universal style TabBar now behaves like TabBar
from other styles.

View File

@ -62,6 +62,15 @@ ApplicationWindow {
visible: true
title: "Qt Quick Controls 2"
function help()
{
var url = "https://doc.qt.io/qt-5/"
+ (stackView.depth > 1
? "qml-qtquick-controls2-" + stackView.currentItem.control + ".html"
: "qtquick-controls2-qmlmodule.html");
Qt.openUrlExternally(url)
}
Settings {
id: settings
property string style: "Default"
@ -73,6 +82,11 @@ ApplicationWindow {
onActivated: navigateBackAction.trigger()
}
Shortcut {
sequence: StandardKey.HelpContents
onActivated: help()
}
Action {
id: navigateBackAction
icon.name: stackView.depth > 1 ? "back" : "drawer"
@ -130,6 +144,10 @@ ApplicationWindow {
text: "Settings"
onTriggered: settingsDialog.open()
}
Action {
text: "Help"
onTriggered: help()
}
Action {
text: "About"
onTriggered: aboutDialog.open()

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "busyindicator"
Column {
spacing: 40
width: parent.width

View File

@ -55,6 +55,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "button"
Column {
spacing: 40
width: parent.width

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "checkbox"
Column {
spacing: 40
width: parent.width

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "combobox"
Column {
spacing: 40
width: parent.width

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
property string control : "delaybutton"
Column {
spacing: 40
width: parent.width

View File

@ -55,6 +55,8 @@ import QtQuick.Controls 2.12
Pane {
padding: 0
property string control : "swipedelegate"
property var delegateComponentMap: {
"ItemDelegate": itemDelegateComponent,
"SwipeDelegate": swipeDelegateComponent,

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "dial"
Column {
spacing: 40
width: parent.width

View File

@ -55,6 +55,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "dialog"
readonly property int buttonWidth: Math.max(button.implicitWidth, Math.min(button.implicitWidth * 2, page.availableWidth / 3))
Column {

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "frame"
readonly property int itemWidth: Math.max(button.implicitWidth, Math.min(button.implicitWidth * 3, page.availableWidth / 3 * 2))
Column {

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "groupbox"
readonly property int itemWidth: Math.max(button.implicitWidth, Math.min(button.implicitWidth * 3, page.availableWidth / 3 * 2))
Column {

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "pageindicator"
Column {
spacing: 40
width: parent.width

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "progressbar"
Column {
spacing: 40
width: parent.width

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "radiobutton"
Column {
spacing: 40
width: parent.width

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "rangeslider"
Column {
spacing: 40
width: parent.width

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
Flickable {
id: flickable
readonly property string control : "scrollbar"
contentHeight: pane.height
Pane {

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
Flickable {
id: flickable
readonly property string control : "scrollindicator"
contentHeight: pane.height
Pane {

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
Page {
id: page
readonly property string control : "flickable"
default property alias content: pane.contentItem
Flickable {

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "slider"
Column {
spacing: 40
width: parent.width

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : ""
Column {
spacing: 40
width: parent.width

View File

@ -55,6 +55,8 @@ StackView {
id: stackView
initialItem: page
readonly property string control : "stackview"
Component {
id: page

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
Pane {
id: pane
readonly property string control : "swipeview"
SwipeView {
id: view
currentIndex: 1

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "switch"
Column {
spacing: 40
width: parent.width

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
Page {
id: page
readonly property string control : "tabbar"
SwipeView {
id: swipeView
anchors.fill: parent

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "textarea"
Column {
spacing: 40
width: parent.width

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "textfield"
Column {
spacing: 40
width: parent.width

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "tooltip"
Column {
spacing: 40
width: parent.width

View File

@ -54,6 +54,8 @@ import QtQuick.Controls 2.12
ScrollablePage {
id: page
readonly property string control : "tumbler"
Column {
spacing: 40
width: parent.width

View File

@ -170,7 +170,6 @@ private:
int m_selectionEnd;
QFont m_font;
int m_fontSize;
QUrl m_fileUrl;
};

View File

@ -46,7 +46,7 @@ class QQuickWeekNumberModelPrivate : public QAbstractItemModelPrivate
Q_DECLARE_PUBLIC(QQuickWeekNumberModel)
public:
QQuickWeekNumberModelPrivate() : month(-1), year(-1)
QQuickWeekNumberModelPrivate() : month(-1), year(-1), weekNumbers{}
{
QDate date = QDate::currentDate();
init(date.month(), date.year(), locale);

View File

@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC_WITH_ARGS(QString, GlobalPath, (QLatin1String("qrc:/qt-project.org/imports/QtQuick/Controls.2/Imagine/images/")))
static const QString ensureSlash(const QString &path)
static QString ensureSlash(const QString &path)
{
const QChar slash = QLatin1Char('/');
return path.endsWith(slash) ? path : path + slash;

View File

@ -0,0 +1,40 @@
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Copyright (C) 2019 The Qt Company Ltd.
:: Contact: https://www.qt.io/licensing/
::
:: This file is part of the QtQuick module of the Qt Toolkit.
::
:: $QT_BEGIN_LICENSE:LGPL$
:: Commercial License Usage
:: Licensees holding valid commercial Qt licenses may use this file in
:: accordance with the commercial license agreement provided with the
:: Software or, alternatively, in accordance with the terms contained in
:: a written agreement between you and The Qt Company. For licensing terms
:: and conditions see https://www.qt.io/terms-conditions. For further
:: information use the contact form at https://www.qt.io/contact-us.
::
:: GNU Lesser General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU Lesser
:: General Public License version 3 as published by the Free Software
:: Foundation and appearing in the file LICENSE.LGPL3 included in the
:: packaging of this file. Please review the following information to
:: ensure the GNU Lesser General Public License version 3 requirements
:: will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
::
:: GNU General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU
:: General Public License version 2.0 or (at your option) the GNU General
:: Public license version 3 or any later version approved by the KDE Free
:: Qt Foundation. The licenses are as published by the Free Software
:: Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
:: included in the packaging of this file. Please review the following
:: information to ensure the GNU General Public License requirements will
:: be met: https://www.gnu.org/licenses/gpl-2.0.html and
:: https://www.gnu.org/licenses/gpl-3.0.html.
::
:: $QT_END_LICENSE$
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/RectangularGlow.frag RectangularGlow_rhi.frag

View File

@ -119,10 +119,15 @@ static QStringList defaultImportPathList()
{
QStringList importPaths;
importPaths.reserve(3);
#ifndef QT_STATIC
#ifdef Q_OS_ANDROID
// androiddeployqt puts the QML files inside a resource file and they are not
// showing up in the Qml2ImportsPath as a result
importPaths += QStringLiteral(":/android_rcc_bundle/qml");
#else
# ifndef QT_STATIC
importPaths += QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
# endif
#endif
importPaths += envPathList("QML2_IMPORT_PATH");
importPaths += QStringLiteral(":/qt-project.org/imports");
importPaths += QCoreApplication::applicationDirPath();
return importPaths;

View File

@ -1128,7 +1128,7 @@ void QQuickAbstractButton::buttonChange(ButtonChange change)
break;
case ButtonTextChange: {
const QString txt = text();
setAccessibleName(txt);
maybeSetAccessibleName(txt);
#if QT_CONFIG(shortcut)
setShortcut(QKeySequence::mnemonic(txt));
#endif
@ -1154,7 +1154,7 @@ void QQuickAbstractButton::accessibilityActiveChanged(bool active)
Q_D(QQuickAbstractButton);
if (active) {
setAccessibleName(text());
maybeSetAccessibleName(text());
setAccessibleProperty("pressed", d->pressed);
setAccessibleProperty("checked", d->checked);
setAccessibleProperty("checkable", d->checkable);

View File

@ -448,7 +448,7 @@ void QQuickComboBoxPrivate::updateCurrentText()
if (currentText != text) {
currentText = text;
if (!hasDisplayText)
q->setAccessibleName(text);
q->maybeSetAccessibleName(text);
emit q->currentTextChanged();
}
if (!hasDisplayText && displayText != text) {
@ -1012,7 +1012,7 @@ void QQuickComboBox::setDisplayText(const QString &text)
return;
d->displayText = text;
setAccessibleName(text);
maybeSetAccessibleName(text);
emit displayTextChanged();
}
@ -1705,6 +1705,12 @@ bool QQuickComboBox::eventFilter(QObject *object, QEvent *event)
// the user clicked on the popup button to open it, not close it).
d->hidePopup(false);
setPressed(false);
// The focus left the text field, so if the edit text matches an item in the model,
// change our currentIndex to that. This matches widgets' behavior.
const int indexForEditText = find(d->extra.value().editText, Qt::MatchFixedString);
if (indexForEditText > -1)
setCurrentIndex(indexForEditText);
}
break;
#if QT_CONFIG(im)
@ -1945,7 +1951,7 @@ void QQuickComboBox::accessibilityActiveChanged(bool active)
QQuickControl::accessibilityActiveChanged(active);
if (active) {
setAccessibleName(d->hasDisplayText ? d->displayText : d->currentText);
maybeSetAccessibleName(d->hasDisplayText ? d->displayText : d->currentText);
setAccessibleProperty("editable", isEditable());
}
}

View File

@ -2300,11 +2300,13 @@ QString QQuickControl::accessibleName() const
return QString();
}
void QQuickControl::setAccessibleName(const QString &name)
void QQuickControl::maybeSetAccessibleName(const QString &name)
{
#if QT_CONFIG(accessibility)
if (QQuickAccessibleAttached *accessibleAttached = QQuickControlPrivate::accessibleAttached(this))
accessibleAttached->setName(name);
if (QQuickAccessibleAttached *accessibleAttached = QQuickControlPrivate::accessibleAttached(this)) {
if (!accessibleAttached->wasNameExplicitlySet())
accessibleAttached->setNameImplicitly(name);
}
#else
Q_UNUSED(name)
#endif

View File

@ -287,7 +287,7 @@ protected:
// helper functions which avoid to check QT_CONFIG(accessibility)
QString accessibleName() const;
void setAccessibleName(const QString &name);
void maybeSetAccessibleName(const QString &name);
QVariant accessibleProperty(const char *propertyName);
bool setAccessibleProperty(const char *propertyName, const QVariant &value);

View File

@ -219,7 +219,6 @@ void QQuickDialog::setTitle(const QString &title)
{
Q_D(QQuickDialog);
d->popupItem->setTitle(title);
setAccessibleName(title);
}
/*!
@ -536,7 +535,7 @@ void QQuickDialog::accessibilityActiveChanged(bool active)
QQuickPopup::accessibilityActiveChanged(active);
if (active)
setAccessibleName(d->popupItem->title());
maybeSetAccessibleName(d->popupItem->title());
}
#endif

View File

@ -167,7 +167,7 @@ void QQuickGroupBox::setTitle(const QString &title)
return;
d->title = title;
setAccessibleName(title);
maybeSetAccessibleName(title);
emit titleChanged();
}
@ -283,7 +283,7 @@ void QQuickGroupBox::accessibilityActiveChanged(bool active)
QQuickFrame::accessibilityActiveChanged(active);
if (active)
setAccessibleName(d->title);
maybeSetAccessibleName(d->title);
}
#endif

View File

@ -248,9 +248,7 @@ void QQuickLabelPrivate::updatePalette(const QPalette &palette)
void QQuickLabelPrivate::textChanged(const QString &text)
{
#if QT_CONFIG(accessibility)
Q_Q(QQuickLabel);
if (QQuickAccessibleAttached *accessibleAttached = QQuickControlPrivate::accessibleAttached(q))
accessibleAttached->setName(text);
maybeSetAccessibleName(text);
#else
Q_UNUSED(text)
#endif
@ -266,13 +264,24 @@ void QQuickLabelPrivate::accessibilityActiveChanged(bool active)
QQuickAccessibleAttached *accessibleAttached = qobject_cast<QQuickAccessibleAttached *>(qmlAttachedPropertiesObject<QQuickAccessibleAttached>(q, true));
Q_ASSERT(accessibleAttached);
accessibleAttached->setRole(accessibleRole());
accessibleAttached->setName(text);
maybeSetAccessibleName(text);
}
QAccessible::Role QQuickLabelPrivate::accessibleRole() const
{
return QAccessible::StaticText;
}
void QQuickLabelPrivate::maybeSetAccessibleName(const QString &name)
{
Q_Q(QQuickLabel);
auto accessibleAttached = qobject_cast<QQuickAccessibleAttached *>(
qmlAttachedPropertiesObject<QQuickAccessibleAttached>(q, true));
if (accessibleAttached) {
if (!accessibleAttached->wasNameExplicitlySet())
accessibleAttached->setNameImplicitly(name);
}
}
#endif
static inline QString backgroundName() { return QStringLiteral("background"); }

View File

@ -111,6 +111,7 @@ public:
#if QT_CONFIG(accessibility)
void accessibilityActiveChanged(bool active) override;
QAccessible::Role accessibleRole() const override;
void maybeSetAccessibleName(const QString &name);
#endif
void cancelBackground();

View File

@ -285,7 +285,7 @@ void QQuickPage::setTitle(const QString &title)
return;
d->title = title;
setAccessibleName(title);
maybeSetAccessibleName(title);
emit titleChanged();
}
@ -473,7 +473,7 @@ void QQuickPage::accessibilityActiveChanged(bool active)
QQuickPane::accessibilityActiveChanged(active);
if (active)
setAccessibleName(d->title);
maybeSetAccessibleName(d->title);
}
#endif

View File

@ -2699,10 +2699,10 @@ QString QQuickPopup::accessibleName() const
return d->popupItem->accessibleName();
}
void QQuickPopup::setAccessibleName(const QString &name)
void QQuickPopup::maybeSetAccessibleName(const QString &name)
{
Q_D(QQuickPopup);
d->popupItem->setAccessibleName(name);
d->popupItem->maybeSetAccessibleName(name);
}
QVariant QQuickPopup::accessibleProperty(const char *propertyName)

View File

@ -459,7 +459,7 @@ protected:
#endif
QString accessibleName() const;
void setAccessibleName(const QString &name);
void maybeSetAccessibleName(const QString &name);
QVariant accessibleProperty(const char *propertyName);
bool setAccessibleProperty(const char *propertyName, const QVariant &value);

View File

@ -47,6 +47,10 @@
#endif
#include <QtGui/private/qguiapplication_p.h>
#if QT_CONFIG(accessibility)
#include <QtQuick/private/qquickaccessibleattached_p.h>
#endif
QT_BEGIN_NAMESPACE
class QQuickPopupItemPrivate : public QQuickPagePrivate
@ -403,7 +407,28 @@ QAccessible::Role QQuickPopupItem::accessibleRole() const
void QQuickPopupItem::accessibilityActiveChanged(bool active)
{
Q_D(const QQuickPopupItem);
// Can't just use d->popup->accessibleName() here, because that refers to the accessible
// name of us, the popup item, which is not what we want.
const QQuickAccessibleAttached *popupAccessibleAttached = QQuickControlPrivate::accessibleAttached(d->popup);
const QString oldPopupName = popupAccessibleAttached ? popupAccessibleAttached->name() : QString();
const bool wasNameExplicitlySetOnPopup = popupAccessibleAttached && popupAccessibleAttached->wasNameExplicitlySet();
QQuickPage::accessibilityActiveChanged(active);
QQuickAccessibleAttached *accessibleAttached = QQuickControlPrivate::accessibleAttached(this);
const QString ourName = accessibleAttached ? accessibleAttached->name() : QString();
if (wasNameExplicitlySetOnPopup && accessibleAttached && ourName != oldPopupName) {
// The user set Accessible.name on the Popup. Since the Popup and its popup item
// have different accessible attached properties, the popup item doesn't know that
// a name was set on the Popup by the user, and that it should use that, rather than
// whatever QQuickPage sets. That's why we need to do it here.
// To avoid it being overridden by the call to accessibilityActiveChanged() below,
// we set it explicitly. It's safe to do this as the popup item is an internal implementation detail.
accessibleAttached->setName(oldPopupName);
}
// This allows the different popup types to set a name on their popup item accordingly.
// For example: Dialog uses its title and ToolTip uses its text.
d->popup->accessibilityActiveChanged(active);
}
#endif

View File

@ -80,6 +80,9 @@ QT_BEGIN_NAMESPACE
\li \l{SplitHandle::pressed}{SplitHandle.pressed}
\endlist
\note Handles should be purely visual and not handle events, as it can
interfere with their hovered and pressed states.
The preferred size of items in a SplitView can be specified via
\l{Item::}{implicitWidth} and \l{Item::}{implicitHeight} or
\c SplitView.preferredWidth and \c SplitView.preferredHeight:
@ -1091,6 +1094,7 @@ QQuickSplitView::QQuickSplitView(QQuickItem *parent)
d->changeTypes |= QQuickItemPrivate::Visibility;
setAcceptedMouseButtons(Qt::LeftButton);
setFiltersChildMouseEvents(true);
}
QQuickSplitView::QQuickSplitView(QQuickSplitViewPrivate &dd, QQuickItem *parent)
@ -1100,6 +1104,7 @@ QQuickSplitView::QQuickSplitView(QQuickSplitViewPrivate &dd, QQuickItem *parent)
d->changeTypes |= QQuickItemPrivate::Visibility;
setAcceptedMouseButtons(Qt::LeftButton);
setFiltersChildMouseEvents(true);
}
QQuickSplitView::~QQuickSplitView()
@ -1364,6 +1369,20 @@ void QQuickSplitView::hoverMoveEvent(QHoverEvent *event)
d->updateHoveredHandle(hoveredItem);
}
bool QQuickSplitView::childMouseEventFilter(QQuickItem *item, QEvent *event)
{
Q_D(QQuickSplitView);
qCDebug(qlcQQuickSplitViewMouse) << "childMouseEventFilter called with" << item << event;
if (event->type() != QEvent::HoverEnter)
return false;
// If a child item received a hover enter event, then it means our handle is no longer hovered.
// Handles should be purely visual and not accept hover events,
// so we should never get hover events for them here.
d->updateHoveredHandle(nullptr);
return false;
}
void QQuickSplitView::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
{
Q_D(QQuickSplitView);

View File

@ -99,6 +99,7 @@ protected:
void componentComplete() override;
void hoverMoveEvent(QHoverEvent *event) override;
bool childMouseEventFilter(QQuickItem *item, QEvent *event) override;
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
void itemAdded(int index, QQuickItem *item) override;

View File

@ -651,6 +651,13 @@ void QQuickStackView::push(QQmlV4Function *args)
void QQuickStackView::pop(QQmlV4Function *args)
{
Q_D(QQuickStackView);
if (d->removingElements) {
d->warn(QStringLiteral("cannot pop while already in the process of removing elements"));
args->setReturnValue(QV4::Encode::null());
return;
}
QScopedValueRollback<bool> removingElements(d->removingElements, true);
QScopedValueRollback<QString> rollback(d->operation, QStringLiteral("pop"));
int argc = args->length();
if (d->elements.count() <= 1 || argc > 2) {
@ -806,6 +813,13 @@ void QQuickStackView::pop(QQmlV4Function *args)
void QQuickStackView::replace(QQmlV4Function *args)
{
Q_D(QQuickStackView);
if (d->removingElements) {
d->warn(QStringLiteral("cannot replace while already in the process of removing elements"));
args->setReturnValue(QV4::Encode::null());
return;
}
QScopedValueRollback<bool> removingElements(d->removingElements, true);
QScopedValueRollback<QString> rollback(d->operation, QStringLiteral("replace"));
if (args->length() <= 0) {
d->warn(QStringLiteral("missing arguments"));
@ -902,6 +916,12 @@ void QQuickStackView::clear(Operation operation)
if (d->elements.isEmpty())
return;
if (d->removingElements) {
d->warn(QStringLiteral("cannot clear while already in the process of removing elements"));
return;
}
QScopedValueRollback<bool> removingElements(d->removingElements, true);
if (operation != Immediate) {
QQuickStackElement *exit = d->elements.pop();
exit->removal = true;

View File

@ -267,7 +267,11 @@ void QQuickStackViewPrivate::viewItemTransitionFinished(QQuickItemViewTransition
element->setStatus(QQuickStackView::Active);
} else if (element->status == QQuickStackView::Deactivating) {
element->setStatus(QQuickStackView::Inactive);
element->setVisible(false);
QQuickStackElement *existingElement = element->item ? findElement(element->item) : nullptr;
// If a different element with the same item is found,
// do not call setVisible(false) since it needs to be visible.
if (!existingElement || element == existingElement)
element->setVisible(false);
if (element->removal || element->isPendingRemoval())
removed += element;
}
@ -275,11 +279,21 @@ void QQuickStackViewPrivate::viewItemTransitionFinished(QQuickItemViewTransition
if (transitioner && transitioner->runningJobs.isEmpty()) {
// ~QQuickStackElement() emits QQuickStackViewAttached::removed(), which may be used
// to modify the stack. Set the status first and make a copy of the destroyable stack
// elements to exclude any modifications that may happen during the loop. (QTBUG-62153)
// elements to exclude any modifications that may happen during qDeleteAll(). (QTBUG-62153)
setBusy(false);
QList<QQuickStackElement*> elements = removed;
QList<QQuickStackElement*> removedElements = removed;
removed.clear();
qDeleteAll(elements);
for (QQuickStackElement *removedElement : qAsConst(removedElements)) {
// If an element with the same item is found in the active stack list,
// forget about the item so that we don't hide it.
if (removedElement->item && findElement(removedElement->item)) {
QQuickItemPrivate::get(removedElement->item)->removeItemChangeListener(removedElement, QQuickItemPrivate::Destroyed);
removedElement->item = nullptr;
}
}
qDeleteAll(removedElements);
}
removing.remove(element);

View File

@ -94,6 +94,7 @@ public:
void depthChange(int newDepth, int oldDepth);
bool busy = false;
bool removingElements = false;
QString operation;
QJSValue initialItem;
QQuickItem *currentItem = nullptr;

View File

@ -188,7 +188,7 @@ void QQuickToolTip::setText(const QString &text)
return;
d->text = text;
setAccessibleName(text);
maybeSetAccessibleName(text);
emit textChanged();
}
@ -351,7 +351,7 @@ void QQuickToolTip::accessibilityActiveChanged(bool active)
QQuickPopup::accessibilityActiveChanged(active);
if (active)
setAccessibleName(d->text);
maybeSetAccessibleName(d->text);
}
#endif

View File

@ -0,0 +1,2 @@
[a11y:Label]
opensuse-leap

Some files were not shown because too many files have changed in this diff Show More