6#if QT_CONFIG(quick_viewtransitions)
10#include <QtCore/qscopedvaluerollback.h>
11#include <QtQml/qqmlinfo.h>
12#include <QtQml/qqmllist.h>
13#include <QtQml/private/qv4qmlcontext_p.h>
14#include <QtQml/private/qv4qobjectwrapper_p.h>
15#include <QtQml/private/qv4variantobject_p.h>
16#include <QtQml/private/qv4urlobject_p.h>
17#include <QtQuick/private/qquickanimation_p.h>
18#include <QtQuick/private/qquicktransition_p.h>
34 qmlWarning(
q) <<
"cannot " << attemptedOperation <<
" while already in the process of completing a " <<
operation;
49 emit q->currentItemChanged();
54 if (
props.isObject()) {
72 QList<QQuickStackElement *>
elements;
75 for (
int i = from;
i < argc; ++
i) {
90 }
else if (!
error.isEmpty()) {
104 }
else if (!
error.isEmpty()) {
115 QList<QQuickStackElement *> stackElements;
126 if (!nextArg.mProperties.isEmpty()
127 || (!nextArg.mItem && !nextArg.mComponent && !nextArg.mUrl.isValid())) {
139 if (!
arg.mProperties.isEmpty()) {
140 qmlWarning(
q) <<
"Properties must come after an Item, Component or URL";
148 stackElements.append(element);
150 return stackElements;
167 return findElement(qobject_cast<QQuickItem *>(
o->object()));
198 if (
data.typeId() == QMetaType::QUrl) {
210 if (!elems.isEmpty()) {
223 return pushElements(QList<QQuickStackElement *>() << element);
260 QScopedValueRollback<QString> operationNameRollback(this->operation,
operationName);
276 bool nothingToDo =
false;
308 previousItem = exit->
item;
311#if QT_CONFIG(quick_viewtransitions)
324#if QT_CONFIG(quick_viewtransitions)
325void QQuickStackViewPrivate::ensureTransitioner()
336 first.element->transitionNextReposition(transitioner,
first.type,
first.target);
338 second.
element->transitionNextReposition(transitioner, second.
type, second.
target);
344 if (!
first.element->item || !
first.element->prepareTransition(transitioner,
first.viewBounds) || immediate)
347 first.element->startTransition(transitioner,
first.status);
353 second.
element->startTransition(transitioner, second.
status);
357 setBusy(!transitioner->runningJobs.isEmpty());
358 transitioner->resetTargetLists();
366 if (element->prepared) {
374 }
else if (element->
item) {
381 viewItemTransitionFinished(element);
394 if (!existingElement || element == existingElement)
396 if (element->
removal || element->isPendingRemoval())
400 if (transitioner && transitioner->runningJobs.isEmpty()) {
405 QList<QQuickStackElement*> removedElements =
removed;
411 if (removedElement->item &&
findElement(removedElement->item)) {
413 removedElement->item =
nullptr;
431 q->setFiltersChildMouseEvents(
busy);
432 emit q->busyChanged();
438 if (newDepth == oldDepth)
441 emit q->depthChanged();
442 if (newDepth == 0 || oldDepth == 0)
443 emit q->emptyChanged();
void setFocus(Qt::FocusReason focusReason=Qt::OtherFocusReason)
Gives keyboard input focus to this item.
QV4::ExecutionEngine * handle() const
qsizetype size() const noexcept
bool isEmpty() const noexcept
qsizetype length() const noexcept
const_reference at(qsizetype i) const noexcept
T value(qsizetype i) const
QQuickAnchorLine top() const
static QQuickItemPrivate * get(QQuickItem *item)
void setChangeListener(QQuickItemViewTransitionChangeListener *obj)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
void setPosition(const QPointF &)
void setVisible(bool visible)
static QQuickStackElement * fromObject(QObject *object, QQuickStackView *view, QString *error)
void setStatus(QQuickStackView::Status status)
static QQuickStackElement * fromString(const QString &str, QQuickStackView *view, QString *error)
static QQuickStackElement * fromStackViewArg(QQuickStackView *view, QQuickStackViewArg arg)
QV4::PersistentValue properties
QQuickStackView::Status status
bool load(QQuickStackView *parent)
QV4::PersistentValue qmlCallingContext
void warnOfInterruption(const QString &attemptedOperation)
bool pushElements(const QList< QQuickStackElement * > &elements)
bool replaceElements(QQuickStackElement *element, const QList< QQuickStackElement * > &elements)
QList< QQuickStackElement * > parseElements(int from, QQmlV4FunctionPtr args, QStringList *errors)
QList< QQuickStackElement * > removed
QQuickStackElement * createElement(const QV4::Value &value, const QQmlRefPointer< QQmlContextData > &context, QString *error)
void warn(const QString &error)
void setCurrentItem(QQuickStackElement *element)
bool popElements(QQuickStackElement *element)
QStack< QQuickStackElement * > elements
QQuickStackElement * findElement(QQuickItem *item) const
void depthChange(int newDepth, int oldDepth)
QSet< QQuickStackElement * > removing
QQuickItem * popToItem(QQuickItem *item, QQuickStackView::Operation operation, CurrentItemPolicy currentItemPolicy)
bool pushElement(QQuickStackElement *element)
bool remove(const T &value)
iterator insert(const T &value)
T & top()
Returns a reference to the stack's top item.
T pop()
Removes the top item from the stack and returns it.
void push(const T &t)
Adds element t to the top of the stack.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
bool isRelative() const
Returns true if the URL is relative; otherwise returns false.
void set(ExecutionEngine *engine, const Value &value)
qDeleteAll(list.begin(), list.end())
Combined button and popup list for selecting options.
#define ACTION_IF_DELETED(p, func, action)
static const QCssKnownValue properties[NumProperties - 1]
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static QV4::ExecutionEngine * v4Engine(QV4::Value *d)
GLboolean GLboolean GLboolean b
GLdouble GLdouble GLdouble GLdouble top
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLsizei const GLenum * props
GLdouble GLdouble GLdouble GLdouble q
QQmlEngine * qmlEngine(const QObject *obj)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
static QUrl resolvedUrl(const QUrl &url, const QQmlRefPointer< QQmlContextData > &context)
static bool initProperties(QQuickStackElement *element, const QV4::Value &props, QQmlV4FunctionPtr args)
static QLatin1StringView operationName(QNetworkAccessManager::Operation operation)
#define QStringLiteral(str)
QUrl url("example.com")
[constructor-url-reference]
QQuickStackElement * element
QQuickItemViewTransitioner::TransitionType type
QQuickStackView::Status status
QQuickTransition * transition
static QQuickStackTransition popExit(QQuickStackView::Operation operation, QQuickStackElement *element, QQuickStackView *view)
static QQuickStackTransition popEnter(QQuickStackView::Operation operation, QQuickStackElement *element, QQuickStackView *view)
QQmlRefPointer< QQmlContextData > callingQmlContext() const
static QVariant toVariant(const QV4::Value &value, QMetaType typeHint, bool createJSValueForObjectsAndSymbols=true)
static Heap::ExecutionContext * qmlContext(Heap::ExecutionContext *ctx)