7#include <QtQuick/private/qquickflickable_p.h>
206 if (!
q->isContent(
item))
223 q->setCurrentIndex(
index);
236 q->itemMoved(to,
item);
239 for (
int i = from;
i < to; ++
i)
242 for (
int i = from;
i > to; --
i)
246 if (from == oldCurrent)
247 q->setCurrentIndex(to);
248 else if (from < oldCurrent && to >= oldCurrent)
249 q->setCurrentIndex(oldCurrent - 1);
250 else if (from > oldCurrent && to <= oldCurrent)
251 q->setCurrentIndex(oldCurrent + 1);
259 if (!
q->isContent(
item))
266 bool currentChanged =
false;
271 currentChanged =
true;
285 emit q->currentIndexChanged();
299 for (
int i = 0;
i < siblings.
size(); ++
i) {
355 else if (
p->contentModel->indexOf(
item,
nullptr) == -1)
358 p->contentData.append(
obj);
411 emit q->contentWidthChanged();
421 emit q->contentHeightChanged();
453 return d->contentModel->count();
488 const int count =
d->contentModel->count();
489 if (index < 0 || index >
count)
492 int oldIndex =
d->contentModel->indexOf(
item,
nullptr);
493 if (oldIndex != -1) {
494 if (oldIndex <
index)
496 if (oldIndex !=
index)
511 const int count =
d->contentModel->count();
512 if (from < 0 || from >
count - 1)
514 if (to < 0 || to >
count - 1)
518 d->moveItem(from, to,
d->itemAt(from));
533 const int index =
d->contentModel->indexOf(
item,
nullptr);
552 const int count =
d->contentModel->count();
553 if (index < 0 || index >=
count)
607 d->executeContentItem();
648 return d->currentIndex;
664 if (
d->currentIndex ==
index)
683void QQuickContainer::incrementCurrentIndex()
686 if (
d->currentIndex <
count() - 1)
701void QQuickContainer::decrementCurrentIndex()
704 if (
d->currentIndex > 0)
719 return itemAt(
d->currentIndex);
737 return d->contentWidth;
743 d->hasContentWidth =
true;
749 emit contentWidthChanged();
755 if (!
d->hasContentWidth)
758 d->hasContentWidth =
false;
759 d->updateContentWidth();
777 return d->contentHeight;
783 d->hasContentHeight =
true;
789 emit contentHeightChanged();
795 if (!
d->hasContentHeight)
798 d->hasContentHeight =
false;
799 d->updateContentHeight();
824 static const int slotIndex =
metaObject()->indexOfSlot(
"_q_currentIndexChanged()");
829 if (oldContentItem != oldItem)
832 int signalIndex = oldItem->metaObject()->indexOfSignal(
"currentIndexChanged()");
840 if (newContentItem != newItem)
843 int signalIndex = newItem->metaObject()->indexOfSignal(
"currentIndexChanged()");
880#include "moc_qquickcontainer_p.cpp"
void setParentItem(QGraphicsItem *parent)
Sets this item's parent item to newParent.
qsizetype size() const noexcept
bool removeOne(const AT &t)
const_reference at(qsizetype i) const noexcept
T value(qsizetype i) const
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.
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
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.
QPointer< QQuickItem > subFocusItem
void removeItemChangeListener(QQuickItemChangeListener *, ChangeTypes types)
void addItemChangeListener(QQuickItemChangeListener *listener, ChangeTypes types)
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}.
QList< QQuickItem * > childItems() const
Returns the children of this item.
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)
void clearFocusInScope(QQuickItem *scope, QQuickItem *item, Qt::FocusReason reason)
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
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent