aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/imports/layouts/qquicklayout.cpp12
-rw-r--r--src/imports/settings/qqmlsettings.cpp22
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc2
-rw-r--r--src/qml/jsruntime/qv4promiseobject_p.h11
-rw-r--r--src/qml/qml/qqmlcomponent.cpp18
-rw-r--r--src/quick/accessible/qaccessiblequickitem.cpp10
-rw-r--r--src/quick/items/qquickevents_p_p.h2
-rw-r--r--src/quick/items/qquickflickable_p.h9
-rw-r--r--src/quick/items/qquicktext_p.h6
-rw-r--r--src/quick/items/qquickwindow.cpp8
-rw-r--r--src/quick/scenegraph/qsgbasicinternalimagenode.cpp3
-rw-r--r--src/quick/util/qquickstategroup.cpp5
12 files changed, 85 insertions, 23 deletions
diff --git a/src/imports/layouts/qquicklayout.cpp b/src/imports/layouts/qquicklayout.cpp
index cc206bcb95..d90eae5f80 100644
--- a/src/imports/layouts/qquicklayout.cpp
+++ b/src/imports/layouts/qquicklayout.cpp
@@ -74,10 +74,14 @@
false, the item's size will be fixed to its preferred size. Otherwise, it will grow or shrink
between its minimum and maximum size as the layout is resized.
- \note It is not recommended to have bindings to the x, y, width, or height properties of items
- in a layout, since this would conflict with the goals of Layout, and can also cause binding
- loops.
-
+ \note Do not bind to the x, y, width, or height properties of items in a layout,
+ as this would conflict with the goals of Layout, and can also cause binding loops.
+ The width and height properties are used by the layout engine to store the current
+ size of items as calculated from the minimum/preferred/maximum attached properties,
+ and can be ovewritten each time the items are laid out. Use
+ \l {Layout::preferredWidth}{Layout.preferredWidth} and
+ \l {Layout::preferredHeight}{Layout.preferredHeight}, or \l {Item::}{implicitWidth}
+ and \l {Item::}{implicitHeight} to specify the preferred size of items.
\sa GridLayout
\sa RowLayout
diff --git a/src/imports/settings/qqmlsettings.cpp b/src/imports/settings/qqmlsettings.cpp
index 6b3904909a..310ef62d9f 100644
--- a/src/imports/settings/qqmlsettings.cpp
+++ b/src/imports/settings/qqmlsettings.cpp
@@ -39,10 +39,12 @@
#include "qqmlsettings_p.h"
#include <qcoreevent.h>
+#include <qcoreapplication.h>
#include <qloggingcategory.h>
#include <qsettings.h>
#include <qpointer.h>
#include <qjsvalue.h>
+#include <qqmlinfo.h>
#include <qdebug.h>
#include <qhash.h>
@@ -271,6 +273,26 @@ QSettings *QQmlSettingsPrivate::instance() const
if (!settings) {
QQmlSettings *q = const_cast<QQmlSettings*>(q_func());
settings = fileName.isEmpty() ? new QSettings(q) : new QSettings(fileName, QSettings::IniFormat, q);
+ if (settings->status() != QSettings::NoError) {
+ // TODO: can't print out the enum due to the following error:
+ // error: C2666: 'QQmlInfo::operator <<': 15 overloads have similar conversions
+ qmlWarning(q) << "Failed to initialize QSettings instance. Status code is: " << int(settings->status());
+
+ if (settings->status() == QSettings::AccessError) {
+ QVector<QString> missingIdentifiers;
+ if (QCoreApplication::organizationName().isEmpty())
+ missingIdentifiers.append(QLatin1String("organizationName"));
+ if (QCoreApplication::organizationDomain().isEmpty())
+ missingIdentifiers.append(QLatin1String("organizationDomain"));
+ if (QCoreApplication::applicationName().isEmpty())
+ missingIdentifiers.append(QLatin1String("applicationName"));
+
+ if (!missingIdentifiers.isEmpty())
+ qmlWarning(q) << "The following application identifiers have not been set: " << missingIdentifiers;
+ }
+ return settings;
+ }
+
if (!category.isEmpty())
settings->beginGroup(category);
if (initialized)
diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
index 31650db7c0..2bb1fcac61 100644
--- a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
+++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
@@ -462,6 +462,8 @@ Unlike an ordinary property, an alias has the following restrictions:
\li The \e {alias reference} is not optional,
unlike the optional default value for an ordinary property; the alias reference
must be provided when the alias is first declared.
+\li It cannot refer to \l {Attached Properties and Attached Signal Handlers}
+ {attached properties}.
\li It cannot refer to grouped properties; the following code will not work:
\code
property alias color: rectangle.border.color
diff --git a/src/qml/jsruntime/qv4promiseobject_p.h b/src/qml/jsruntime/qv4promiseobject_p.h
index 80f7183074..bce59b19a7 100644
--- a/src/qml/jsruntime/qv4promiseobject_p.h
+++ b/src/qml/jsruntime/qv4promiseobject_p.h
@@ -39,6 +39,17 @@
#ifndef QV4PROMISEOBJECT_H
#define QV4PROMISEOBJECT_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qv4object_p.h"
#include "qv4functionobject_p.h"
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index a67c5c4a2b..5ed3cc5d6a 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -1132,22 +1132,23 @@ class QQmlComponentIncubator : public QQmlIncubator
public:
QQmlComponentIncubator(QV4::Heap::QmlIncubatorObject *inc, IncubationMode mode)
: QQmlIncubator(mode)
- , incubatorObject(inc)
- {}
+ {
+ incubatorObject.set(inc->internalClass->engine, inc);
+ }
void statusChanged(Status s) override {
- QV4::Scope scope(incubatorObject->internalClass->engine);
- QV4::Scoped<QV4::QmlIncubatorObject> i(scope, incubatorObject);
+ QV4::Scope scope(incubatorObject.engine());
+ QV4::Scoped<QV4::QmlIncubatorObject> i(scope, incubatorObject.as<QV4::QmlIncubatorObject>());
i->statusChanged(s);
}
void setInitialState(QObject *o) override {
- QV4::Scope scope(incubatorObject->internalClass->engine);
- QV4::Scoped<QV4::QmlIncubatorObject> i(scope, incubatorObject);
+ QV4::Scope scope(incubatorObject.engine());
+ QV4::Scoped<QV4::QmlIncubatorObject> i(scope, incubatorObject.as<QV4::QmlIncubatorObject>());
i->setInitialState(o);
}
- QV4::Heap::QmlIncubatorObject *incubatorObject;
+ QV4::PersistentValue incubatorObject; // keep a strong internal reference while incubating
};
@@ -1571,6 +1572,9 @@ void QV4::QmlIncubatorObject::statusChanged(QQmlIncubator::Status s)
QQmlEnginePrivate::warning(QQmlEnginePrivate::get(scope.engine->qmlEngine()), error);
}
}
+
+ if (s != QQmlIncubator::Loading)
+ d()->incubator->incubatorObject.clear();
}
#undef INITIALPROPERTIES_SOURCE
diff --git a/src/quick/accessible/qaccessiblequickitem.cpp b/src/quick/accessible/qaccessiblequickitem.cpp
index 87e581384b..98e7663c96 100644
--- a/src/quick/accessible/qaccessiblequickitem.cpp
+++ b/src/quick/accessible/qaccessiblequickitem.cpp
@@ -205,14 +205,16 @@ QAccessible::Role QAccessibleQuickItem::role() const
// Workaround for setAccessibleRole() not working for
// Text items. Text items are special since they are defined
// entirely from C++ (setting the role from QML works.)
- if (qobject_cast<QQuickText*>(const_cast<QQuickItem *>(item())))
- return QAccessible::StaticText;
QAccessible::Role role = QAccessible::NoRole;
if (item())
role = QQuickItemPrivate::get(item())->accessibleRole();
- if (role == QAccessible::NoRole)
- role = QAccessible::Client;
+ if (role == QAccessible::NoRole) {
+ if (qobject_cast<QQuickText*>(const_cast<QQuickItem *>(item())))
+ role = QAccessible::StaticText;
+ else
+ role = QAccessible::Client;
+ }
return role;
}
diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h
index f3ce04d11e..d1a8bbd901 100644
--- a/src/quick/items/qquickevents_p_p.h
+++ b/src/quick/items/qquickevents_p_p.h
@@ -450,6 +450,8 @@ protected:
Qt::MouseButton m_button = Qt::NoButton;
Qt::MouseButtons m_pressedButtons;
+ friend class QQuickWindowPrivate;
+
Q_DISABLE_COPY(QQuickPointerEvent)
};
diff --git a/src/quick/items/qquickflickable_p.h b/src/quick/items/qquickflickable_p.h
index 57cc2533a0..7e9b18e101 100644
--- a/src/quick/items/qquickflickable_p.h
+++ b/src/quick/items/qquickflickable_p.h
@@ -267,10 +267,11 @@ Q_SIGNALS:
Q_REVISION(9) void horizontalOvershootChanged();
Q_REVISION(9) void verticalOvershootChanged();
- Q_REVISION(12) void atXEndChanged();
- Q_REVISION(12) void atYEndChanged();
- Q_REVISION(12) void atXBeginningChanged();
- Q_REVISION(12) void atYBeginningChanged();
+ // The next four signals should be marked as Q_REVISION(12). See QTBUG-71243
+ void atXEndChanged();
+ void atYEndChanged();
+ void atXBeginningChanged();
+ void atYBeginningChanged();
protected:
bool childMouseEventFilter(QQuickItem *, QEvent *) override;
diff --git a/src/quick/items/qquicktext_p.h b/src/quick/items/qquicktext_p.h
index f4e7fa7046..1af60051fb 100644
--- a/src/quick/items/qquicktext_p.h
+++ b/src/quick/items/qquicktext_p.h
@@ -272,8 +272,10 @@ Q_SIGNALS:
void textFormatChanged(QQuickText::TextFormat textFormat);
void elideModeChanged(QQuickText::TextElideMode mode);
void contentSizeChanged();
- Q_REVISION(12) void contentWidthChanged(qreal contentWidth);
- Q_REVISION(12) void contentHeightChanged(qreal contentHeight);
+ // The next two signals should be marked as Q_REVISION(12). See QTBUG-71247
+ void contentWidthChanged(qreal contentWidth);
+ void contentHeightChanged(qreal contentHeight);
+
void lineHeightChanged(qreal lineHeight);
void lineHeightModeChanged(LineHeightMode mode);
void fontSizeModeChanged();
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index d27ee54c89..4f14eedd39 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -2548,6 +2548,10 @@ bool QQuickWindowPrivate::deliverPressOrReleaseEvent(QQuickPointerEvent *event,
}
for (QQuickItem *item : targetItems) {
+ if (!event->m_event) {
+ qWarning("event went missing during delivery! (nested sendEvent() is not allowed)");
+ break;
+ }
hasFiltered.clear();
if (!handlersOnly && sendFilteredPointerEvent(event, item)) {
if (event->isAccepted()) {
@@ -2562,6 +2566,10 @@ bool QQuickWindowPrivate::deliverPressOrReleaseEvent(QQuickPointerEvent *event,
// nor to any item which already had a chance to filter.
if (skipDelivery.contains(item))
continue;
+ if (!event->m_event) {
+ qWarning("event went missing during delivery! (nested sendEvent() is not allowed)");
+ break;
+ }
deliverMatchingPointsToItem(item, event, handlersOnly);
if (event->allPointsAccepted())
handlersOnly = true;
diff --git a/src/quick/scenegraph/qsgbasicinternalimagenode.cpp b/src/quick/scenegraph/qsgbasicinternalimagenode.cpp
index 53271af9ab..03b48b4b8a 100644
--- a/src/quick/scenegraph/qsgbasicinternalimagenode.cpp
+++ b/src/quick/scenegraph/qsgbasicinternalimagenode.cpp
@@ -230,6 +230,9 @@ QSGGeometry *QSGBasicInternalImageNode::updateGeometry(const QRectF &targetRect,
++vCells;
if (innerTargetRect.bottom() != targetRect.bottom())
++vCells;
+ if (hCells * vCells * 4 >= 0x10000)
+ qWarning("QTBUG-58924 - Too many tiles in QSGInternalImageNode, rendering will be partially missing.");
+
QVarLengthArray<X, 32> xData(2 * hCells);
QVarLengthArray<Y, 32> yData(2 * vCells);
X *xs = xData.data();
diff --git a/src/quick/util/qquickstategroup.cpp b/src/quick/util/qquickstategroup.cpp
index 3d8c5e0507..d8daec2f07 100644
--- a/src/quick/util/qquickstategroup.cpp
+++ b/src/quick/util/qquickstategroup.cpp
@@ -302,7 +302,8 @@ void QQuickStateGroup::componentComplete()
Q_D(QQuickStateGroup);
d->componentComplete = true;
- QSet<QString> names;
+ QVarLengthArray<QString, 4> names;
+ names.reserve(d->states.count());
for (int ii = 0; ii < d->states.count(); ++ii) {
QQuickState *state = d->states.at(ii);
if (!state->isNamed())
@@ -312,7 +313,7 @@ void QQuickStateGroup::componentComplete()
if (names.contains(stateName)) {
qmlWarning(state->parent()) << "Found duplicate state name: " << stateName;
} else {
- names << stateName;
+ names.append(std::move(stateName));
}
}