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
qdebugsnippet.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#include <QtGui>
5#include <QtDebug>
6
7class Coordinate : public QObject
8{
9public:
10 int myX, myY;
11
12 int x() const { return myX; };
13 int y() const { return myY; };
14};
15
18{
20 debug.nospace() << '(' << c.x() << ", " << c.y() << ')';
21
22 return debug;
23}
25
26int main(int argv, char **args)
27{
28 Coordinate coordinate;
29 coordinate.myX = 10;
30 coordinate.myY = 44;
31
33 qDebug() << "Date:" << QDate::currentDate();
34 qDebug() << "Types:" << QString("String") << QChar('x') << QRect(0, 10, 50, 40);
35 qDebug() << "Custom coordinate type:" << coordinate;
37}
int x() const
int y() const
\inmodule QtCore
static QDate currentDate()
Returns the system clock's current date.
\inmodule QtCore
\inmodule QtCore
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qrect.h:30
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
int main()
[0]
QDebug operator<<(QDebug debug, const Coordinate &c)
[0]
#define qDebug
[1]
Definition qlogging.h:164
const GLubyte * c
QJSValueList args