Qt 4.8
Classes | Functions
qdbusargument.h File Reference
#include <QtCore/qbytearray.h>
#include <QtCore/qhash.h>
#include <QtCore/qglobal.h>
#include <QtCore/qlist.h>
#include <QtCore/qmap.h>
#include <QtCore/qstring.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qvariant.h>
#include <QtDBus/qdbusextratypes.h>
#include <QtDBus/qdbusmacros.h>

Go to the source code of this file.

Classes

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

Functions

Q_DBUS_EXPORT QDBusArgumentoperator<< (QDBusArgument &a, const QDate &date)
 
Q_DBUS_EXPORT QDBusArgumentoperator<< (QDBusArgument &a, const QTime &time)
 
Q_DBUS_EXPORT QDBusArgumentoperator<< (QDBusArgument &a, const QDateTime &dt)
 
Q_DBUS_EXPORT QDBusArgumentoperator<< (QDBusArgument &a, const QRect &rect)
 
Q_DBUS_EXPORT QDBusArgumentoperator<< (QDBusArgument &a, const QRectF &rect)
 
Q_DBUS_EXPORT QDBusArgumentoperator<< (QDBusArgument &a, const QSize &size)
 
Q_DBUS_EXPORT QDBusArgumentoperator<< (QDBusArgument &a, const QSizeF &size)
 
Q_DBUS_EXPORT QDBusArgumentoperator<< (QDBusArgument &a, const QPoint &pt)
 
Q_DBUS_EXPORT QDBusArgumentoperator<< (QDBusArgument &a, const QPointF &pt)
 
Q_DBUS_EXPORT QDBusArgumentoperator<< (QDBusArgument &a, const QLine &line)
 
Q_DBUS_EXPORT QDBusArgumentoperator<< (QDBusArgument &a, const QLineF &line)
 
template<template< typename > class Container, typename T >
QDBusArgumentoperator<< (QDBusArgument &arg, const Container< T > &list)
 
template<typename T >
QDBusArgumentoperator<< (QDBusArgument &arg, const QList< T > &list)
 
QDBusArgumentoperator<< (QDBusArgument &arg, const QVariantList &list)
 
template<typename Key , typename T >
QDBusArgumentoperator<< (QDBusArgument &arg, const QMap< Key, T > &map)
 
QDBusArgumentoperator<< (QDBusArgument &arg, const QVariantMap &map)
 
template<typename Key , typename T >
QDBusArgumentoperator<< (QDBusArgument &arg, const QHash< Key, T > &map)
 
QDBusArgumentoperator<< (QDBusArgument &arg, const QVariantHash &map)
 
Q_DBUS_EXPORT const QDBusArgumentoperator>> (const QDBusArgument &a, QVariant &v)
 
Q_DBUS_EXPORT const QDBusArgumentoperator>> (const QDBusArgument &a, QDate &date)
 
Q_DBUS_EXPORT const QDBusArgumentoperator>> (const QDBusArgument &a, QTime &time)
 
Q_DBUS_EXPORT const QDBusArgumentoperator>> (const QDBusArgument &a, QDateTime &dt)
 
Q_DBUS_EXPORT const QDBusArgumentoperator>> (const QDBusArgument &a, QRect &rect)
 
Q_DBUS_EXPORT const QDBusArgumentoperator>> (const QDBusArgument &a, QRectF &rect)
 
Q_DBUS_EXPORT const QDBusArgumentoperator>> (const QDBusArgument &a, QSize &size)
 
Q_DBUS_EXPORT const QDBusArgumentoperator>> (const QDBusArgument &a, QSizeF &size)
 
Q_DBUS_EXPORT const QDBusArgumentoperator>> (const QDBusArgument &a, QPoint &pt)
 
Q_DBUS_EXPORT const QDBusArgumentoperator>> (const QDBusArgument &a, QPointF &pt)
 
Q_DBUS_EXPORT const QDBusArgumentoperator>> (const QDBusArgument &a, QLine &line)
 
Q_DBUS_EXPORT const QDBusArgumentoperator>> (const QDBusArgument &a, QLineF &line)
 
template<template< typename > class Container, typename T >
const QDBusArgumentoperator>> (const QDBusArgument &arg, Container< T > &list)
 
template<typename T >
const QDBusArgumentoperator>> (const QDBusArgument &arg, QList< T > &list)
 
template<typename Key , typename T >
const QDBusArgumentoperator>> (const QDBusArgument &arg, QMap< Key, T > &map)
 
template<typename Key , typename T >
const QDBusArgumentoperator>> (const QDBusArgument &arg, QHash< Key, T > &map)
 
template<typename T >
qdbus_cast (const QDBusArgument &arg)
 
template<typename T >
qdbus_cast (const QVariant &v)
 
template<>
QVariant qdbus_cast< QVariant > (const QDBusArgument &arg, QVariant *)
 
template<>
QVariant qdbus_cast< QVariant > (const QVariant &v, QVariant *)
 

Function Documentation

