Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQuickPackagePrivate Class Reference

\qmltype Package \instantiates QQuickPackage \inqmlmodule QtQml.Models More...

+ Inheritance diagram for QQuickPackagePrivate:
+ Collaboration diagram for QQuickPackagePrivate:

Classes

struct  DataGuard
 

Public Member Functions

 QQuickPackagePrivate ()
 
- Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
void setParent_helper (QObject *)
 
void moveToThread_helper ()
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
 
QObjectList receiverList (const char *signal) const
 
void ensureConnectionData ()
 
void addConnection (int signal, Connection *c)
 
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
 
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
 
bool maybeSignalConnected (uint signalIndex) const
 
bool isDeclarativeSignalConnected (uint signalIdx) const
 
void connectNotify (const QMetaMethod &signal)
 
void disconnectNotify (const QMetaMethod &signal)
 
void reinitBindingStorageAfterThreadMove ()
 
virtual std::string flagsForDumping () const
 
virtual void writeToDebugStream (QDebug &) const
 
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
 
- Public Member Functions inherited from QObjectData
 QObjectData ()=default
 
virtual ~QObjectData ()=0
 
QMetaObjectdynamicMetaObject () const
 

Static Public Member Functions

static void data_append (QQmlListProperty< QObject > *prop, QObject *o)
 
static void data_clear (QQmlListProperty< QObject > *prop)
 
static QObjectdata_at (QQmlListProperty< QObject > *prop, qsizetype index)
 
static qsizetype data_count (QQmlListProperty< QObject > *prop)
 
static void data_replace (QQmlListProperty< QObject > *prop, qsizetype index, QObject *o)
 
static void data_removeLast (QQmlListProperty< QObject > *prop)
 
- Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
 
static QObjectPrivateget (QObject *o)
 
static const QObjectPrivateget (const QObject *o)
 
template<typename Func1 , typename Func2 >
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)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
 
static QMetaObject::Connection connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static bool disconnect (const QObject *sender, int signal_index, void **slot)
 
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot)
 

Public Attributes

QList< DataGuarddataList
 
- Public Attributes inherited from QObjectPrivate
ExtraDataextraData
 
QAtomicPointer< QThreadDatathreadData
 
QAtomicPointer< ConnectionDataconnections
 
union { 
 
   QObject *   currentChildBeingDeleted 
 
   QAbstractDeclarativeData *   declarativeData 
 
};  
 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
 
- Public Attributes inherited from QObjectData
QObjectq_ptr
 
QObjectparent
 
QObjectList children
 
uint isWidget: 1
 
uint blockSig: 1
 
uint wasDeleted: 1
 
uint isDeletingChildren: 1
 
uint sendChildEvents: 1
 
uint receiveChildEvents: 1
 
uint isWindow: 1
 
uint deleteLaterCalled: 1
 
uint isQuickItem: 1
 
uint willBeWidget: 1
 
uint wasWidget: 1
 
uint receiveParentEvents: 1
 
uint unused: 20
 
QAtomicInt postedEvents
 
QDynamicMetaObjectDatametaObject
 
QBindingStorage bindingStorage
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>
 

Detailed Description

\qmltype Package \instantiates QQuickPackage \inqmlmodule QtQml.Models

Specifies a collection of named items.

The Package type is used in conjunction with DelegateModel to enable delegates with a shared context to be provided to multiple views.

Any item within a Package may be assigned a name via the \l{Package::name}{Package.name} attached property.

The example below creates a Package containing two named items; list and grid. The third item in the package (the \l Rectangle) is parented to whichever delegate it should appear in. This allows an item to move between views.

Package {
Text { id: listDelegate; width: parent.width; height: 25; text: 'Empty'; Package.name: 'list' }
Text { id: gridDelegate; width: parent.width / 2; height: 50; text: 'Empty'; Package.name: 'grid' }
Rectangle {
id: wrapper
width: parent.width; height: 25
color: 'lightsteelblue'
Text { text: display; anchors.centerIn: parent }
state: root.upTo > index ? 'inGrid' : 'inList'
states: [
State {
name: 'inList'
ParentChange { target: wrapper; parent: listDelegate }
},
State {
name: 'inGrid'
ParentChange {
target: wrapper; parent: gridDelegate
x: 0; y: 0; width: gridDelegate.width; height: gridDelegate.height
}
}
]
transitions: [
Transition {
ParentAnimation {
NumberAnimation { properties: 'x,y,width,height'; duration: 300 }
}
}
]
}
}

These named items are used as the delegates by the two views who reference the special \l{DelegateModel::parts} property to select a model which provides the chosen delegate.

DelegateModel {
id: visualModel
delegate: Delegate {}
model: myModel
}
ListView {
id: lv
height: parent.height/2
width: parent.width
model: visualModel.parts.list
}
GridView {
y: parent.height/2
height: parent.height/2
width: parent.width
cellWidth: width / 2
cellHeight: 50
model: visualModel.parts.grid
}
Note
Package is part of QtQml.Models since version 2.14 and part of QtQuick since version 2.0. Importing Package via QtQuick is deprecated since Qt 5.14.
See also
{Qt Quick Examples - Views}, {Qt Qml}

\qmlattachedproperty string QtQml.Models::Package::name This attached property holds the name of an item within a Package.

Definition at line 50 of file qquickpackage.cpp.

Constructor & Destructor Documentation

◆ QQuickPackagePrivate()

QQuickPackagePrivate::QQuickPackagePrivate ( )
inline

Definition at line 53 of file qquickpackage.cpp.

Member Function Documentation

◆ data_append()

static void QQuickPackagePrivate::data_append ( QQmlListProperty< QObject > * prop,
QObject * o )
inlinestatic

Definition at line 69 of file qquickpackage.cpp.

References QList< T >::append(), list, and o.

+ Here is the call graph for this function:

◆ data_at()

static QObject * QQuickPackagePrivate::data_at ( QQmlListProperty< QObject > * prop,
qsizetype index )
inlinestatic

Definition at line 77 of file qquickpackage.cpp.

References QList< T >::at(), and list.

+ Here is the call graph for this function:

◆ data_clear()

static void QQuickPackagePrivate::data_clear ( QQmlListProperty< QObject > * prop)
inlinestatic

Definition at line 73 of file qquickpackage.cpp.

References QList< T >::clear(), and list.

+ Here is the call graph for this function:

◆ data_count()

static qsizetype QQuickPackagePrivate::data_count ( QQmlListProperty< QObject > * prop)
inlinestatic

Definition at line 81 of file qquickpackage.cpp.

References list, and QList< T >::size().

+ Here is the call graph for this function:

◆ data_removeLast()

static void QQuickPackagePrivate::data_removeLast ( QQmlListProperty< QObject > * prop)
inlinestatic

Definition at line 89 of file qquickpackage.cpp.

References list, and QList< T >::removeLast().

+ Here is the call graph for this function:

◆ data_replace()

static void QQuickPackagePrivate::data_replace ( QQmlListProperty< QObject > * prop,
qsizetype index,
QObject * o )
inlinestatic

Definition at line 85 of file qquickpackage.cpp.

References list, o, and QList< T >::replace().

+ Here is the call graph for this function:

Member Data Documentation

◆ dataList

QList<DataGuard> QQuickPackagePrivate::dataList

Definition at line 68 of file qquickpackage.cpp.


The documentation for this class was generated from the following file: