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:
Ievgenii Meshcheriakov 2023-02-22 12:52:55 +01:00
parent 07b8a5a409
commit f952e74cfe
4 changed files with 12 additions and 19 deletions

View File

@ -26,7 +26,7 @@ target_link_libraries(ping PRIVATE
qt_add_executable(pong
ping-common.h
pong.cpp pong.h
pong.cpp
)
target_link_libraries(pong PRIVATE

View File

@ -2,12 +2,19 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "ping-common.h"
#include "pong.h"
#include <QObject>
#include <QCoreApplication>
#include <QDBusConnection>
#include <QDBusError>
class Pong : public QObject
{
Q_OBJECT
public slots:
QString ping(const QString &arg);
};
QString Pong::ping(const QString &arg)
{
QMetaObject::invokeMethod(QCoreApplication::instance(), &QCoreApplication::quit);
@ -38,3 +45,5 @@ int main(int argc, char **argv)
app.exec();
return 0;
}
#include "pong.moc"

View File

@ -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

View File

@ -1,7 +1,7 @@
QT -= gui
QT += dbus
HEADERS += ping-common.h pong.h
HEADERS += ping-common.h
SOURCES += pong.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/dbus/pingpong