◆ operator<<() [1/18]

Q_DBUS_EXPORT QDBusArgument& operator<< ( QDBusArgument a,
const QDate date 
)

Definition at line 1253 of file qdbusargument.cpp.

Referenced by qdbus_cast< QVariant >().

1254 {
1255  a.beginStructure();
1256  if (date.isValid())
1257  a << date.year() << date.month() << date.day();
1258  else
1259  a << 0 << 0 << 0;
1260  a.endStructure();
1261  return a;
1262 }
bool isValid() const
Returns true if this date is valid; otherwise returns false.
Definition: qdatetime.cpp:340
int month() const
Returns the number corresponding to the month of this date, using the following convention: ...
Definition: qdatetime.cpp:382
int day() const
Returns the day of the month (1 to 31) of this date.
Definition: qdatetime.cpp:395
long ASN1_INTEGER_get ASN1_INTEGER * a
void endStructure()
Closes a D-Bus structure opened with beginStructure().
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.
int year() const
Returns the year of this date.
Definition: qdatetime.cpp:353

◆ operator<<() [2/18]

Q_DBUS_EXPORT QDBusArgument& operator<< ( QDBusArgument a,
const QTime time 
)

Definition at line 1278 of file qdbusargument.cpp.

1279 {
1280  a.beginStructure();
1281  if (time.isValid())
1282  a << time.hour() << time.minute() << time.second() << time.msec();
1283  else
1284  a << -1 << -1 << -1 << -1;
1285  a.endStructure();
1286  return a;
1287 }
int msec() const
Returns the millisecond part (0 to 999) of the time.
Definition: qdatetime.cpp:1611
long ASN1_INTEGER_get ASN1_INTEGER * a
int second() const
Returns the second part (0 to 59) of the time.
Definition: qdatetime.cpp:1600
int minute() const
Returns the minute part (0 to 59) of the time.
Definition: qdatetime.cpp:1589
void endStructure()
Closes a D-Bus structure opened with beginStructure().
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.
bool isValid() const
Returns true if the time is valid; otherwise returns false.
Definition: qdatetime.cpp:1566
int hour() const
Returns the hour part (0 to 23) of the time.
Definition: qdatetime.cpp:1578

◆ operator<<() [3/18]

Q_DBUS_EXPORT QDBusArgument& operator<< ( QDBusArgument a,
const QDateTime dt 
)

Definition at line 1303 of file qdbusargument.cpp.

1304 {
1305  a.beginStructure();
1306  a << dt.date() << dt.time() << int(dt.timeSpec());
1307  a.endStructure();
1308  return a;
1309 }
long ASN1_INTEGER_get ASN1_INTEGER * a
QDate date() const
Returns the date part of the datetime.
Definition: qdatetime.cpp:2357
void endStructure()
Closes a D-Bus structure opened with beginStructure().
Qt::TimeSpec timeSpec() const
Returns the time specification of the datetime.
Definition: qdatetime.cpp:2379
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.
QTime time() const
Returns the time part of the datetime.
Definition: qdatetime.cpp:2368

◆ operator<<() [4/18]

Q_DBUS_EXPORT QDBusArgument& operator<< ( QDBusArgument a,
const QRect rect 
)

Definition at line 1322 of file qdbusargument.cpp.

1323 {
1324  a.beginStructure();
1325  a << rect.x() << rect.y() << rect.width() << rect.height();
1326  a.endStructure();
1327 
1328  return a;
1329 }
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
long ASN1_INTEGER_get ASN1_INTEGER * a
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
void endStructure()
Closes a D-Bus structure opened with beginStructure().
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator<<() [5/18]

Q_DBUS_EXPORT QDBusArgument& operator<< ( QDBusArgument a,
const QRectF rect 
)

Definition at line 1342 of file qdbusargument.cpp.

1343 {
1344  a.beginStructure();
1345  a << double(rect.x()) << double(rect.y()) << double(rect.width()) << double(rect.height());
1346  a.endStructure();
1347 
1348  return a;
1349 }
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
long ASN1_INTEGER_get ASN1_INTEGER * a
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664
void endStructure()
Closes a D-Bus structure opened with beginStructure().
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator<<() [6/18]

Q_DBUS_EXPORT QDBusArgument& operator<< ( QDBusArgument a,
const QSize size 
)

Definition at line 1360 of file qdbusargument.cpp.

1361 {
1362  a.beginStructure();
1363  a << size.width() << size.height();
1364  a.endStructure();
1365 
1366  return a;
1367 }
long ASN1_INTEGER_get ASN1_INTEGER * a
int width() const
Returns the width.
Definition: qsize.h:126
void endStructure()
Closes a D-Bus structure opened with beginStructure().
int height() const
Returns the height.
Definition: qsize.h:129
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator<<() [7/18]

Q_DBUS_EXPORT QDBusArgument& operator<< ( QDBusArgument a,
const QSizeF size 
)

Definition at line 1381 of file qdbusargument.cpp.

1382 {
1383  a.beginStructure();
1384  a << double(size.width()) << double(size.height());
1385  a.endStructure();
1386 
1387  return a;
1388 }
qreal width() const
Returns the width.
Definition: qsize.h:284
qreal height() const
Returns the height.
Definition: qsize.h:287
long ASN1_INTEGER_get ASN1_INTEGER * a
void endStructure()
Closes a D-Bus structure opened with beginStructure().
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator<<() [8/18]

Q_DBUS_EXPORT QDBusArgument& operator<< ( QDBusArgument a,
const QPoint pt 
)

Definition at line 1399 of file qdbusargument.cpp.

1400 {
1401  a.beginStructure();
1402  a << pt.x() << pt.y();
1403  a.endStructure();
1404 
1405  return a;
1406 }
long ASN1_INTEGER_get ASN1_INTEGER * a
void endStructure()
Closes a D-Bus structure opened with beginStructure().
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128

◆ operator<<() [9/18]

Q_DBUS_EXPORT QDBusArgument& operator<< ( QDBusArgument a,
const QPointF pt 
)

Definition at line 1420 of file qdbusargument.cpp.

1421 {
1422  a.beginStructure();
1423  a << double(pt.x()) << double(pt.y());
1424  a.endStructure();
1425 
1426  return a;
1427 }
long ASN1_INTEGER_get ASN1_INTEGER * a
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
void endStructure()
Closes a D-Bus structure opened with beginStructure().
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator<<() [10/18]

Q_DBUS_EXPORT QDBusArgument& operator<< ( QDBusArgument a,
const QLine line 
)

Definition at line 1440 of file qdbusargument.cpp.

1441 {
1442  a.beginStructure();
1443  a << line.p1() << line.p2();
1444  a.endStructure();
1445 
1446  return a;
1447 }
QPoint p1() const
Returns the line&#39;s start point.
Definition: qline.h:132
QPoint p2() const
Returns the line&#39;s end point.
Definition: qline.h:137
long ASN1_INTEGER_get ASN1_INTEGER * a
void endStructure()
Closes a D-Bus structure opened with beginStructure().
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator<<() [11/18]

Q_DBUS_EXPORT QDBusArgument& operator<< ( QDBusArgument a,
const QLineF line 
)

Definition at line 1460 of file qdbusargument.cpp.

1461 {
1462  a.beginStructure();
1463  a << line.p1() << line.p2();
1464  a.endStructure();
1465 
1466  return a;
1467 }
QPointF p1() const
Returns the line&#39;s start point.
Definition: qline.h:314
long ASN1_INTEGER_get ASN1_INTEGER * a
void endStructure()
Closes a D-Bus structure opened with beginStructure().
QPointF p2() const
Returns the line&#39;s end point.
Definition: qline.h:319
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator<<() [12/18]

template<template< typename > class Container, typename T >
QDBusArgument& operator<< ( QDBusArgument arg,
const Container< T > &  list 
)
inline

Definition at line 231 of file qdbusargument.h.

232 {
233  int id = qMetaTypeId<T>();
234  arg.beginArray(id);
235  typename Container<T>::const_iterator it = list.begin();
236  typename Container<T>::const_iterator end = list.end();
237  for ( ; it != end; ++it)
238  arg << *it;
239  arg.endArray();
240  return arg;
241 }
void endArray()
Closes a D-Bus array opened with beginArray().
#define it(className, varName)
void beginArray(int elementMetaTypeId)
Opens a new D-Bus array suitable for appending elements of meta-type id.
static const KeyPair *const end

◆ operator<<() [13/18]

template<typename T >
QDBusArgument& operator<< ( QDBusArgument arg,
const QList< T > &  list 
)
inline

Definition at line 260 of file qdbusargument.h.

261 {
262  int id = qMetaTypeId<T>();
263  arg.beginArray(id);
264  typename QList<T>::ConstIterator it = list.constBegin();
265  typename QList<T>::ConstIterator end = list.constEnd();
266  for ( ; it != end; ++it)
267  arg << *it;
268  arg.endArray();
269  return arg;
270 }
void endArray()
Closes a D-Bus array opened with beginArray().
#define it(className, varName)
void beginArray(int elementMetaTypeId)
Opens a new D-Bus array suitable for appending elements of meta-type id.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
Definition: qlist.h:228
static const KeyPair *const end
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ operator<<() [14/18]

QDBusArgument& operator<< ( QDBusArgument arg,
const QVariantList list 
)
inline

Definition at line 287 of file qdbusargument.h.

288 {
289  int id = qMetaTypeId<QDBusVariant>();
290  arg.beginArray(id);
293  for ( ; it != end; ++it)
294  arg << QDBusVariant(*it);
295  arg.endArray();
296  return arg;
297 }
void endArray()
Closes a D-Bus array opened with beginArray().
#define it(className, varName)
void beginArray(int elementMetaTypeId)
Opens a new D-Bus array suitable for appending elements of meta-type id.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
const_iterator ConstIterator
Qt-style synonym for QList::const_iterator.
Definition: qlist.h:279
static const KeyPair *const end
The QDBusVariant class enables the programmer to identify the variant type provided by the D-Bus type...
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272

