7#if QT_CONFIG(quick_viewtransitions)
11#include <QtCore/qscopedvaluerollback.h>
12#include <QtQml/qjsvalue.h>
13#include <QtQml/qqmlengine.h>
14#include <QtQml/qqmlinfo.h>
16#include <private/qv4qobjectwrapper_p.h>
17#include <private/qqmlengine_p.h>
41#ifndef QT_NO_DEBUG_STREAM
45 debug.nospace() <<
"QQuickStackViewArg("
46 <<
"mItem=" <<
arg.mItem
47 <<
" mComponent=" <<
arg.mComponent
48 <<
" mUrl=" <<
arg.mUrl
392#if QT_CONFIG(quick_viewtransitions)
393 if (
d->transitioner) {
394 d->transitioner->setChangeListener(
nullptr);
395 delete d->transitioner;
427 return d->elements.size();
438 return d->currentItem;
458 return element->
item;
488 for (
int i =
d->elements.size() - 1;
i >= 0; --
i) {
495 return element->
item;
570 if (
d->modifyingElements) {
571 d->warnOfInterruption(operationName);
586#if QT_CONFIG(quick_viewtransitions)
598 return element->item && d->findElement(element->item);
604 if (!errors.isEmpty() ||
elements.isEmpty()) {
605 if (!errors.isEmpty()) {
615#if QT_CONFIG(quick_viewtransitions)
617 if (!
d->elements.isEmpty())
618 exit =
d->elements.top();
621 int oldDepth =
d->elements.size();
623 d->depthChange(
d->elements.size(), oldDepth);
625#if QT_CONFIG(quick_viewtransitions)
630 d->setCurrentItem(enter);
633 if (
d->currentItem) {
684 if (
d->modifyingElements) {
685 d->warnOfInterruption(operationName);
693 if (
d->elements.size() <= 1 || argc > 2) {
700 int oldDepth =
d->elements.size();
709 if (
value->isNull()) {
710 enter =
d->elements.value(0);
713 enter =
d->findElement(
item);
715 if (
item !=
d->currentItem)
718 d->elements.push(exit);
724#if QT_CONFIG(quick_viewtransitions)
735 if (
d->popElements(enter)) {
738 d->removing.insert(exit);
739 previousItem = exit->
item;
741 d->depthChange(
d->elements.size(), oldDepth);
742#if QT_CONFIG(quick_viewtransitions)
747 d->setCurrentItem(enter);
855 if (
d->modifyingElements) {
856 d->warnOfInterruption(operationName);
872#if QT_CONFIG(quick_viewtransitions)
884 target =
d->findElement(firstArg);
888 if (!errors.isEmpty() ||
elements.isEmpty()) {
889 if (!errors.isEmpty()) {
899 int oldDepth =
d->elements.size();
901 if (!
d->elements.isEmpty())
902 exit =
d->elements.pop();
905 d->depthChange(
d->elements.size(), oldDepth);
908 d->removing.insert(exit);
911#if QT_CONFIG(quick_viewtransitions)
916 d->setCurrentItem(enter);
919 if (
d->currentItem) {
981 if (
d->modifyingElements) {
982 d->warnOfInterruption(operationName);
991#if QT_CONFIG(quick_viewtransitions)
993 if (!
d->elements.isEmpty())
994 exit =
d->elements.top();
997 const int oldDepth =
d->elements.size();
998 if (
d->pushElements(stackElements)) {
999 d->depthChange(
d->elements.size(), oldDepth);
1001#if QT_CONFIG(quick_viewtransitions)
1006 d->setCurrentItem(enter);
1009 return d->currentItem;
1132 if (index < 0 || index >=
d->elements.size()) {
1138 if (
index ==
d->elements.size() - 1) {
1144 element->
load(
this);
1168 if (
d->elements.size() == 1) {
1169 auto lastItemRemoved =
d->elements.last()->item;
1171 return lastItemRemoved;
1222 if (
d->modifyingElements) {
1223 d->warnOfInterruption(operationName);
1234 int oldDepth =
d->elements.size();
1236 if (!
d->elements.isEmpty())
1237 exit =
d->elements.pop();
1239 const bool successfullyReplaced = exit != currentElement
1240 ?
d->replaceElements(currentElement, stackElements)
1241 :
d->pushElements(stackElements);
1242 if (successfullyReplaced) {
1243 d->depthChange(
d->elements.size(), oldDepth);
1246 d->removing.insert(exit);
1249#if QT_CONFIG(quick_viewtransitions)
1254 d->setCurrentItem(enter);
1257 return d->currentItem;
1353 return d->elements.isEmpty();
1372#if !QT_CONFIG(quick_viewtransitions)
1376 if (
d->elements.isEmpty())
1380 if (
d->modifyingElements) {
1381 d->warnOfInterruption(operationName);
1385 const int oldDepth =
d->elements.size();
1389#if QT_CONFIG(quick_viewtransitions)
1393 d->removing.insert(exit);
1399 d->setCurrentItem(
nullptr);
1401 d->elements.clear();
1402 d->depthChange(0, oldDepth);
1420 return d->initialItem;
1426 d->initialItem =
item;
1429#if QT_CONFIG(quick_viewtransitions)
1441 if (
d->transitioner)
1442 return d->transitioner->removeDisplacedTransition;
1449 d->ensureTransitioner();
1450 if (
d->transitioner->removeDisplacedTransition == enter)
1453 d->transitioner->removeDisplacedTransition = enter;
1454 emit popEnterChanged();
1468 if (
d->transitioner)
1469 return d->transitioner->removeTransition;
1476 d->ensureTransitioner();
1477 if (
d->transitioner->removeTransition == exit)
1480 d->transitioner->removeTransition = exit;
1481 emit popExitChanged();
1495 if (
d->transitioner)
1496 return d->transitioner->addTransition;
1503 d->ensureTransitioner();
1504 if (
d->transitioner->addTransition == enter)
1507 d->transitioner->addTransition = enter;
1508 emit pushEnterChanged();
1522 if (
d->transitioner)
1523 return d->transitioner->addDisplacedTransition;
1530 d->ensureTransitioner();
1531 if (
d->transitioner->addDisplacedTransition == exit)
1534 d->transitioner->addDisplacedTransition = exit;
1535 emit pushExitChanged();
1549 if (
d->transitioner)
1550 return d->transitioner->moveTransition;
1557 d->ensureTransitioner();
1558 if (
d->transitioner->moveTransition == enter)
1561 d->transitioner->moveTransition = enter;
1562 emit replaceEnterChanged();
1576 if (
d->transitioner)
1577 return d->transitioner->moveDisplacedTransition;
1584 d->ensureTransitioner();
1585 if (
d->transitioner->moveDisplacedTransition == exit)
1588 d->transitioner->moveDisplacedTransition = exit;
1589 emit replaceExitChanged();
1601 int oldDepth =
d->elements.size();
1602 if (
QObject *
o =
d->initialItem.toQObject())
1604 else if (
d->initialItem.isString())
1606 if (!
error.isEmpty()) {
1609 }
else if (
d->pushElement(element)) {
1610 d->depthChange(
d->elements.size(), oldDepth);
1611 d->setCurrentItem(element);
1622 if (element->
item) {
1647#if QT_CONFIG(quicktemplates2_multitouch)
1654#if QT_CONFIG(accessibility)
1655QAccessible::Role QQuickStackView::accessibleRole()
const
1657 return QAccessible::LayeredPane;
1674 if (oldIndex != newIndex)
1675 emit q->indexChanged();
1676 if (oldView != newView)
1677 emit q->viewChanged();
1678 if (oldStatus != newStatus)
1679 emit q->statusChanged();
1714 return d->element ?
d->element->index : -1;
1727 return d->element ?
d->element->view :
nullptr;
1773 return parentItem && parentItem->
isVisible();
1779 d->explicitVisible =
true;
1788 d->explicitVisible =
false;
1789 if (!
d->element || !
d->element->view)
1794 parentItem->
setVisible(parentItem ==
d->element->view->currentItem());
1854#include "moc_qquickstackview_p.cpp"
QGraphicsWidget * window() const
QGraphicsItem * parentItem() const
Returns a pointer to this item's parent item.
QJSValue newQObject(QObject *object)
Creates a JavaScript object that wraps the given QObject object, using JavaScriptOwnership.
The QJSValue class acts as a container for Qt/JavaScript data types.
bool toBool() const
Returns the boolean value of this QJSValue, using the conversion rules described in \l{ECMA-262} sect...
QJSValue call(const QJSValueList &args=QJSValueList()) const
Calls this QJSValue as a function, passing args as arguments to the function, and using the globalObj...
qsizetype length() const noexcept
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
The QQmlComponent class encapsulates a QML component definition.
The QQmlEngine class provides an environment for instantiating QML components.
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void removeItemChangeListener(QQuickItemChangeListener *, ChangeTypes types)
void addItemChangeListener(QQuickItemChangeListener *listener, ChangeTypes types)
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
void setFlag(Flag flag, bool enabled=true)
Enables the specified flag for this item if enabled is true; if enabled is false, the flag is disable...
QQuickWindow * window() const
Returns the window in which this item is rendered.
virtual void touchEvent(QTouchEvent *event)
This event handler can be reimplemented in a subclass to receive touch events for an item.
static QQuickStackElement * fromObject(QObject *object, QQuickStackView *view, QString *error)
void setStatus(QQuickStackView::Status status)
static QQuickStackElement * fromString(const QString &str, QQuickStackView *view, QString *error)
QQuickStackView::Status status
bool load(QQuickStackView *parent)
QQuickStackViewArg()=default
void itemParentChanged(QQuickItem *item, QQuickItem *parent) override
QQuickStackElement * element
void setVisible(bool visible)
QQuickStackViewAttached(QObject *parent=nullptr)
~QQuickStackViewAttached()
QQuickStackView::Status status
static QQuickStackViewPrivate * get(QQuickStackView *view)
QQuickStackElement * findElement(QQuickItem *item) const
QQuickStackView(QQuickItem *parent=nullptr)
Provides a stack-based navigation model.
static QQuickStackViewAttached * qmlAttachedProperties(QObject *object)
bool isBusy() const
\qmlproperty bool QtQuick.Controls::StackView::busy \readonly This property holds whether a transitio...
void clear(Operation operation=Immediate)
\qmlmethod void QtQuick.Controls::StackView::clear(transition)
Q_INVOKABLE void push(QQmlV4Function *args)
\qmlmethod Item QtQuick.Controls::StackView::push(item, properties, operation)
Q_INVOKABLE void pop(QQmlV4Function *args)
\qmlmethod Item QtQuick.Controls::StackView::pop(item, operation)
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void setInitialItem(const QJSValue &item)
Q_INVOKABLE void replace(QQmlV4Function *args)
\qmlmethod Item QtQuick.Controls::StackView::replace(target, item, properties, operation)
Q_INVOKABLE QQuickItem * get(int index, QQuickStackView::LoadBehavior behavior=DontLoad)
\qmlmethod Item QtQuick.Controls::StackView::get(index, behavior)
Q_INVOKABLE QQuickItem * find(const QJSValue &callback, QQuickStackView::LoadBehavior behavior=DontLoad)
\qmlmethod Item QtQuick.Controls::StackView::find(callback, behavior)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
bool childMouseEventFilter(QQuickItem *, QEvent *) override
Reimplement this method to filter the pointer events that are received by this item's children.
const QVariantMap & properties
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\inmodule QtCore\reentrant
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QTouchEvent class contains parameters that describe a touch event.
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static const QCssKnownValue properties[NumProperties - 1]
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
QList< QJSValue > QJSValueList
GLdouble GLdouble GLdouble GLdouble q
static qreal component(const QPointF &point, unsigned int i)
QQmlEngine * qmlEngine(const QObject *obj)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
QDebug operator<<(QDebug debug, const QQuickStackViewArg &arg)
#define QStringLiteral(str)
static const QTextHtmlElement elements[Html_NumElements]
QUrl url("example.com")
[constructor-url-reference]
static QQuickStackTransition pushExit(QQuickStackView::Operation operation, QQuickStackElement *element, QQuickStackView *view)
static QQuickStackTransition replaceExit(QQuickStackView::Operation operation, QQuickStackElement *element, QQuickStackView *view)
static QQuickStackTransition replaceEnter(QQuickStackView::Operation operation, QQuickStackElement *element, QQuickStackView *view)
static QQuickStackTransition popExit(QQuickStackView::Operation operation, QQuickStackElement *element, QQuickStackView *view)
static QQuickStackTransition popEnter(QQuickStackView::Operation operation, QQuickStackElement *element, QQuickStackView *view)
static QQuickStackTransition pushEnter(QQuickStackView::Operation operation, QQuickStackElement *element, QQuickStackView *view)
static constexpr ReturnedValue null()
static ReturnedValue wrap(ExecutionEngine *engine, QObject *object)
constexpr ReturnedValue asReturnedValue() const
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent