pingpong example: Remove pong.h
Move the class definition inside pong.cpp. Task-number: QTBUG-111366 Pick-to: 6.5 Change-Id: Id4b376451cb2bdbd04ccce4b2dcf0760dbfbfb2a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
07b8a5a409
commit
f952e74cfe
@ -26,7 +26,7 @@ target_link_libraries(ping PRIVATE
|
|||||||
|
|
||||||
qt_add_executable(pong
|
qt_add_executable(pong
|
||||||
ping-common.h
|
ping-common.h
|
||||||
pong.cpp pong.h
|
pong.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(pong PRIVATE
|
target_link_libraries(pong PRIVATE
|
||||||
|
@ -2,12 +2,19 @@
|
|||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||||
|
|
||||||
#include "ping-common.h"
|
#include "ping-common.h"
|
||||||
#include "pong.h"
|
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDBusConnection>
|
#include <QDBusConnection>
|
||||||
#include <QDBusError>
|
#include <QDBusError>
|
||||||
|
|
||||||
|
class Pong : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public slots:
|
||||||
|
QString ping(const QString &arg);
|
||||||
|
};
|
||||||
|
|
||||||
QString Pong::ping(const QString &arg)
|
QString Pong::ping(const QString &arg)
|
||||||
{
|
{
|
||||||
QMetaObject::invokeMethod(QCoreApplication::instance(), &QCoreApplication::quit);
|
QMetaObject::invokeMethod(QCoreApplication::instance(), &QCoreApplication::quit);
|
||||||
@ -38,3 +45,5 @@ int main(int argc, char **argv)
|
|||||||
app.exec();
|
app.exec();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "pong.moc"
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
// Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
|
||||||
|
|
||||||
#ifndef PONG_H
|
|
||||||
#define PONG_H
|
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
|
||||||
|
|
||||||
class Pong: public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public slots:
|
|
||||||
QString ping(const QString &arg);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,7 +1,7 @@
|
|||||||
QT -= gui
|
QT -= gui
|
||||||
QT += dbus
|
QT += dbus
|
||||||
|
|
||||||
HEADERS += ping-common.h pong.h
|
HEADERS += ping-common.h
|
||||||
SOURCES += pong.cpp
|
SOURCES += pong.cpp
|
||||||
|
|
||||||
target.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong
|
target.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong
|
||||||
|
Loading…
x
Reference in New Issue
Block a user