◆ operator<<() [15/18]

template<typename Key , typename T >
QDBusArgument& operator<< ( QDBusArgument arg,
const QMap< Key, T > &  map 
)
inline

Definition at line 301 of file qdbusargument.h.

302 {
303  int kid = qMetaTypeId<Key>();
304  int vid = qMetaTypeId<T>();
305  arg.beginMap(kid, vid);
306  typename QMap<Key, T>::ConstIterator it = map.constBegin();
307  typename QMap<Key, T>::ConstIterator end = map.constEnd();
308  for ( ; it != end; ++it) {
309  arg.beginMapEntry();
310  arg << it.key() << it.value();
311  arg.endMapEntry();
312  }
313  arg.endMap();
314  return arg;
315 }
void beginMapEntry()
Opens a D-Bus map entry suitable for appending the key and value entries.
#define it(className, varName)
const Key & key() const
Returns the current item&#39;s key.
Definition: qmap.h:324
void beginMap(int keyMetaTypeId, int valueMetaTypeId)
Opens a new D-Bus map suitable for appending elements.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the map.
Definition: qmap.h:374
The QMap::const_iterator class provides an STL-style const iterator for QMap and QMultiMap.
Definition: qmap.h:301
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the map...
Definition: qmap.h:380
void endMapEntry()
Closes a D-Bus map entry opened with beginMapEntry().
void endMap()
Closes a D-Bus map opened with beginMap().
const T & value() const
Returns the current item&#39;s value.
Definition: qmap.h:325
static const KeyPair *const end

◆ operator<<() [16/18]

QDBusArgument& operator<< ( QDBusArgument arg,
const QVariantMap map 
)
inline

Definition at line 334 of file qdbusargument.h.

335 {
336  arg.beginMap(QVariant::String, qMetaTypeId<QDBusVariant>());
339  for ( ; it != end; ++it) {
340  arg.beginMapEntry();
341  arg << it.key() << QDBusVariant(it.value());
342  arg.endMapEntry();
343  }
344  arg.endMap();
345  return arg;
346 }
void beginMapEntry()
Opens a D-Bus map entry suitable for appending the key and value entries.
#define it(className, varName)
void beginMap(int keyMetaTypeId, int valueMetaTypeId)
Opens a new D-Bus map suitable for appending elements.
const_iterator ConstIterator
Qt-style synonym for QMap::const_iterator.
Definition: qmap.h:389
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the map.
Definition: qmap.h:374
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the map...
Definition: qmap.h:380
void endMapEntry()
Closes a D-Bus map entry opened with beginMapEntry().
void endMap()
Closes a D-Bus map opened with beginMap().
static const KeyPair *const end
The QDBusVariant class enables the programmer to identify the variant type provided by the D-Bus type...

◆ operator<<() [17/18]

template<typename Key , typename T >
QDBusArgument& operator<< ( QDBusArgument arg,
const QHash< Key, T > &  map 
)
inline

Definition at line 350 of file qdbusargument.h.

351 {
352  int kid = qMetaTypeId<Key>();
353  int vid = qMetaTypeId<T>();
354  arg.beginMap(kid, vid);
355  typename QHash<Key, T>::ConstIterator it = map.constBegin();
356  typename QHash<Key, T>::ConstIterator end = map.constEnd();
357  for ( ; it != end; ++it) {
358  arg.beginMapEntry();
359  arg << it.key() << it.value();
360  arg.endMapEntry();
361  }
362  arg.endMap();
363  return arg;
364 }
void beginMapEntry()
Opens a D-Bus map entry suitable for appending the key and value entries.
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
Definition: qhash.h:395
#define it(className, varName)
void beginMap(int keyMetaTypeId, int valueMetaTypeId)
Opens a new D-Bus map suitable for appending elements.
const Key & key() const
Returns the current item&#39;s key.
Definition: qhash.h:419
const T & value() const
Returns the current item&#39;s value.
Definition: qhash.h:420
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:466
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:469
void endMapEntry()
Closes a D-Bus map entry opened with beginMapEntry().
void endMap()
Closes a D-Bus map opened with beginMap().
static const KeyPair *const end

◆ operator<<() [18/18]

QDBusArgument& operator<< ( QDBusArgument arg,
const QVariantHash map 
)
inline

Definition at line 383 of file qdbusargument.h.

