QQmlListReference¶
The QQmlListReference
class allows the manipulation of QQmlListProperty
properties. More…

Synopsis¶
Functions¶
def
__eq__
(other)def
append
(arg__1)def
at
(arg__1)def
canAppend
()def
canAt
()def
canClear
()def
canCount
()def
canRemoveLast
()def
canReplace
()def
clear
()def
count
()def
isManipulable
()def
isReadable
()def
isValid
()def
listElementType
()def
object
()def
removeLast
()def
replace
(arg__1, arg__2)
Detailed Description¶
QQmlListReference
allows C++ programs to read from, and assign values to a QML list property in a simple and type-safe way. A QQmlListReference
can be created by passing an object and property name or through a QQmlProperty
instance. These two are equivalent:
QQmlListReference ref1(object, "children"); QQmlProperty ref2(object, "children"); QQmlListReference ref2 = qvariant_cast<QQmlListReference>(ref2.read());
Not all QML list properties support all operations. A set of methods, , , and allow programs to query whether an operation is supported on a given property.
QML list properties are type-safe. Only QObject
‘s that derive from the correct base class can be assigned to the list. The method can be used to query the QMetaObject
of the QObject
type supported. Attempting to add objects of the incorrect type to a list property will fail.
Like with normal lists, when accessing a list element by index, it is the callers responsibility to ensure that it does not request an out of range element using the method before calling .
-
class
PySide6.QtQml.
QQmlListReference
¶ PySide6.QtQml.QQmlListReference(arg__1, property[, arg__3=None])
PySide6.QtQml.QQmlListReference(arg__1)
- Parameters
arg__3 –
PySide6.QtQml.QQmlEngine
property – str
arg__1 –
PySide6.QtCore.QObject
-
PySide6.QtQml.QQmlListReference.
append
(arg__1)¶ - Parameters
arg__1 –
PySide6.QtCore.QObject
- Return type
bool
-
PySide6.QtQml.QQmlListReference.
at
(arg__1)¶ - Parameters
arg__1 –
qsizetype
- Return type
-
PySide6.QtQml.QQmlListReference.
canAppend
()¶ - Return type
bool
-
PySide6.QtQml.QQmlListReference.
canAt
()¶ - Return type
bool
-
PySide6.QtQml.QQmlListReference.
canClear
()¶ - Return type
bool
-
PySide6.QtQml.QQmlListReference.
canCount
()¶ - Return type
bool
-
PySide6.QtQml.QQmlListReference.
canRemoveLast
()¶ - Return type
bool
-
PySide6.QtQml.QQmlListReference.
canReplace
()¶ - Return type
bool
-
PySide6.QtQml.QQmlListReference.
clear
()¶ - Return type
bool
-
PySide6.QtQml.QQmlListReference.
count
()¶ - Return type
qsizetype
-
PySide6.QtQml.QQmlListReference.
isManipulable
()¶ - Return type
bool
-
PySide6.QtQml.QQmlListReference.
isReadable
()¶ - Return type
bool
-
PySide6.QtQml.QQmlListReference.
isValid
()¶ - Return type
bool
-
PySide6.QtQml.QQmlListReference.
listElementType
()¶ - Return type
-
PySide6.QtQml.QQmlListReference.
object
()¶ - Return type
-
PySide6.QtQml.QQmlListReference.
__eq__
(other)¶ - Parameters
other –
PySide6.QtQml.QQmlListReference
- Return type
bool
-
PySide6.QtQml.QQmlListReference.
removeLast
()¶ - Return type
bool
-
PySide6.QtQml.QQmlListReference.
replace
(arg__1, arg__2)¶ - Parameters
arg__1 –
qsizetype
arg__2 –
PySide6.QtCore.QObject
- Return type
bool
© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.