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
QDBusArgument Class Reference

\inmodule QtDBus More...

#include <qdbusargument.h>

+ Collaboration diagram for QDBusArgument:

Public Types

enum  ElementType {
  BasicType , VariantType , ArrayType , StructureType ,
  MapType , MapEntryType , UnknownType = -1
}
 

Public Member Functions

 QDBusArgument ()
 Constructs an empty QDBusArgument argument.
 
 QDBusArgument (const QDBusArgument &other)
 Constructs a copy of the other QDBusArgument object.
 
 QDBusArgument (QDBusArgument &&other) noexcept
 
QDBusArgumentoperator= (QDBusArgument &&other) noexcept
 
QDBusArgumentoperator= (const QDBusArgument &other)
 Copies the other QDBusArgument object into this one.
 
 ~QDBusArgument ()
 Disposes of the resources associated with this QDBusArgument object.
 
void swap (QDBusArgument &other) noexcept
 Swaps this QDBusArgument instance with other.
 
QDBusArgumentoperator<< (uchar arg)
 Appends the primitive value arg of type {BYTE} to the D-Bus stream.
 
QDBusArgumentoperator<< (bool arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {BOOLEAN} to the D-Bus stream.
 
QDBusArgumentoperator<< (short arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {INT16} to the D-Bus stream.
 
QDBusArgumentoperator<< (ushort arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {UINT16} to the D-Bus stream.
 
QDBusArgumentoperator<< (int arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {INT32} to the D-Bus stream.
 
QDBusArgumentoperator<< (uint arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {UINT32} to the D-Bus stream.
 
QDBusArgumentoperator<< (qlonglong arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {INT64} to the D-Bus stream.
 
QDBusArgumentoperator<< (qulonglong arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {UINT64} to the D-Bus stream.
 
QDBusArgumentoperator<< (double arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {DOUBLE} (double-precision floating-point) to the D-Bus stream.
 
QDBusArgumentoperator<< (const QString &arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {STRING} (Unicode character string) to the D-Bus stream.
 
QDBusArgumentoperator<< (const QDBusVariant &arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {VARIANT} to the D-Bus stream.
 
QDBusArgumentoperator<< (const QDBusObjectPath &arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
QDBusArgumentoperator<< (const QDBusSignature &arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
QDBusArgumentoperator<< (const QDBusUnixFileDescriptor &arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
QDBusArgumentoperator<< (const QStringList &arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the QStringList given by arg as {ARRAY of STRING} to the D-Bus stream.
 
QDBusArgumentoperator<< (const QByteArray &arg)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the QByteArray given by arg as {ARRAY of BYTE} to the D-Bus stream.
 
void beginStructure ()
 Opens a new D-Bus structure suitable for appending new arguments.
 
void endStructure ()
 Closes a D-Bus structure opened with beginStructure().
 
void beginArray (int elementMetaTypeId)
 
void beginArray (QMetaType elementMetaType)
 Opens a new D-Bus array suitable for appending elements of meta-type id.
 
void endArray ()
 Closes a D-Bus array opened with beginArray().
 
void beginMap (int keyMetaTypeId, int valueMetaTypeId)
 
void beginMap (QMetaType keyMetaType, QMetaType valueMetaType)
 Opens a new D-Bus map suitable for appending elements.
 
void endMap ()
 Closes a D-Bus map opened with beginMap().
 
void beginMapEntry ()
 Opens a D-Bus map entry suitable for appending the key and value entries.
 
void endMapEntry ()
 Closes a D-Bus map entry opened with beginMapEntry().
 
void appendVariant (const QVariant &v)
 
QString currentSignature () const
 
ElementType currentType () const
 
const QDBusArgumentoperator>> (uchar &arg) const
 Extracts one D-Bus primitive argument of type {BYTE} from the D-Bus stream and puts it into arg.
 
const QDBusArgumentoperator>> (bool &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {BOOLEAN} from the D-Bus stream.
 
const QDBusArgumentoperator>> (short &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {INT16} from the D-Bus stream.
 
const QDBusArgumentoperator>> (ushort &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {UINT16} from the D-Bus stream.
 
const QDBusArgumentoperator>> (int &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {INT32} from the D-Bus stream.
 
const QDBusArgumentoperator>> (uint &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {UINT32} from the D-Bus stream.
 
const QDBusArgumentoperator>> (qlonglong &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {INT64} from the D-Bus stream.
 
const QDBusArgumentoperator>> (qulonglong &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {UINT64} from the D-Bus stream.
 
const QDBusArgumentoperator>> (double &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {DOUBLE} (double-precision floating point) from the D-Bus stream.
 
const QDBusArgumentoperator>> (QString &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {STRING} (Unicode character string) from the D-Bus stream.
 
const QDBusArgumentoperator>> (QDBusVariant &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {VARIANT} from the D-Bus stream.
 
const QDBusArgumentoperator>> (QDBusObjectPath &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const QDBusArgumentoperator>> (QDBusSignature &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const QDBusArgumentoperator>> (QDBusUnixFileDescriptor &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const QDBusArgumentoperator>> (QStringList &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts an array of strings from the D-Bus stream and return it as a QStringList.
 
const QDBusArgumentoperator>> (QByteArray &arg) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts an array of bytes from the D-Bus stream and return it as a QByteArray.
 
void beginStructure () const
 Opens a D-Bus structure suitable for extracting elements.
 
void endStructure () const
 Closes the D-Bus structure and allow extracting of the next element after the structure.
 
void beginArray () const
 Recurses into the D-Bus array to allow extraction of the array elements.
 
void endArray () const
 Closes the D-Bus array and allow extracting of the next element after the array.
 
void beginMap () const
 Recurses into the D-Bus map to allow extraction of the map's elements.
 
void endMap () const
 Closes the D-Bus map and allow extracting of the next element after the map.
 
void beginMapEntry () const
 Recurses into the D-Bus map entry to allow extraction of the key and value pair.
 
void endMapEntry () const
 Closes the D-Bus map entry and allow extracting of the next element on the map.
 
bool atEnd () const
 Returns true if there are no more elements to be extracted from this QDBusArgument.
 
QVariant asVariant () const
 

Protected Member Functions

 QDBusArgument (QDBusArgumentPrivate *d)
 

Protected Attributes

QDBusArgumentPrivated
 

Friends

class QDBusArgumentPrivate
 

Related Symbols

(Note that these are not member symbols.)

template< typename T > T qdbus_cast (const QDBusArgument &arg)
 
template< typename T > QMetaType qDBusRegisterMetaType ()
 \threadsafe
 

Detailed Description

\inmodule QtDBus

Since
4.2

The QDBusArgument class is used to marshall and demarshall D-Bus arguments.

The class is used to send arguments over D-Bus to remote applications and to receive them back. D-Bus offers an extensible type system, based on a few primitive types and associations of them. See the \l {qdbustypesystem.html}{Qt D-Bus Type System} page for more information on the type system.

QDBusArgument is the central class in the Qt D-Bus type system, providing functions to marshall and demarshall the primitive types. The compound types are then created by association of one or more of the primitive types in arrays, dictionaries or structures.

The following example illustrates how a structure containing an integer and a string can be constructed using the \l {qdbustypesystem.html}{Qt D-Bus type system}:

{
int count;

\codeline

// ...
};
// Marshall the MyStructure data into a D-Bus argument
{
argument << myStruct.count << myStruct.name;
return argument;
}
// Retrieve the MyStructure data from the D-Bus argument
{
argument >> myStruct.count >> myStruct.name;
return argument;
}

The type has to be registered with qDBusRegisterMetaType() before it can be used with QDBusArgument. Therefore, somewhere in your program, you should add the following code:

Once registered, a type can be used in outgoing method calls (placed with QDBusAbstractInterface::call()), signal emissions from registered objects or in incoming calls from remote applications.

It is important to note that the {operator<<} and {operator>>} streaming functions must always produce the same number of entries in case of structures, both in reading and in writing (marshalling and demarshalling), otherwise calls and signals may start to silently fail.

The following example illustrates this wrong usage in context of a class that may contain invalid data:

//bad code
// Wrongly marshall the MyTime data into a D-Bus argument
{
if (mytime.isValid)
argument << true << mytime.hour
<< mytime.minute << mytime.second;
else
argument << false;
return argument;
}
\inmodule QtDBus
QDBusArgument & operator<<(uchar arg)
Appends the primitive value arg of type {BYTE} to the D-Bus stream.
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.
void endStructure()
Closes a D-Bus structure opened with beginStructure().
QDBusArgument argument

In this example, both the {operator<<} and the {operator>>} functions may produce a different number of reads/writes. This can confuse the Qt D-Bus type system and should be avoided.

See also
QDBusAbstractInterface, {qdbustypesystem.html}{The Qt D-Bus type system}, {usingadaptors.html}{Using Adaptors}, qdbus_cast()

Definition at line 28 of file qdbusargument.h.

Member Enumeration Documentation

◆ ElementType

Since
4.5

This enum describes the type of element held by the argument.

\value BasicType A basic element, which is understood by QVariant. The following types are considered basic: bool, byte, short, ushort, int, uint, qint64, quint64, double, QString, QByteArray, QDBusObjectPath, QDBusSignature

\value VariantType The variant element (QDBusVariant)

\value ArrayType An array element, usually represented by QList<T>. Note: QByteArray and associative maps are not considered arrays, even if the D-Bus protocol transports them as such.

\value StructureType A custom type represented by a structure, like QDateTime, QPoint, etc.

\value MapType An associative container, like QMap<Key, Value> or QHash<Key, Value>

\value MapEntryType One entry in an associative container: both the key and the value form one map-entry type.

\value UnknownType The type is unknown or we have reached the end of the list.

See also
currentType()
Enumerator
BasicType 
VariantType 
ArrayType 
StructureType 
MapType 
MapEntryType 
UnknownType 

Definition at line 31 of file qdbusargument.h.

Constructor & Destructor Documentation

◆ QDBusArgument() [1/4]

QDBusArgument::QDBusArgument ( )

Constructs an empty QDBusArgument argument.

An empty QDBusArgument object does not allow either reading or writing to be performed.

Definition at line 256 of file qdbusargument.cpp.

References d, DBUS_MESSAGE_TYPE_METHOD_CALL, QDBusMarshaller::iterator, QDBusArgumentPrivate::message, and qdbus_loadLibDBus().

+ Here is the call graph for this function:

◆ QDBusArgument() [2/4]

QDBusArgument::QDBusArgument ( const QDBusArgument & other)

Constructs a copy of the other QDBusArgument object.

Both objects will therefore contain the same state from this point forward. QDBusArguments are explicitly shared and, therefore, any modification to either copy will affect the other one too.

Definition at line 278 of file qdbusargument.cpp.

References d, QBasicAtomicInteger< T >::ref(), and QDBusArgumentPrivate::ref.

+ Here is the call graph for this function:

◆ QDBusArgument() [3/4]

QDBusArgument::QDBusArgument ( QDBusArgument && other)
inlinenoexcept

Definition at line 43 of file qdbusargument.h.

References other().

+ Here is the call graph for this function:

◆ ~QDBusArgument()

QDBusArgument::~QDBusArgument ( )

Disposes of the resources associated with this QDBusArgument object.

Definition at line 310 of file qdbusargument.cpp.

References d, QBasicAtomicInteger< T >::deref(), and QDBusArgumentPrivate::ref.

+ Here is the call graph for this function:

◆ QDBusArgument() [4/4]

QDBusArgument::QDBusArgument ( QDBusArgumentPrivate * dd)
protected

Definition at line 288 of file qdbusargument.cpp.

Member Function Documentation

◆ appendVariant()

void QDBusArgument::appendVariant ( const QVariant & v)
Since
4.5

Appends the variant v.

See also
asVariant()

Definition at line 525 of file qdbusargument.cpp.

References QDBusMarshaller::appendVariantInternal(), QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ asVariant()

QVariant QDBusArgument::asVariant ( ) const
Since
4.5

Returns the current argument in the form of a QVariant. Basic types will be decoded and returned in the QVariant, but for complex types, this function will return a QDBusArgument object in the QVariant. It is the caller's responsibility to decode the argument (for example, by calling asVariant() in it).

For example, if the current argument is an INT32, this function will return a QVariant with an argument of type QMetaType::Int. For an array of INT32, it will return a QVariant containing a QDBusArgument.

If an error occurs or if there are no more arguments to decode (i.e., we are at the end of the argument list), this function will return an invalid QVariant.

See also
atEnd()

Definition at line 1085 of file qdbusargument.cpp.

References QDBusArgumentPrivate::checkRead(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toVariantInternal().

+ Here is the call graph for this function:

◆ atEnd()

bool QDBusArgument::atEnd ( ) const

Returns true if there are no more elements to be extracted from this QDBusArgument.

This function is usually used in QDBusArgument objects returned from beginMap() and beginArray().

Definition at line 1057 of file qdbusargument.cpp.

References QDBusDemarshaller::atEnd(), QDBusArgumentPrivate::checkRead(), d, and QDBusArgumentPrivate::demarshaller().

Referenced by QIBusSerializable::deserializeFrom(), QDBusSnippets::operator>>(), QDBusSnippets::operator>>(), operator>>(), QtWaylandClient::operator>>(), operator>>(), and operator>>().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beginArray() [1/3]

void QDBusArgument::beginArray ( ) const

Recurses into the D-Bus array to allow extraction of the array elements.

This function is used usually in {operator>>} streaming operators, as in the following example:

// Extract a MyArray array of MyElement elements
{
myArray.clear();
while (!argument.atEnd()) {
MyElement element;
argument >> element;
myArray.append(element);
}
return argument;
}

If the type you want to demarshall is a QList or any of the Qt's \l {Container Classes} that take one template parameter, you need not declare an {operator>>} function for it, since Qt D-Bus provides generic templates to do the job of demarshalling the data. The same applies for STL's sequence containers, such as {std::list}, {std::vector}, etc.

See also
atEnd(), beginStructure(), beginMap()

Definition at line 975 of file qdbusargument.cpp.

References QDBusDemarshaller::beginArray(), QDBusArgumentPrivate::checkReadAndDetach(), d, and QDBusArgumentPrivate::demarshaller().

+ Here is the call graph for this function:

◆ beginArray() [2/3]

void QDBusArgument::beginArray ( int elementMetaTypeId)
inline

Definition at line 70 of file qdbusargument.h.

Referenced by QDBusSnippets::operator<<(), operator<<(), QDBusSnippets::operator>>(), operator>>(), and QIBusAttributeList::serializeTo().

+ Here is the caller graph for this function:

◆ beginArray() [3/3]

void QDBusArgument::beginArray ( QMetaType id)

Opens a new D-Bus array suitable for appending elements of meta-type id.

This function is used usually in {operator<<} streaming operators, as in the following example:

// Append an array of MyElement types
{
argument.beginArray(qMetaTypeId<MyElement>());
for (const auto &element : myArray)
argument << element;
return argument;
}

If the type you want to marshall is a QList or any of the Qt's \l {Container Classes} that take one template parameter, you need not declare an {operator<<} function for it, since Qt D-Bus provides generic templates to do the job of marshalling the data. The same applies for STL's sequence containers, such as {std::list}, {std::vector}, etc.

See also
endArray(), beginStructure(), beginMap()

Definition at line 847 of file qdbusargument.cpp.

References QDBusMarshaller::beginArray(), QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ beginMap() [1/3]

void QDBusArgument::beginMap ( ) const

Recurses into the D-Bus map to allow extraction of the map's elements.

This function is used usually in {operator>>} streaming operators, as in the following example:

// Extract a MyDictionary map that associates integers to MyElement items
{
myDict.clear();
while (!argument.atEnd()) {
int key;
myDict.insert(key, value);
}
return argument;
}

If the type you want to demarshall is a QMap or QHash, you need not declare an {operator>>} function for it, since Qt D-Bus provides generic templates to do the job of demarshalling the data.

See also
endMap(), beginStructure(), beginArray(), beginMapEntry()

Definition at line 1008 of file qdbusargument.cpp.

References QDBusDemarshaller::beginMap(), QDBusArgumentPrivate::checkReadAndDetach(), d, and QDBusArgumentPrivate::demarshaller().

+ Here is the call graph for this function:

◆ beginMap() [2/3]

void QDBusArgument::beginMap ( int keyMetaTypeId,
int valueMetaTypeId )
inline

Definition at line 74 of file qdbusargument.h.

Referenced by QIBusSerializable::deserializeFrom(), QDBusSnippets::operator<<(), QDBusSnippets::operator>>(), operator>>(), QtWaylandClient::operator>>(), operator>>(), and QIBusSerializable::serializeTo().

+ Here is the caller graph for this function:

◆ beginMap() [3/3]

void QDBusArgument::beginMap ( QMetaType keyMetaType,
QMetaType valueMetaType )

Opens a new D-Bus map suitable for appending elements.

Maps are containers that associate one entry (the key) to another (the value), such as Qt's QMap or QHash. The ids of the map's key and value meta types must be passed in keyMetaType and valueMetaType respectively.

This function is used usually in {operator<<} streaming operators, as in the following example:

// Append a dictionary that associates ints to MyValue types
{
argument.beginMap(QMetaType::fromType<int>(), QMetaType::fromType<MyValue>());
MyDictionary::const_iterator i;
for (i = myDict.cbegin(); i != myDict.cend(); ++i) {
argument << i.key() << i.value();
}
return argument;
}

You usually don't need to provide an {operator<<} or {operator>>} function for associative containers such as QHash or std::map, since Qt D-Bus provides generic templates to do the job of marshalling the data.

See also
endMap(), beginStructure(), beginArray(), beginMapEntry()

Definition at line 884 of file qdbusargument.cpp.

References QDBusMarshaller::beginMap(), QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ beginMapEntry() [1/2]

void QDBusArgument::beginMapEntry ( )

Opens a D-Bus map entry suitable for appending the key and value entries.

This function is only valid when a map has been opened with beginMap().

See beginMap() for an example of usage of this function.

See also
endMapEntry(), beginMap()

Definition at line 911 of file qdbusargument.cpp.

References QDBusMarshaller::beginMapEntry(), QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

Referenced by QIBusSerializable::deserializeFrom(), QDBusSnippets::operator<<(), QDBusSnippets::operator>>(), operator>>(), QtWaylandClient::operator>>(), operator>>(), and QIBusSerializable::serializeTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beginMapEntry() [2/2]

void QDBusArgument::beginMapEntry ( ) const

Recurses into the D-Bus map entry to allow extraction of the key and value pair.

See beginMap() for an example of how this function is usually used.

See also
endMapEntry(), beginMap()

Definition at line 1034 of file qdbusargument.cpp.

References QDBusDemarshaller::beginMapEntry(), QDBusArgumentPrivate::checkReadAndDetach(), d, and QDBusArgumentPrivate::demarshaller().

+ Here is the call graph for this function:

◆ beginStructure() [1/2]

void QDBusArgument::beginStructure ( )

Opens a new D-Bus structure suitable for appending new arguments.

This function is used usually in {operator<<} streaming operators, as in the following example:

{
argument << myStruct.member1 << myStruct.member2;
return argument;
}

Structures can contain other structures, so the following code is also valid:

{
argument << myStruct.member1 << myStruct.member2;
argument << myStruct.member3.subMember1 << myStruct.member3.subMember2;
argument << myStruct.member4;
return argument;
}
See also
endStructure(), beginArray(), beginMap()

Definition at line 812 of file qdbusargument.cpp.

References QDBusMarshaller::beginStructure(), QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

Referenced by QIBusAttribute::deserializeFrom(), QIBusText::deserializeFrom(), QIBusEngineDesc::deserializeFrom(), QIBusPropTypeClientCommitPreedit::deserializeFrom(), QIBusPropTypeContentType::deserializeFrom(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), operator<<(), QDBusSnippets::operator<<(), QDBusSnippets::Alt::operator<<(), operator<<(), operator<<(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), operator>>(), QDBusSnippets::operator>>(), operator>>(), operator>>(), QIBusAttribute::serializeTo(), QIBusAttributeList::serializeTo(), QIBusText::serializeTo(), QIBusEngineDesc::serializeTo(), QIBusPropTypeClientCommitPreedit::serializeTo(), and QIBusPropTypeContentType::serializeTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beginStructure() [2/2]

void QDBusArgument::beginStructure ( ) const

Opens a D-Bus structure suitable for extracting elements.

This function is used usually in {operator>>} streaming operators, as in the following example:

{
argument >> myStruct.member1 >> myStruct.member2 >> myStruct.member3;
return argument;
}
See also
endStructure(), beginArray(), beginMap()

Definition at line 939 of file qdbusargument.cpp.

References QDBusDemarshaller::beginStructure(), QDBusArgumentPrivate::checkReadAndDetach(), d, and QDBusArgumentPrivate::demarshaller().

+ Here is the call graph for this function:

◆ currentSignature()

QString QDBusArgument::currentSignature ( ) const

Returns the type signature of the D-Bus type this QDBusArgument object is currently pointing to.

Definition at line 536 of file qdbusargument.cpp.

References QDBusMarshaller::currentSignature(), QDBusDemarshaller::currentSignature(), d, QDBusArgumentPrivate::demarshaller(), QDBusArgumentPrivate::Demarshalling, QDBusArgumentPrivate::direction, and QDBusArgumentPrivate::marshaller().

Referenced by QIBusText::deserializeFrom(), and QIBusEngineDesc::deserializeFrom().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ currentType()

QDBusArgument::ElementType QDBusArgument::currentType ( ) const
Since
4.5 Returns the classification of the current element type. If an error decoding the type occurs or if we're at the end of the argument, this function returns QDBusArgument::UnknownType.

This function only makes sense when demarshalling arguments. If it is used while marshalling, it will always return UnknownType.

Definition at line 555 of file qdbusargument.cpp.

References QDBusDemarshaller::currentType(), d, QDBusArgumentPrivate::demarshaller(), QDBusArgumentPrivate::Demarshalling, QDBusArgumentPrivate::direction, and UnknownType.

+ Here is the call graph for this function:

◆ endArray() [1/2]

void QDBusArgument::endArray ( )

Closes a D-Bus array opened with beginArray().

This function must be called same number of times that beginArray() is called.

See also
beginArray(), endStructure(), endMap()

Definition at line 859 of file qdbusargument.cpp.

References QDBusArgumentPrivate::checkWrite(), d, QDBusMarshaller::endArray(), and QDBusArgumentPrivate::marshaller().

Referenced by QDBusSnippets::operator<<(), operator<<(), QDBusSnippets::operator>>(), operator>>(), and QIBusAttributeList::serializeTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ endArray() [2/2]

void QDBusArgument::endArray ( ) const

Closes the D-Bus array and allow extracting of the next element after the array.

See also
beginArray()

Definition at line 987 of file qdbusargument.cpp.

References QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::endArray().

+ Here is the call graph for this function:

◆ endMap() [1/2]

void QDBusArgument::endMap ( )

Closes a D-Bus map opened with beginMap().

This function must be called same number of times that beginMap() is called.

See also
beginMap(), endStructure(), endArray()

Definition at line 896 of file qdbusargument.cpp.

References QDBusArgumentPrivate::checkWrite(), d, QDBusMarshaller::endMap(), and QDBusArgumentPrivate::marshaller().

Referenced by QIBusSerializable::deserializeFrom(), QDBusSnippets::operator<<(), QDBusSnippets::operator>>(), operator>>(), QtWaylandClient::operator>>(), operator>>(), and QIBusSerializable::serializeTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ endMap() [2/2]

void QDBusArgument::endMap ( ) const

Closes the D-Bus map and allow extracting of the next element after the map.

See also
beginMap()

Definition at line 1020 of file qdbusargument.cpp.

References QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::endMap().

+ Here is the call graph for this function:

◆ endMapEntry() [1/2]

void QDBusArgument::endMapEntry ( )

Closes a D-Bus map entry opened with beginMapEntry().

This function must be called same number of times that beginMapEntry() is called.

See also
beginMapEntry()

Definition at line 923 of file qdbusargument.cpp.

References QDBusArgumentPrivate::checkWrite(), d, QDBusMarshaller::endMapEntry(), and QDBusArgumentPrivate::marshaller().

Referenced by QIBusSerializable::deserializeFrom(), QDBusSnippets::operator<<(), QDBusSnippets::operator>>(), operator>>(), QtWaylandClient::operator>>(), operator>>(), and QIBusSerializable::serializeTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ endMapEntry() [2/2]

void QDBusArgument::endMapEntry ( ) const

Closes the D-Bus map entry and allow extracting of the next element on the map.

See also
beginMapEntry()

Definition at line 1046 of file qdbusargument.cpp.

References QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::endMapEntry().

+ Here is the call graph for this function:

◆ endStructure() [1/2]

void QDBusArgument::endStructure ( )

Closes a D-Bus structure opened with beginStructure().

This function must be called same number of times that beginStructure() is called.

See also
beginStructure(), endArray(), endMap()

Definition at line 824 of file qdbusargument.cpp.

References QDBusArgumentPrivate::checkWrite(), d, QDBusMarshaller::endStructure(), and QDBusArgumentPrivate::marshaller().

Referenced by QIBusAttribute::deserializeFrom(), QIBusText::deserializeFrom(), QIBusEngineDesc::deserializeFrom(), QIBusPropTypeClientCommitPreedit::deserializeFrom(), QIBusPropTypeContentType::deserializeFrom(), operator<<(), QDBusSnippets::operator<<(), QDBusSnippets::Alt::operator<<(), operator<<(), operator<<(), operator>>(), QDBusSnippets::operator>>(), operator>>(), operator>>(), QIBusAttribute::serializeTo(), QIBusAttributeList::serializeTo(), QIBusText::serializeTo(), QIBusEngineDesc::serializeTo(), QIBusPropTypeClientCommitPreedit::serializeTo(), and QIBusPropTypeContentType::serializeTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ endStructure() [2/2]

void QDBusArgument::endStructure ( ) const

Closes the D-Bus structure and allow extracting of the next element after the structure.

See also
beginStructure()

Definition at line 951 of file qdbusargument.cpp.

References QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::endStructure().

+ Here is the call graph for this function:

◆ operator<<() [1/16]

QDBusArgument & QDBusArgument::operator<< ( bool arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {BOOLEAN} to the D-Bus stream.

Definition at line 330 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [2/16]

QDBusArgument & QDBusArgument::operator<< ( const QByteArray & arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the QByteArray given by arg as {ARRAY of BYTE} to the D-Bus stream.

QStringList and QByteArray are the only two non-primitive types that are supported directly by QDBusArgument because of their widespread usage in Qt applications.

Other arrays are supported through compound types in Qt D-Bus.

Definition at line 510 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [3/16]

QDBusArgument & QDBusArgument::operator<< ( const QDBusObjectPath & arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Appends the primitive value arg of type {OBJECT_PATH} (path to a D-Bus object) to the D-Bus stream.

Definition at line 433 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [4/16]

QDBusArgument & QDBusArgument::operator<< ( const QDBusSignature & arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Appends the primitive value arg of type {SIGNATURE} (D-Bus type signature) to the D-Bus stream.

Definition at line 446 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [5/16]

QDBusArgument & QDBusArgument::operator<< ( const QDBusUnixFileDescriptor & arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
4.8

Appends the primitive value arg of type {UNIX_FILE_DESCRIPTOR} (Unix File Descriptor) to the D-Bus stream.

Definition at line 460 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [6/16]

QDBusArgument & QDBusArgument::operator<< ( const QDBusVariant & arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {VARIANT} to the D-Bus stream.

A D-Bus variant type can contain any type, including other variants. It is similar to the Qt QVariant type.

Definition at line 474 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [7/16]

QDBusArgument & QDBusArgument::operator<< ( const QString & arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {STRING} (Unicode character string) to the D-Bus stream.

Definition at line 420 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [8/16]

QDBusArgument & QDBusArgument::operator<< ( const QStringList & arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the QStringList given by arg as {ARRAY of STRING} to the D-Bus stream.

QStringList and QByteArray are the only two non-primitive types that are supported directly by QDBusArgument because of their widespread usage in Qt applications.

Other arrays are supported through compound types in Qt D-Bus.

Definition at line 492 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [9/16]

QDBusArgument & QDBusArgument::operator<< ( double arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {DOUBLE} (double-precision floating-point) to the D-Bus stream.

Definition at line 408 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [10/16]

QDBusArgument & QDBusArgument::operator<< ( int arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {INT32} to the D-Bus stream.

Definition at line 363 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [11/16]

QDBusArgument & QDBusArgument::operator<< ( qlonglong arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {INT64} to the D-Bus stream.

Definition at line 385 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [12/16]

QDBusArgument & QDBusArgument::operator<< ( qulonglong arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {UINT64} to the D-Bus stream.

Definition at line 396 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [13/16]

QDBusArgument & QDBusArgument::operator<< ( short arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {INT16} to the D-Bus stream.

Definition at line 341 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [14/16]

QDBusArgument & QDBusArgument::operator<< ( uchar arg)

Appends the primitive value arg of type {BYTE} to the D-Bus stream.

Definition at line 319 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [15/16]

QDBusArgument & QDBusArgument::operator<< ( uint arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {UINT32} to the D-Bus stream.

Definition at line 374 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator<<() [16/16]

QDBusArgument & QDBusArgument::operator<< ( ushort arg)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends the primitive value arg of type {UINT16} to the D-Bus stream.

Definition at line 352 of file qdbusargument.cpp.

References QDBusMarshaller::append(), arg, QDBusArgumentPrivate::checkWrite(), d, and QDBusArgumentPrivate::marshaller().

+ Here is the call graph for this function:

◆ operator=() [1/2]

QDBusArgument & QDBusArgument::operator= ( const QDBusArgument & other)

Copies the other QDBusArgument object into this one.

Both objects will therefore contain the same state from this point forward. QDBusArguments are explicitly shared and, therefore, any modification to either copy will affect the other one too.

Definition at line 300 of file qdbusargument.cpp.

References d, other(), and qAtomicAssign().

+ Here is the call graph for this function:

◆ operator=() [2/2]

QDBusArgument & QDBusArgument::operator= ( QDBusArgument && other)
inlinenoexcept

Definition at line 44 of file qdbusargument.h.

References other(), and swap().

+ Here is the call graph for this function:

◆ operator>>() [1/16]

const QDBusArgument & QDBusArgument::operator>> ( bool & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {BOOLEAN} from the D-Bus stream.

Definition at line 582 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toBool().

+ Here is the call graph for this function:

◆ operator>>() [2/16]

const QDBusArgument & QDBusArgument::operator>> ( double & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {DOUBLE} (double-precision floating point) from the D-Bus stream.

Definition at line 680 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toDouble().

+ Here is the call graph for this function:

◆ operator>>() [3/16]

const QDBusArgument & QDBusArgument::operator>> ( int & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {INT32} from the D-Bus stream.

Definition at line 624 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toInt().

+ Here is the call graph for this function:

◆ operator>>() [4/16]

const QDBusArgument & QDBusArgument::operator>> ( QByteArray & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts an array of bytes from the D-Bus stream and return it as a QByteArray.

QStringList and QByteArray are the only two non-primitive types that are supported directly by QDBusArgument because of their widespread usage in Qt applications.

Other arrays are supported through compound types in Qt D-Bus.

Definition at line 790 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toByteArray().

+ Here is the call graph for this function:

◆ operator>>() [5/16]

const QDBusArgument & QDBusArgument::operator>> ( QDBusObjectPath & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Extracts one D-Bus primitive argument of type {OBJECT_PATH} (D-Bus path to an object) from the D-Bus stream.

Definition at line 707 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toObjectPath().

+ Here is the call graph for this function:

◆ operator>>() [6/16]

const QDBusArgument & QDBusArgument::operator>> ( QDBusSignature & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Extracts one D-Bus primitive argument of type {SIGNATURE} (D-Bus type signature) from the D-Bus stream.

Definition at line 720 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toSignature().

+ Here is the call graph for this function:

◆ operator>>() [7/16]

const QDBusArgument & QDBusArgument::operator>> ( QDBusUnixFileDescriptor & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
4.8

Extracts one D-Bus primitive argument of type {UNIX_FILE_DESCRIPTOR} (Unix file descriptor) from the D-Bus stream.

Definition at line 734 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toUnixFileDescriptor().

+ Here is the call graph for this function:

◆ operator>>() [8/16]

const QDBusArgument & QDBusArgument::operator>> ( QDBusVariant & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {VARIANT} from the D-Bus stream.

A D-Bus variant type can contain any type, including other variants. It is similar to the Qt QVariant type.

In case the variant contains a type not directly supported by QDBusArgument, the value of the returned QDBusVariant will contain another QDBusArgument. It is your responsibility to further demarshall it into another type.

Definition at line 754 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toVariant().

+ Here is the call graph for this function:

◆ operator>>() [9/16]

const QDBusArgument & QDBusArgument::operator>> ( qlonglong & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {INT64} from the D-Bus stream.

Definition at line 652 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toLongLong().

+ Here is the call graph for this function:

◆ operator>>() [10/16]

const QDBusArgument & QDBusArgument::operator>> ( QString & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {STRING} (Unicode character string) from the D-Bus stream.

Definition at line 694 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toString().

+ Here is the call graph for this function:

◆ operator>>() [11/16]

const QDBusArgument & QDBusArgument::operator>> ( QStringList & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts an array of strings from the D-Bus stream and return it as a QStringList.

QStringList and QByteArray are the only two non-primitive types that are supported directly by QDBusArgument because of their widespread usage in Qt applications.

Other arrays are supported through compound types in Qt D-Bus.

Definition at line 772 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toStringList().

+ Here is the call graph for this function:

◆ operator>>() [12/16]

const QDBusArgument & QDBusArgument::operator>> ( qulonglong & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {UINT64} from the D-Bus stream.

Definition at line 666 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toULongLong().

+ Here is the call graph for this function:

◆ operator>>() [13/16]

const QDBusArgument & QDBusArgument::operator>> ( short & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {INT16} from the D-Bus stream.

Definition at line 610 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toShort().

+ Here is the call graph for this function:

◆ operator>>() [14/16]

const QDBusArgument & QDBusArgument::operator>> ( uchar & arg) const

Extracts one D-Bus primitive argument of type {BYTE} from the D-Bus stream and puts it into arg.

Definition at line 568 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toByte().

+ Here is the call graph for this function:

◆ operator>>() [15/16]

const QDBusArgument & QDBusArgument::operator>> ( uint & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {UINT32} from the D-Bus stream.

Definition at line 638 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toUInt().

+ Here is the call graph for this function:

◆ operator>>() [16/16]

const QDBusArgument & QDBusArgument::operator>> ( ushort & arg) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Extracts one D-Bus primitive argument of type {UINT16} from the D-Bus stream.

Definition at line 596 of file qdbusargument.cpp.

References arg, QDBusArgumentPrivate::checkReadAndDetach(), d, QDBusArgumentPrivate::demarshaller(), and QDBusDemarshaller::toUShort().

+ Here is the call graph for this function:

◆ swap()

void QDBusArgument::swap ( QDBusArgument & other)
inlinenoexcept

Swaps this QDBusArgument instance with other.

Definition at line 48 of file qdbusargument.h.

References d, other(), and qt_ptr_swap().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ qdbus_cast()

template< typename T > T qdbus_cast ( const QDBusArgument & arg)
related
Since
4.2

Attempts to demarshall the contents of arg into the type {T}. For example:

Note that it is equivalent to the following:

Definition at line 127 of file qdbusargument.h.

References arg, and item.

◆ QDBusArgumentPrivate

friend class QDBusArgumentPrivate
friend

Definition at line 118 of file qdbusargument.h.

◆ qDBusRegisterMetaType()

template< typename T > QMetaType qDBusRegisterMetaType ( )
related

\threadsafe

Since
4.2

Registers {T} with the \l {qdbustypesystem.html}{Qt D-Bus Type System} and the Qt \l {QMetaType}{meta-type system}, if it's not already registered.

To register a type, it must be declared as a meta-type with the Q_DECLARE_METATYPE() macro, and then registered as in the following example:

\codeline

If {T} isn't one of Qt's \l{container classes}, the {operator<<} and {operator>>} streaming operators between {T} and QDBusArgument must be already declared. See the \l {qdbustypesystem.html}{Qt D-Bus Type System} page for more information on how to declare such types.

This function returns the Qt meta type id for the type (the same value that is returned from qRegisterMetaType()).

Note
The feature that a {T} inheriting a streamable type (including the containers QList, QHash or QMap) can be streamed without providing custom {operator<<} and {operator>>} is deprecated as of Qt 5.7, because it ignores everything in {T} except the base class. There is no diagnostic. You should always provide these operators for all types you wish to stream and not rely on Qt-provided stream operators for base classes.
See also
{qdbustypesystem.html}{Qt D-Bus Type System}, qRegisterMetaType(), QMetaType

Definition at line 33 of file qdbusmetatype.h.

References arg, and QDBusMetaType::registerMarshallOperators().

+ Here is the call graph for this function:

Member Data Documentation

◆ d


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