384 {
385  arg.beginMap(QVariant::String, qMetaTypeId<QDBusVariant>());
388  for ( ; it != end; ++it) {
389  arg.beginMapEntry();
390  arg << it.key() << QDBusVariant(it.value());
391  arg.endMapEntry();
392  }
393  arg.endMap();
394  return arg;
395 }
void beginMapEntry()
Opens a D-Bus map entry suitable for appending the key and value entries.
#define it(className, varName)
const_iterator ConstIterator
Qt-style synonym for QHash::const_iterator.
Definition: qhash.h:474
void beginMap(int keyMetaTypeId, int valueMetaTypeId)
Opens a new D-Bus map suitable for appending elements.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:466
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:469
void endMapEntry()
Closes a D-Bus map entry opened with beginMapEntry().
void endMap()
Closes a D-Bus map opened with beginMap().
static const KeyPair *const end
The QDBusVariant class enables the programmer to identify the variant type provided by the D-Bus type...

◆ operator>>() [1/16]

Q_DBUS_EXPORT const QDBusArgument& operator>> ( const QDBusArgument a,
QVariant v 
)

Definition at line 1229 of file qdbusargument.cpp.

Referenced by qdbus_cast< QVariant >().

1230 {
1231  QDBusVariant dbv;
1232  a >> dbv;
1233  v = dbv.variant();
1234  return a;
1235 }
long ASN1_INTEGER_get ASN1_INTEGER * a
The QDBusVariant class enables the programmer to identify the variant type provided by the D-Bus type...

◆ operator>>() [2/16]

Q_DBUS_EXPORT const QDBusArgument& operator>> ( const QDBusArgument a,
QDate date 
)

Definition at line 1239 of file qdbusargument.cpp.

1240 {
1241  int y, m, d;
1242  a.beginStructure();
1243  a >> y >> m >> d;
1244  a.endStructure();
1245 
1246  if (y != 0 && m != 0 && d != 0)
1247  date.setYMD(y, m, d);
1248  else
1249  date = QDate();
1250  return a;
1251 }
double d
Definition: qnumeric_p.h:62
The QDate class provides date functions.
Definition: qdatetime.h:55
long ASN1_INTEGER_get ASN1_INTEGER * a
void endStructure()
Closes a D-Bus structure opened with beginStructure().
bool setYMD(int y, int m, int d)
Sets the date&#39;s year y, month m, and day d.
Definition: qdatetime.cpp:937
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator>>() [3/16]

Q_DBUS_EXPORT const QDBusArgument& operator>> ( const QDBusArgument a,
QTime time 
)

Definition at line 1264 of file qdbusargument.cpp.

1265 {
1266  int h, m, s, ms;
1267  a.beginStructure();
1268  a >> h >> m >> s >> ms;
1269  a.endStructure();
1270 
1271  if (h < 0)
1272  time = QTime();
1273  else
1274  time.setHMS(h, m, s, ms);
1275  return a;
1276 }
long ASN1_INTEGER_get ASN1_INTEGER * a
The QTime class provides clock time functions.
Definition: qdatetime.h:148
void endStructure()
Closes a D-Bus structure opened with beginStructure().
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.
bool setHMS(int h, int m, int s, int ms=0)
Sets the time to hour h, minute m, seconds s and milliseconds ms.
Definition: qdatetime.cpp:1744

◆ operator>>() [4/16]

Q_DBUS_EXPORT const QDBusArgument& operator>> ( const QDBusArgument a,
QDateTime dt 
)

Definition at line 1289 of file qdbusargument.cpp.

1290 {
1291  QDate date;
1292  QTime time;
1293  int timespec;
1294 
1295  a.beginStructure();
1296  a >> date >> time >> timespec;
1297  a.endStructure();
1298 
1299  dt = QDateTime(date, time, Qt::TimeSpec(timespec));
1300  return a;
1301 }
The QDate class provides date functions.
Definition: qdatetime.h:55
long ASN1_INTEGER_get ASN1_INTEGER * a
TimeSpec
Definition: qnamespace.h:1404
The QTime class provides clock time functions.
Definition: qdatetime.h:148
The QDateTime class provides date and time functions.
Definition: qdatetime.h:216
void endStructure()
Closes a D-Bus structure opened with beginStructure().
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator>>() [5/16]

Q_DBUS_EXPORT const QDBusArgument& operator>> ( const QDBusArgument a,
QRect rect 
)

Definition at line 1311 of file qdbusargument.cpp.

1312 {
1313  int x, y, width, height;
1314  a.beginStructure();
1315  a >> x >> y >> width >> height;
1316  a.endStructure();
1317 
1318  rect.setRect(x, y, width, height);
1319  return a;
1320 }
long ASN1_INTEGER_get ASN1_INTEGER * a
void endStructure()
Closes a D-Bus structure opened with beginStructure().
void setRect(int x, int y, int w, int h)
Sets the coordinates of the rectangle&#39;s top-left corner to ({x}, {y}), and its size to the given widt...
Definition: qrect.h:400
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator>>() [6/16]

Q_DBUS_EXPORT const QDBusArgument& operator>> ( const QDBusArgument a,
QRectF rect 
)

Definition at line 1331 of file qdbusargument.cpp.

