diff options
author | Rym Bouabid <rym.bouabid@qt.io> | 2023-09-14 17:35:37 +0200 |
---|---|---|
committer | Rym Bouabid <rym.bouabid@qt.io> | 2023-09-26 19:58:26 +0200 |
commit | deec34c2fb496c8f96b76d456d27a2824622f401 (patch) | |
tree | d6a0456dc408bd28e6ea3bc158e186deba4c851b /examples/corelib | |
parent | f77c7e1bf54288bd6720e8a41b7ac9a0486c93d5 (diff) |
Revamp Local Fortune Server Example: Declare sendFortune() as a method
Declare sendFortune() as a method because it's used in the connect()
overload taking a pointer-to-member-function, so it doesn't need help
from moc.
Q_OBJECT is not needed anymore as the "Server" class doesn't contain
signals and slots anymore.
Use Q_DECLARE_TR_FUNCTIONS Macro to allow tr() calls.
Task-number: QTBUG-117064
Pick-to: 6.6 6.5
Change-Id: Id197cb4c9f9df2102b769d028d8a0cae91e5c492
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'examples/corelib')
-rw-r--r-- | examples/corelib/ipc/localfortuneserver/server.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/corelib/ipc/localfortuneserver/server.h b/examples/corelib/ipc/localfortuneserver/server.h index d574b7d613..1aa63c8d22 100644 --- a/examples/corelib/ipc/localfortuneserver/server.h +++ b/examples/corelib/ipc/localfortuneserver/server.h @@ -4,20 +4,19 @@ #ifndef SERVER_H #define SERVER_H +#include <QApplication> #include <QDialog> #include <QLocalServer> class Server : public QDialog { - Q_OBJECT + Q_DECLARE_TR_FUNCTIONS(Server) public: explicit Server(QWidget *parent = nullptr); -private slots: - void sendFortune(); - private: + void sendFortune(); QLocalServer *server; QStringList fortunes; }; |