Qt 4.8
qdbusargument.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtDBus module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "qdbusargument.h"
43 
44 #include <qatomic.h>
45 #include <qbytearray.h>
46 #include <qlist.h>
47 #include <qmap.h>
48 #include <qstring.h>
49 #include <qstringlist.h>
50 #include <qvariant.h>
51 #include <qdatetime.h>
52 #include <qrect.h>
53 #include <qline.h>
54 
55 #include "qdbusargument_p.h"
56 #include "qdbusmetatype_p.h"
57 #include "qdbusutil_p.h"
58 
59 #ifndef QT_NO_DBUS
60 
62 
64 {
65  if (message)
66  q_dbus_message_unref(message);
67 }
68 
70 {
71  if (!qdbus_loadLibDBus())
72  return "";
73 
74  QByteArray signature;
76  marshaller->ba = &signature;
77 
78  // run it
79  void *null = 0;
80  QVariant v(id, null);
81  QDBusArgument arg(marshaller);
83  arg.d = 0;
84 
85  // delete it
86  bool ok = marshaller->ok;
87  delete marshaller;
88 
89  if (signature.isEmpty() || !ok || !QDBusUtil::isValidSingleSignature(QString::fromLatin1(signature))) {
90  qWarning("QDBusMarshaller: type `%s' produces invalid D-BUS signature `%s' "
91  "(Did you forget to call beginStructure() ?)",
93  signature.isEmpty() ? "<empty>" : signature.constData());
94  return "";
95  } else if ((signature.at(0) != DBUS_TYPE_ARRAY && signature.at(0) != DBUS_STRUCT_BEGIN_CHAR) ||
96  (signature.at(0) == DBUS_TYPE_ARRAY && (signature.at(1) == DBUS_TYPE_BYTE ||
97  signature.at(1) == DBUS_TYPE_STRING))) {
98  qWarning("QDBusMarshaller: type `%s' attempts to redefine basic D-BUS type '%s' (%s) "
99  "(Did you forget to call beginStructure() ?)",
101  signature.constData(),
103  return "";
104  }
105  return signature;
106 }
107 
109 {
110  if (!d)
111  return false;
112  if (d->direction == Marshalling) {
113  if (!d->marshaller()->ok)
114  return false;
115 
116  if (d->message && d->ref != 1) {
118  dd->message = q_dbus_message_copy(d->message);
119  q_dbus_message_iter_init_append(dd->message, &dd->iterator);
120 
121  if (!d->ref.deref())
122  delete d;
123  d = dd;
124  }
125  return true;
126  }
127 
128 #ifdef QT_DEBUG
129  qFatal("QDBusArgument: write from a read-only object");
130 #else
131  qWarning("QDBusArgument: write from a read-only object");
132 #endif
133  return false;
134 }
135 
137 {
138  if (!d)
139  return false;
140  if (d->direction == Demarshalling)
141  return true;
142 
143 #ifdef QT_DEBUG
144  qFatal("QDBusArgument: read from a write-only object");
145 #else
146  qWarning("QDBusArgument: read from a write-only object");
147 #endif
148 
149  return false;
150 }
151 
153 {
154  if (!checkRead(d))
155  return false; // don't bother
156 
157  if (d->ref == 1)
158  return true; // no need to detach
159 
161  dd->message = q_dbus_message_ref(d->message);
162  dd->iterator = static_cast<QDBusDemarshaller*>(d)->iterator;
163 
164  if (!d->ref.deref())
165  delete d;
166  d = dd;
167  return true;
168 }
169 
300 {
301  if (!qdbus_loadLibDBus()) {
302  d = 0;
303  return;
304  }
305 
306  QDBusMarshaller *dd = new QDBusMarshaller(0);
307  d = dd;
308 
309  // create a new message with any type, we won't sent it anyways
310  dd->message = q_dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL);
311  q_dbus_message_iter_init_append(dd->message, &dd->iterator);
312 }
313 
322  : d(other.d)
323 {
324  if (d)
325  d->ref.ref();
326 }
327 
332  : d(dd)
333 {
334 }
335 
344 {
345  qAtomicAssign(d, other.d);
346  return *this;
347 }
348 
354 {
355  if (d && !d->ref.deref())
356  delete d;
357 }
358 
363 {
365  d->marshaller()->append(arg);
366  return *this;
367 }
368 
377 {
379  d->marshaller()->append(arg);
380  return *this;
381 }
382 
391 {
393  d->marshaller()->append(arg);
394  return *this;
395 }
396 
405 {
407  d->marshaller()->append(arg);
408  return *this;
409 }
410 
419 {
421  d->marshaller()->append(arg);
422  return *this;
423 }
424 
433 {
435  d->marshaller()->append(arg);
436  return *this;
437 }
438 
447 {
449  d->marshaller()->append(arg);
450  return *this;
451 }
452 
461 {
463  d->marshaller()->append(arg);
464  return *this;
465 }
466 
476 {
478  d->marshaller()->append(arg);
479  return *this;
480 }
481 
491 {
493  d->marshaller()->append(arg);
494  return *this;
495 }
496 
507 {
509  d->marshaller()->append(arg);
510  return *this;
511 }
512 
523 {
525  d->marshaller()->append(arg);
526  return *this;
527 }
528 
540 {
542  d->marshaller()->append(arg);
543  return *this;
544 }
545 
557 {
559  d->marshaller()->append(arg);
560  return *this;
561 }
562 
578 {
580  d->marshaller()->append(arg);
581  return *this;
582 }
583 
599 {
601  d->marshaller()->append(arg);
602  return *this;
603 }
604 
617 {
620 }
621 
631 {
632  if (!d)
633  return QString();
635  return d->demarshaller()->currentSignature();
636  else
637  return d->marshaller()->currentSignature();
638 }
639 
653 {
654  if (!d)
655  return UnknownType;
657  return d->demarshaller()->currentType();
658  return UnknownType;
659 }
660 
666 {
668  arg = d->demarshaller()->toByte();
669  return *this;
670 }
671 
681 {
683  arg = d->demarshaller()->toBool();
684  return *this;
685 }
686 
696 {
698  arg = d->demarshaller()->toUShort();
699  return *this;
700 }
701 
710 const QDBusArgument &QDBusArgument::operator>>(short &arg) const
711 {
713  arg = d->demarshaller()->toShort();
714  return *this;
715 }
716 
726 {
728  arg = d->demarshaller()->toInt();
729  return *this;
730 }
731 
741 {
743  arg = d->demarshaller()->toUInt();
744  return *this;
745 }
746 
756 {
758  arg = d->demarshaller()->toLongLong();
759  return *this;
760 }
761 
771 {
773  arg = d->demarshaller()->toULongLong();
774  return *this;
775 }
776 
785 const QDBusArgument &QDBusArgument::operator>>(double &arg) const
786 {
788  arg = d->demarshaller()->toDouble();
789  return *this;
790 }
791 
801 {
803  arg = d->demarshaller()->toString();
804  return *this;
805 }
806 
817 {
819  arg = d->demarshaller()->toObjectPath();
820  return *this;
821 }
822 
833 {
835  arg = d->demarshaller()->toSignature();
836  return *this;
837 }
838 
850 {
852  arg = d->demarshaller()->toUnixFileDescriptor();
853  return *this;
854 }
855 
873 {
875  arg = d->demarshaller()->toVariant();
876  return *this;
877 }
878 
894 {
896  arg = d->demarshaller()->toStringList();
897  return *this;
898 }
899 
915 {
917  arg = d->demarshaller()->toByteArray();
918  return *this;
919 }
920 
937 {
939  d = d->marshaller()->beginStructure();
940 }
941 
949 {
951  d = d->marshaller()->endStructure();
952 }
953 
972 {
974  d = d->marshaller()->beginArray(id);
975 }
976 
984 {
986  d = d->marshaller()->endArray();
987 }
988 
1007 void QDBusArgument::beginMap(int kid, int vid)
1008 {
1010  d = d->marshaller()->beginMap(kid, vid);
1011 }
1012 
1020 {
1022  d = d->marshaller()->endMap();
1023 }
1024 
1035 {
1037  d = d->marshaller()->beginMapEntry();
1038 }
1039 
1047 {
1049  d = d->marshaller()->endMapEntry();
1050 }
1051 
1063 {
1065  d = d->demarshaller()->beginStructure();
1066 }
1067 
1075 {
1077  d = d->demarshaller()->endStructure();
1078 }
1079 
1099 {
1101  d = d->demarshaller()->beginArray();
1102 }
1103 
1111 {
1113  d = d->demarshaller()->endArray();
1114 }
1115 
1132 {
1134  d = d->demarshaller()->beginMap();
1135 }
1136 
1144 {
1146  d = d->demarshaller()->endMap();
1147 }
1148 
1158 {
1160  d = d->demarshaller()->beginMapEntry();
1161 }
1162 
1170 {
1172  d = d->demarshaller()->endMapEntry();
1173 }
1174 
1181 {
1183  return d->demarshaller()->atEnd();
1184 
1185  return true; // at least, stop reading
1186 }
1187 
1212 {
1214  return d->demarshaller()->toVariantInternal();
1215 
1216  return QVariant();
1217 }
1218 
1220 
1221 // for optimization purposes, we include the marshallers here
1222 #include "qdbusmarshaller.cpp"
1223 #include "qdbusdemarshaller.cpp"
1224 
1226 
1227 // QDBusArgument operators
1228 
1230 {
1231  QDBusVariant dbv;
1232  a >> dbv;
1233  v = dbv.variant();
1234  return a;
1235 }
1236 
1237 // QVariant types
1238 #ifndef QDBUS_NO_SPECIALTYPES
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 }
1252 
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 }
1263 
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 }
1277 
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 }
1288 
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 }
1302 
1304 {
1305  a.beginStructure();
1306  a << dt.date() << dt.time() << int(dt.timeSpec());
1307  a.endStructure();
1308  return a;
1309 }
1310 
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 }
1321 
1323 {
1324  a.beginStructure();
1325  a << rect.x() << rect.y() << rect.width() << rect.height();
1326  a.endStructure();
1327 
1328  return a;
1329 }
1330 
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 }
1341 
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 }
1350 
1352 {
1353  a.beginStructure();
1354  a >> size.rwidth() >> size.rheight();
1355  a.endStructure();
1356 
1357  return a;
1358 }
1359 
1361 {
1362  a.beginStructure();
1363  a << size.width() << size.height();
1364  a.endStructure();
1365 
1366  return a;
1367 }
1368 
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 }
1380 
1382 {
1383  a.beginStructure();
1384  a << double(size.width()) << double(size.height());
1385  a.endStructure();
1386 
1387  return a;
1388 }
1389 
1391 {
1392  a.beginStructure();
1393  a >> pt.rx() >> pt.ry();
1394  a.endStructure();
1395 
1396  return a;
1397 }
1398 
1400 {
1401  a.beginStructure();
1402  a << pt.x() << pt.y();
1403  a.endStructure();
1404 
1405  return a;
1406 }
1407 
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 }
1419 
1421 {
1422  a.beginStructure();
1423  a << double(pt.x()) << double(pt.y());
1424  a.endStructure();
1425 
1426  return a;
1427 }
1428 
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 }
1439 
1441 {
1442  a.beginStructure();
1443  a << line.p1() << line.p2();
1444  a.endStructure();
1445 
1446  return a;
1447 }
1448 
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 }
1459 
1461 {
1462  a.beginStructure();
1463  a << line.p1() << line.p2();
1464  a.endStructure();
1465 
1466  return a;
1467 }
1468 #endif
1469 
1471 
1472 #endif // QT_NO_DBUS
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
void beginMapEntry()
Opens a D-Bus map entry suitable for appending the key and value entries.
DBusMessage * message
static QDBusArgumentPrivate * d(QDBusArgument &q)
QDBusArgument::ElementType currentType()
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
QDBusMarshaller * endArray()
void endArray()
Closes a D-Bus array opened with beginArray().
double qreal
Definition: qglobal.h:1193
static int signatureToType(const char *signature)
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QDBusDemarshaller * endStructure()
The QLine class provides a two-dimensional vector using integer precision.
Definition: qline.h:57
bool isValid() const
Returns true if this date is valid; otherwise returns false.
Definition: qdatetime.cpp:340
QDBusArgument()
Constructs an empty QDBusArgument argument.
The QDBusArgument class is used to marshall and demarshall D-Bus arguments.
Definition: qdbusargument.h:69
QPoint p1() const
Returns the line&#39;s start point.
Definition: qline.h:132
qreal width() const
Returns the width.
Definition: qsize.h:284
QPointF p1() const
Returns the line&#39;s start point.
Definition: qline.h:314
QDBusDemarshaller * endMapEntry()
QDBusMarshaller * beginMapEntry()
QPoint p2() const
Returns the line&#39;s end point.
Definition: qline.h:137
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void setY(qreal y)
Sets the y coordinate of this point to the given y coordinate.
Definition: qpoint.h:297
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
qreal height() const
Returns the height.
Definition: qsize.h:287
int month() const
Returns the number corresponding to the month of this date, using the following convention: ...
Definition: qdatetime.cpp:382
QString currentSignature() const
Returns the type signature of the D-Bus type this QDBusArgument object is currently pointing to...
The QDBusSignature class enables the programmer to identify the SIGNATURE type provided by the D-Bus ...
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
void beginMap() const
Recurses into the D-Bus map to allow extraction of the map&#39;s elements.
int & ry()
Returns a reference to the y coordinate of this point.
Definition: qpoint.h:143
int day() const
Returns the day of the month (1 to 31) of this date.
Definition: qdatetime.cpp:395
The QDate class provides date functions.
Definition: qdatetime.h:55
int msec() const
Returns the millisecond part (0 to 999) of the time.
Definition: qdatetime.cpp:1611
long ASN1_INTEGER_get ASN1_INTEGER * a
bool ref()
Atomically increments the value of this QAtomicInt.
QDBusDemarshaller * beginMap()
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
QDBusDemarshaller * demarshaller()
The QString class provides a Unicode character string.
Definition: qstring.h:83
void setWidth(qreal w)
Sets the width to the given width.
Definition: qsize.h:290
DBusMessageIter iterator
static const char * typeToName(Type type)
Converts the enum representation of the storage type, typ, to its string representation.
Definition: qvariant.cpp:2008
The QSizeF class defines the size of a two-dimensional object using floating point precision...
Definition: qsize.h:202
QDBusDemarshaller * endArray()
bool appendVariantInternal(const QVariant &arg)
static bool checkReadAndDetach(QDBusArgumentPrivate *&d)
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
The QLineF class provides a two-dimensional vector using floating point precision.
Definition: qline.h:212
The QDBusUnixFileDescriptor class holds one Unix file descriptor.
TimeSpec
Definition: qnamespace.h:1404
QDBusMarshaller * endStructure()
QDBusMarshaller * marshaller()
unsigned char uchar
Definition: qglobal.h:994
int width() const
Returns the width.
Definition: qsize.h:126
The QTime class provides clock time functions.
Definition: qdatetime.h:148
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
QDBusMarshaller * beginMap(int kid, int vid)
bool atEnd() const
Returns true if there are no more elements to be extracted from this QDBusArgument.
QStringList toStringList()
QDBusArgument & operator=(const QDBusArgument &other)
Copies the other QDBusArgument object into this one.
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
bool deref()
Atomically decrements the value of this QAtomicInt.
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
Q_CORE_EXPORT void qWarning(const char *,...)
int & rx()
Returns a reference to the x coordinate of this point.
Definition: qpoint.h:140
int second() const
Returns the second part (0 to 59) of the time.
Definition: qdatetime.cpp:1600
unsigned int uint
Definition: qglobal.h:996
Type
This enum type defines the types of variable that a QVariant can contain.
Definition: qvariant.h:95
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
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
bool isValidSingleSignature(const QString &signature)
Returns true if signature is a valid D-Bus type signature for exactly one full type.
Definition: qdbusutil.cpp:593
QByteArray * ba
int minute() const
Returns the minute part (0 to 59) of the time.
Definition: qdatetime.cpp:1589
QDBusDemarshaller * beginStructure()
void append(uchar arg)
static bool checkRead(QDBusArgumentPrivate *d)
QVariant asVariant() const
Returns the current argument in the form of a QVariant.
QDBusMarshaller * beginStructure()
QDBusSignature toSignature()
ElementType
This enum describes the type of element held by the argument.
Definition: qdbusargument.h:72
QDBusVariant toVariant()
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
QDate date() const
Returns the date part of the datetime.
Definition: qdatetime.cpp:2357
QDBusArgumentPrivate * d
ElementType currentType() const
Returns the classification of the current element type.
Q_CORE_EXPORT void qFatal(const char *,...)
void endMapEntry()
Closes a D-Bus map entry opened with beginMapEntry().
int userType() const
Returns the storage type of the value stored in the variant.
Definition: qvariant.cpp:1913
void endMap()
Closes a D-Bus map opened with beginMap().
QDBusDemarshaller * endMap()
The QDateTime class provides date and time functions.
Definition: qdatetime.h:216
QDBusMarshaller * beginArray(int id)
static bool checkWrite(QDBusArgumentPrivate *&d)
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
QDBusMarshaller * endMapEntry()
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664
QDBusArgument & operator<<(uchar arg)
Appends the primitive value arg of type BYTE to the D-Bus stream.
unsigned short ushort
Definition: qglobal.h:995
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
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 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
const void * constData() const
Definition: qvariant.cpp:3065
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
Qt::TimeSpec timeSpec() const
Returns the time specification of the datetime.
Definition: qdatetime.cpp:2379
The QDBusObjectPath class enables the programmer to identify the OBJECT_PATH type provided by the D-B...
DBusMessageIter iterator
int & rheight()
Returns a reference to the height.
Definition: qsize.h:144
void beginArray() const
Recurses into the D-Bus array to allow extraction of the array elements.
QPointF p2() const
Returns the line&#39;s end point.
Definition: qline.h:319
int height() const
Returns the height.
Definition: qsize.h:129
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
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 qAtomicAssign(T *&d, T *x)
This is a helper for the assignment operators of implicitly shared classes.
Definition: qatomic.h:195
QDBusUnixFileDescriptor toUnixFileDescriptor()
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
void setX(qreal x)
Sets the x coordinate of this point to the given x coordinate.
Definition: qpoint.h:292
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.
bool qdbus_loadLibDBus()
void setHeight(qreal h)
Sets the height to the given height.
Definition: qsize.h:293
static QByteArray createSignature(int id)
int year() const
Returns the year of this date.
Definition: qdatetime.cpp:353
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
QTime time() const
Returns the time part of the datetime.
Definition: qdatetime.cpp:2368
QDBusObjectPath toObjectPath()
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
quint64 qulonglong
Definition: qglobal.h:952
QDBusMarshaller * endMap()
static bool marshall(QDBusArgument &, int id, const void *data)
Executes the marshalling of type id (whose data is contained in data) to the D-Bus marshalling argume...
~QDBusArgument()
Disposes of the resources associated with this QDBusArgument object.
QDBusDemarshaller * beginArray()
enum QDBusArgumentPrivate::Direction direction
char at(int i) const
Returns the character at index position i in the byte array.
Definition: qbytearray.h:413
qint64 qlonglong
Definition: qglobal.h:951
const QDBusArgument & operator>>(uchar &arg) const
Extracts one D-BUS primitive argument of type BYTE from the D-BUS stream and puts it into arg...
The QDBusVariant class enables the programmer to identify the variant type provided by the D-Bus type...
QString currentSignature()
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
void appendVariant(const QVariant &v)
Appends the variant v.
int & rwidth()
Returns a reference to the width.
Definition: qsize.h:141
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
QDBusDemarshaller * beginMapEntry()