7#include <QtQuick/private/qquickflickable_p.h>
207 if (!
q->isContent(
item))
224 q->setCurrentIndex(
index);
237 q->itemMoved(to,
item);
240 for (
int i = from;
i < to; ++
i)
243 for (
int i = from;
i > to; --
i)
247 if (from == oldCurrent)
248 q->setCurrentIndex(to);
249 else if (from < oldCurrent && to >= oldCurrent)
250 q->setCurrentIndex(oldCurrent - 1);
251 else if (from > oldCurrent && to <= oldCurrent)
252 q->setCurrentIndex(oldCurrent + 1);
261 if (!item_inDestructor && !
q->isContent(
item))
268 bool currentChanged =
false;
273 currentChanged =
true;
276 if (!item_inDestructor) {
290 emit q->currentIndexChanged();
304 for (
int i = 0;
i < siblings.size(); ++
i) {
360 else if (
p->contentModel->indexOf(
item,
nullptr) == -1)
363 p->contentData.append(
obj);
416 emit q->contentWidthChanged();
426 emit q->contentHeightChanged();
458 return d->contentModel->count();
493 const int count =
d->contentModel->count();
494 if (index < 0 || index >
count)
497 int oldIndex =
d->contentModel->indexOf(
item,
nullptr);
498 if (oldIndex != -1) {
499 if (oldIndex <
index)
501 if (oldIndex !=
index)
516 const int count =
d->contentModel->count();
517 if (from < 0 || from >
count - 1)
519 if (to < 0 || to >
count - 1)
523 d->moveItem(from, to,
d->itemAt(from));
538 const int index =
d->contentModel->indexOf(
item,
nullptr);
557 const int count =
d->contentModel->count();
558 if (index < 0 || index >=
count)
612 d->executeContentItem();
613 return QQmlListProperty<QObject>(
this,
nullptr,
636 return QQmlListProperty<QQuickItem>(
this,
nullptr,
653 return d->currentIndex;
669 if (
d->currentIndex ==
index)
688void QQuickContainer::incrementCurrentIndex()
691 if (
d->currentIndex <
count() - 1)
706void QQuickContainer::decrementCurrentIndex()
709 if (
d->currentIndex > 0)
724 return itemAt(
d->currentIndex);
742 return d->contentWidth;
748 d->hasContentWidth =
true;
754 emit contentWidthChanged();
760 if (!
d->hasContentWidth)
763 d->hasContentWidth =
false;
764 d->updateContentWidth();
782 return d->contentHeight;
788 d->hasContentHeight =
true;
794 emit contentHeightChanged();
800 if (!
d->hasContentHeight)
803 d->hasContentHeight =
false;
804 d->updateContentHeight();
829 static const int slotIndex =
metaObject()->indexOfSlot(
"_q_currentIndexChanged()");
834 if (oldContentItem != oldItem)
837 int signalIndex = oldItem->metaObject()->indexOfSignal(
"currentIndexChanged()");
845 if (newContentItem != newItem)
848 int signalIndex = newItem->metaObject()->indexOfSignal(
"currentIndexChanged()");
885#include "moc_qquickcontainer_p.cpp"
void setParentItem(QGraphicsItem *parent)
Sets this item's parent item to newParent.
static constexpr Policy Preferred
bool removeOne(const AT &t)
void append(parameter_type t)
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
QVariant property(const char *name) const
Returns the value of the object's name property.
int count() const override
\qmlproperty int QtQml.Models::ObjectModel::count
int indexOf(QObject *object, QObject *objectContext) const override
static void contentData_append(QQmlListProperty< QObject > *prop, QObject *obj)
void _q_currentIndexChanged()
static QQuickItem * contentChildren_at(QQmlListProperty< QQuickItem > *prop, qsizetype index)
void itemChildAdded(QQuickItem *item, QQuickItem *child) override
void itemParentChanged(QQuickItem *item, QQuickItem *parent) override
void moveItem(int from, int to, QQuickItem *item)
void updateContentHeight()
static qsizetype contentChildren_count(QQmlListProperty< QQuickItem > *prop)
void itemSiblingOrderChanged(QQuickItem *item) override
static QObject * contentData_at(QQmlListProperty< QObject > *prop, qsizetype index)
void removeItem(int index, QQuickItem *item)
static qsizetype contentData_count(QQmlListProperty< QObject > *prop)
void itemDestroyed(QQuickItem *item) override
static void contentChildren_append(QQmlListProperty< QQuickItem > *prop, QQuickItem *obj)
QQuickItem * itemAt(int index) const
static void contentData_clear(QQmlListProperty< QObject > *prop)
static void contentChildren_clear(QQmlListProperty< QQuickItem > *prop)
void updateContentWidth()
void insertItem(int index, QQuickItem *item)
QQmlObjectModel * contentModel
QQuickItemPrivate::ChangeTypes changeTypes
static QQuickContainerPrivate * get(QQuickContainer *container)
QQuickContainer(QQuickItem *parent=nullptr)
virtual void itemMoved(int index, QQuickItem *item)
void resetContentHeight()
Q_INVOKABLE void addItem(QQuickItem *item)
\qmlmethod void QtQuick.Controls::Container::addItem(Item item)
void currentItemChanged()
virtual void itemAdded(int index, QQuickItem *item)
Q_INVOKABLE void removeItem(QQuickItem *item)
virtual void itemRemoved(int index, QQuickItem *item)
void setCurrentIndex(int index)
\qmlmethod void QtQuick.Controls::Container::setCurrentIndex(int index)
void setContentWidth(qreal width)
Q_INVOKABLE void moveItem(int from, int to)
\qmlmethod void QtQuick.Controls::Container::moveItem(int from, int to)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
Q_INVOKABLE QQuickItem * itemAt(int index) const
\qmlmethod Item QtQuick.Controls::Container::itemAt(int index)
QQmlListProperty< QQuickItem > contentChildren
\qmlproperty list<Item> QtQuick.Controls::Container::contentChildren
void currentIndexChanged()
virtual bool isContent(QQuickItem *item) const
void contentChildrenChanged()
void itemChange(ItemChange change, const ItemChangeData &data) override
Called when change occurs for this item.
void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override
QQmlListProperty< QObject > contentData
\qmlproperty list<QtObject> QtQuick.Controls::Container::contentData \qmldefault
void setContentHeight(qreal height)
Q_INVOKABLE void insertItem(int index, QQuickItem *item)
\qmlmethod void QtQuick.Controls::Container::insertItem(int index, Item item)
QQuickDeferredPointer< QQuickItem > contentItem
static void hideOldItem(QQuickItem *item)
qreal implicitContentWidth
qreal implicitContentHeight
void itemDestroyed(QQuickItem *item) override
virtual void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void itemChange(ItemChange change, const ItemChangeData &value) override
Called when change occurs for this item.
void setSizePolicy(const QLayoutPolicy::Policy &horizontalPolicy, const QLayoutPolicy::Policy &verticalPolicy)
quint32 componentComplete
static QQuickItemPrivate * get(QQuickItem *item)
bool isTransparentForPositioner() const
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
qreal width
This property holds the width of this item.
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
qreal height
This property holds the height of this item.
ItemChange
Used in conjunction with QQuickItem::itemChange() to notify the item about certain types of changes.
static QQuickWindowPrivate * get(QQuickWindow *c)
int toInt(bool *ok=nullptr) const
Returns the variant as an int if the variant has userType() \l QMetaType::Int, \l QMetaType::Bool,...
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
Combined button and popup list for selecting options.
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
GLint GLsizei GLsizei height
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLdouble GLdouble GLdouble GLdouble q
QQmlContext * qmlContext(const QObject *obj)
static QT_BEGIN_NAMESPACE QQuickItem * effectiveContentItem(QQuickItem *item)
Abstract base type providing functionality common to containers.
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
obj metaObject() -> className()
bool contains(const AT &t) const noexcept