1332 {
1333  double x, y, width, height;
1334  a.beginStructure();
1335  a >> x >> y >> width >> height;
1336  a.endStructure();
1337 
1338  rect.setRect(qreal(x), qreal(y), qreal(width), qreal(height));
1339  return a;
1340 }
double qreal
Definition: qglobal.h:1193
long ASN1_INTEGER_get ASN1_INTEGER * a
void setRect(qreal x, qreal y, qreal w, qreal h)
Sets the coordinates of the rectangle&#39;s top-left corner to (x, y), and its size to the given width an...
Definition: qrect.h:754
void endStructure()
Closes a D-Bus structure opened with beginStructure().
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator>>() [7/16]

Q_DBUS_EXPORT const QDBusArgument& operator>> ( const QDBusArgument a,
QSize size 
)

Definition at line 1351 of file qdbusargument.cpp.

1352 {
1353  a.beginStructure();
1354  a >> size.rwidth() >> size.rheight();
1355  a.endStructure();
1356 
1357  return a;
1358 }
long ASN1_INTEGER_get ASN1_INTEGER * a
void endStructure()
Closes a D-Bus structure opened with beginStructure().
int & rheight()
Returns a reference to the height.
Definition: qsize.h:144
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.
int & rwidth()
Returns a reference to the width.
Definition: qsize.h:141

◆ operator>>() [8/16]

Q_DBUS_EXPORT const QDBusArgument& operator>> ( const QDBusArgument a,
QSizeF size 
)

Definition at line 1369 of file qdbusargument.cpp.

1370 {
1371  double width, height;
1372  a.beginStructure();
1373  a >> width >> height;
1374  a.endStructure();
1375 
1376  size.setWidth(qreal(width));
1377  size.setHeight(qreal(height));
1378  return a;
1379 }
double qreal
Definition: qglobal.h:1193
long ASN1_INTEGER_get ASN1_INTEGER * a
void setWidth(qreal w)
Sets the width to the given width.
Definition: qsize.h:290
void endStructure()
Closes a D-Bus structure opened with beginStructure().
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.
void setHeight(qreal h)
Sets the height to the given height.
Definition: qsize.h:293

◆ operator>>() [9/16]

Q_DBUS_EXPORT const QDBusArgument& operator>> ( const QDBusArgument a,
QPoint pt 
)

Definition at line 1390 of file qdbusargument.cpp.

1391 {
1392  a.beginStructure();
1393  a >> pt.rx() >> pt.ry();
1394  a.endStructure();
1395 
1396  return a;
1397 }
int & ry()
Returns a reference to the y coordinate of this point.
Definition: qpoint.h:143
long ASN1_INTEGER_get ASN1_INTEGER * a
int & rx()
Returns a reference to the x coordinate of this point.
Definition: qpoint.h:140
void endStructure()
Closes a D-Bus structure opened with beginStructure().
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator>>() [10/16]

Q_DBUS_EXPORT const QDBusArgument& operator>> ( const QDBusArgument a,
QPointF pt 
)

Definition at line 1408 of file qdbusargument.cpp.

1409 {
1410  double x, y;
1411  a.beginStructure();
1412  a >> x >> y;
1413  a.endStructure();
1414 
1415  pt.setX(qreal(x));
1416  pt.setY(qreal(y));
1417  return a;
1418 }
double qreal
Definition: qglobal.h:1193
void setY(qreal y)
Sets the y coordinate of this point to the given y coordinate.
Definition: qpoint.h:297
long ASN1_INTEGER_get ASN1_INTEGER * a
void endStructure()
Closes a D-Bus structure opened with beginStructure().
void setX(qreal x)
Sets the x coordinate of this point to the given x coordinate.
Definition: qpoint.h:292
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator>>() [11/16]

Q_DBUS_EXPORT const QDBusArgument& operator>> ( const QDBusArgument a,
QLine line 
)

Definition at line 1429 of file qdbusargument.cpp.

1430 {
1431  QPoint p1, p2;
1432  a.beginStructure();
1433  a >> p1 >> p2;
1434  a.endStructure();
1435 
1436  line = QLine(p1, p2);
1437  return a;
1438 }
The QLine class provides a two-dimensional vector using integer precision.
Definition: qline.h:57
long ASN1_INTEGER_get ASN1_INTEGER * a
void endStructure()
Closes a D-Bus structure opened with beginStructure().
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator>>() [12/16]

Q_DBUS_EXPORT const QDBusArgument& operator>> ( const QDBusArgument a,
QLineF line 
)

Definition at line 1449 of file qdbusargument.cpp.

1450 {
1451  QPointF p1, p2;
1452  a.beginStructure();
1453  a >> p1 >> p2;
1454  a.endStructure();
1455 
1456  line = QLineF(p1, p2);
1457  return a;
1458 }
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
long ASN1_INTEGER_get ASN1_INTEGER * a
The QLineF class provides a two-dimensional vector using floating point precision.
Definition: qline.h:212
void endStructure()
Closes a D-Bus structure opened with beginStructure().
void beginStructure()
Opens a new D-Bus structure suitable for appending new arguments.

◆ operator>>() [13/16]

