Qt 4.8
Functions
qdbusargument.cpp File Reference
#include "qdbusargument.h"
#include <qatomic.h>
#include <qbytearray.h>
#include <qlist.h>
#include <qmap.h>
#include <qstring.h>
#include <qstringlist.h>
#include <qvariant.h>
#include <qdatetime.h>
#include <qrect.h>
#include <qline.h>
#include "qdbusargument_p.h"
#include "qdbusmetatype_p.h"
#include "qdbusutil_p.h"
#include "qdbusmarshaller.cpp"
#include "qdbusdemarshaller.cpp"

Go to the source code of this file.

Functions

QDBusArgumentoperator<< (QDBusArgument &a, const QDate &date)
 
QDBusArgumentoperator<< (QDBusArgument &a, const QTime &time)
 
QDBusArgumentoperator<< (QDBusArgument &a, const QDateTime &dt)
 
QDBusArgumentoperator<< (QDBusArgument &a, const QRect &rect)
 
QDBusArgumentoperator<< (QDBusArgument &a, const QRectF &rect)
 
QDBusArgumentoperator<< (QDBusArgument &a, const QSize &size)
 
QDBusArgumentoperator<< (QDBusArgument &a, const QSizeF &size)
 
QDBusArgumentoperator<< (QDBusArgument &a, const QPoint &pt)
 
QDBusArgumentoperator<< (QDBusArgument &a, const QPointF &pt)
 
QDBusArgumentoperator<< (QDBusArgument &a, const QLine &line)
 
QDBusArgumentoperator<< (QDBusArgument &a, const QLineF &line)
 
const QDBusArgumentoperator>> (const QDBusArgument &a, QVariant &v)
 
const QDBusArgumentoperator>> (const QDBusArgument &a, QDate &date)
 
const QDBusArgumentoperator>> (const QDBusArgument &a, QTime &time)
 
const QDBusArgumentoperator>> (const QDBusArgument &a, QDateTime &dt)
 
const QDBusArgumentoperator>> (const QDBusArgument &a, QRect &rect)
 
const QDBusArgumentoperator>> (const QDBusArgument &a, QRectF &rect)
 
const QDBusArgumentoperator>> (const QDBusArgument &a, QSize &size)
 
const QDBusArgumentoperator>> (const QDBusArgument &a, QSizeF &size)
 
const QDBusArgumentoperator>> (const QDBusArgument &a, QPoint &pt)
 
const QDBusArgumentoperator>> (const QDBusArgument &a, QPointF &pt)
 
const QDBusArgumentoperator>> (const QDBusArgument &a, QLine &line)
 
const QDBusArgumentoperator>> (const QDBusArgument &a, QLineF &line)
 

Function Documentation

◆ operator<<() [1/11]

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/11]

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/11]

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/11]

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/11]

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/11]

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/11]

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/11]

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/11]

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/11]

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/11]

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>>() [1/12]

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/12]

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/12]

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/12]

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/12]

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/12]

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/12]

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/12]

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/12]

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/12]

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/12]

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/12]

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.