template<template< typename > class Container, typename T >
const QDBusArgument& operator>> ( const QDBusArgument arg,
Container< T > &  list 
)
inline

Definition at line 244 of file qdbusargument.h.

245 {
246  arg.beginArray();
247  list.clear();
248  while (!arg.atEnd()) {
249  T item;
250  arg >> item;
251  list.push_back(item);
252  }
253 
254  arg.endArray();
255  return arg;
256 }
void endArray()
Closes a D-Bus array opened with beginArray().
void beginArray(int elementMetaTypeId)
Opens a new D-Bus array suitable for appending elements of meta-type id.
bool atEnd() const
Returns true if there are no more elements to be extracted from this QDBusArgument.

◆ operator>>() [14/16]

template<typename T >
const QDBusArgument& operator>> ( const QDBusArgument arg,
QList< T > &  list 
)
inline

Definition at line 273 of file qdbusargument.h.

274 {
275  arg.beginArray();
276  list.clear();
277  while (!arg.atEnd()) {
278  T item;
279  arg >> item;
280  list.push_back(item);
281  }
282  arg.endArray();
283 
284  return arg;
285 }
void push_back(const T &t)
This function is provided for STL compatibility.
Definition: qlist.h:296
void endArray()
Closes a D-Bus array opened with beginArray().
void beginArray(int elementMetaTypeId)
Opens a new D-Bus array suitable for appending elements of meta-type id.
bool atEnd() const
Returns true if there are no more elements to be extracted from this QDBusArgument.
void clear()
Removes all items from the list.
Definition: qlist.h:764

◆ operator>>() [15/16]

template<typename Key , typename T >
const QDBusArgument& operator>> ( const QDBusArgument arg,
QMap< Key, T > &  map 
)
inline

Definition at line 318 of file qdbusargument.h.

319 {
320  arg.beginMap();
321  map.clear();
322  while (!arg.atEnd()) {
323  Key key;
324  T value;
325  arg.beginMapEntry();
326  arg >> key >> value;
327  map.insertMulti(key, value);
328  arg.endMapEntry();
329  }
330  arg.endMap();
331  return arg;
332 }
void beginMapEntry()
Opens a D-Bus map entry suitable for appending the key and value entries.
void beginMap(int keyMetaTypeId, int valueMetaTypeId)
Opens a new D-Bus map suitable for appending elements.
iterator insertMulti(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
Definition: qmap.h:595
bool atEnd() const
Returns true if there are no more elements to be extracted from this QDBusArgument.
void endMapEntry()
Closes a D-Bus map entry opened with beginMapEntry().
void endMap()
Closes a D-Bus map opened with beginMap().
int key
void clear()
Removes all items from the map.
Definition: qmap.h:444

◆ operator>>() [16/16]

template<typename Key , typename T >
const QDBusArgument& operator>> ( const QDBusArgument arg,
QHash< Key, T > &  map 
)
inline

Definition at line 367 of file qdbusargument.h.

368 {
369  arg.beginMap();
370  map.clear();
371  while (!arg.atEnd()) {
372  Key key;
373  T value;
374  arg.beginMapEntry();
375  arg >> key >> value;
376  map.insertMulti(key, value);
377  arg.endMapEntry();
378  }
379  arg.endMap();
380  return arg;
381 }
void beginMapEntry()
Opens a D-Bus map entry suitable for appending the key and value entries.
void clear()
Removes all items from the hash.
Definition: qhash.h:574
void beginMap(int keyMetaTypeId, int valueMetaTypeId)
Opens a new D-Bus map suitable for appending elements.
bool atEnd() const
Returns true if there are no more elements to be extracted from this QDBusArgument.
void endMapEntry()
Closes a D-Bus map entry opened with beginMapEntry().
void endMap()
Closes a D-Bus map opened with beginMap().
int key
iterator insertMulti(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:772

◆ qdbus_cast() [1/2]

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

Definition at line 155 of file qdbusargument.h.

Referenced by QDBusPendingReply< T1, T2, T3, T4, T5, T6, T7, T8 >::argumentAt(), QOfonoSimInterface::cardIdentifier(), QConnmanManagerInterface::getActiveProfile(), QOfonoPrimaryDataContextInterface::getAddress(), QConnmanServiceInterface::getAPN(), QOfonoPrimaryDataContextInterface::getApName(), QConnmanManagerInterface::getAvailableTechnologies(), QOfonoNetworkRegistrationInterface::getBaseStation(), QConnmanManagerInterface::getConnectedTechnologies(), QConnmanManagerInterface::getDefaultTechnology(), QConnmanServiceInterface::getDomains(), QConnmanManagerInterface::getEnabledTechnologies(), QConnmanServiceInterface::getError(), QConnmanServiceInterface::getEthernet(), QOfonoModemInterface::getFeatures(), QOfonoSimInterface::getHomeMcc(), QOfonoSimInterface::getHomeMnc(), QOfonoPrimaryDataContextInterface::getInterface(), QOfonoModemInterface::getInterfaces(), QConnmanServiceInterface::getIPv4(), QConnmanServiceInterface::getIPv4Configuration(), QOfonoModemInterface::getManufacturer(), QOfonoNetworkOperatorInterface::getMcc(), QConnmanServiceInterface::getMCC(), QOfonoNetworkOperatorInterface::getMnc(), QConnmanServiceInterface::getMNC(), QConnmanServiceInterface::getMode(), QOfonoModemInterface::getModel(), QOfonoModemInterface::getName(), QConnmanProfileInterface::getName(), QConnmanServiceInterface::getName(), QOfonoNetworkOperatorInterface::getName(), QConnmanTechnologyInterface::getName(), QOfonoPrimaryDataContextInterface::getName(), QConnmanServiceInterface::getNameservers(), QConnmanManagerInterface::getOfflineMode(), QOfonoNetworkRegistrationInterface::getOperatorName(), QConnmanServiceInterface::getPassphrase(), QConnmanManagerInterface::getProfiles(), QConnmanServiceInterface::getProxy(), QOfonoModemInterface::getRevision(), QConnmanServiceInterface::getSecurity(), QOfonoModemInterface::getSerial(), QConnmanManagerInterface::getServices(), QConnmanProfileInterface::getServices(), QConnmanServiceInterface::getServices(), QOfonoPrimaryDataContextInterface::getSettings(), QOfonoNetworkRegistrationInterface::getSignalStrength(), QConnmanServiceInterface::getSignalStrength(), QConnmanServiceInterface::getState(), QConnmanTechnologyInterface::getState(), QOfonoNetworkRegistrationInterface::getStatus(), QOfonoNetworkOperatorInterface::getStatus(), QConnmanManagerInterface::getTechnologies(), QOfonoNetworkOperatorInterface::getTechnologies(), QOfonoNetworkRegistrationInterface::getTechnology(), QConnmanServiceInterface::getType(), QConnmanTechnologyInterface::getType(), QOfonoPrimaryDataContextInterface::getType(), QNetworkManagerEngine::interfacePropertiesChanged(), QOfonoPrimaryDataContextInterface::isActive(), QOfonoDataConnectionManagerInterface::isAttached(), QConnmanServiceInterface::isAutoConnect(), QConnmanServiceInterface::isFavorite(), QConnmanServiceInterface::isImmutable(), QConnmanProfileInterface::isOfflineMode(), QConnmanServiceInterface::isOfflineMode(), QOfonoModemInterface::isOnline(), QConnmanServiceInterface::isPassphraseRequired(), QOfonoModemInterface::isPowered(), QOfonoDataConnectionManagerInterface::isPowered(), QOfonoSimInterface::isPresent(), QConnmanServiceInterface::isRoaming(), QOfonoDataConnectionManagerInterface::isRoamingAllowed(), QConnmanServiceInterface::isSetupRequired(), QOfonoSimInterface::lockedPins(), QOfonoSimInterface::pinRequired(), QConnmanEngine::propertyChangedContext(), qdbus_cast(), and qdbus_cast< QVariant >().

160 {
161  T item;
162  arg >> item;
163  return item;
164 }

◆ qdbus_cast() [2/2]

template<typename T >
T qdbus_cast ( const QVariant v)
inline

Definition at line 166 of file qdbusargument.h.

171 {
172  int id = v.userType();
173  if (id == qMetaTypeId<QDBusArgument>())
174  return qdbus_cast<T>(qvariant_cast<QDBusArgument>(v));
175  else
176  return qvariant_cast<T>(v);
177 }
The QDBusArgument class is used to marshall and demarshall D-Bus arguments.
Definition: qdbusargument.h:69
qdbus_cast(const QDBusArgument &argument)
Attempts to demarshall the contents of argument into the type T.
int userType() const
Returns the storage type of the value stored in the variant.
Definition: qvariant.cpp:1913
T qvariant_cast(const QVariant &value)
Returns the given value converted to the template type T.
Definition: qvariant.h:571

◆ qdbus_cast< QVariant >() [1/2]

template<>
QVariant qdbus_cast< QVariant > ( const QDBusArgument arg,
QVariant  
)
inline

Definition at line 180 of file qdbusargument.h.

181 {
182  QDBusVariant item;
183  arg >> item;
184  return item.variant();
185 }
QVariant variant() const
Returns this D-Bus variant as a QVariant object.
The QDBusVariant class enables the programmer to identify the variant type provided by the D-Bus type...

◆ qdbus_cast< QVariant >() [2/2]

template<>
QVariant qdbus_cast< QVariant > ( const QVariant v,
QVariant  
)
inline

Definition at line 186 of file qdbusargument.h.

187 {
188  return qdbus_cast<QDBusVariant>(v).variant();
189 }
qdbus_cast(const QDBusArgument &argument)
Attempts to demarshall the contents of argument into the type T.
const char * variant
The QDBusVariant class enables the programmer to identify the variant type provided by the D-Bus type...