diff options
author | Samuel Gaist <samuel.gaist@idiap.ch> | 2022-09-22 22:37:03 +0200 |
---|---|---|
committer | Samuel Gaist <samuel.gaist@idiap.ch> | 2022-09-27 19:29:59 +0000 |
commit | 6457f1ee71e5de3b14bc30b9e9a22d3a7534a196 (patch) | |
tree | e51ecd96cf397b67a25b35dad90d2a9729aefb66 /examples | |
parent | 93f15f81c61e91bba0a76dc77695a60cd4e317f9 (diff) |
examples: port dbus examples to new connection style
Task-number: QTBUG-106893
Change-Id: Ic857f694b836fba30e41ef0a40107917bd05b64c
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/dbus/chat/chat.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/examples/dbus/chat/chat.cpp b/examples/dbus/chat/chat.cpp index 41a9f55120..6e7c670834 100644 --- a/examples/dbus/chat/chat.cpp +++ b/examples/dbus/chat/chat.cpp @@ -14,12 +14,16 @@ ChatMainWindow::ChatMainWindow() setupUi(this); sendButton->setEnabled(false); - connect(messageLineEdit, SIGNAL(textChanged(QString)), - this, SLOT(textChangedSlot(QString))); - connect(sendButton, SIGNAL(clicked(bool)), this, SLOT(sendClickedSlot())); - connect(actionChangeNickname, SIGNAL(triggered(bool)), this, SLOT(changeNickname())); - connect(actionAboutQt, SIGNAL(triggered(bool)), this, SLOT(aboutQt())); - connect(qApp, SIGNAL(lastWindowClosed()), this, SLOT(exiting())); + connect(messageLineEdit, &QLineEdit::textChanged, + this, &ChatMainWindow::textChangedSlot); + connect(sendButton, &QPushButton::clicked, + this, &ChatMainWindow::sendClickedSlot); + connect(actionChangeNickname, &QAction::triggered, + this, &ChatMainWindow::changeNickname); + connect(actionAboutQt, &QAction::triggered, + this, &ChatMainWindow::aboutQt); + connect(qApp, &QApplication::lastWindowClosed, + this, &ChatMainWindow::exiting); // add our D-Bus interface and connect to D-Bus new ChatAdaptor(this); @@ -29,7 +33,8 @@ ChatMainWindow::ChatMainWindow() iface = new org::example::chat(QString(), QString(), QDBusConnection::sessionBus(), this); //connect(iface, SIGNAL(message(QString,QString)), this, SLOT(messageSlot(QString,QString))); QDBusConnection::sessionBus().connect(QString(), QString(), "org.example.chat", "message", this, SLOT(messageSlot(QString,QString))); - connect(iface, SIGNAL(action(QString,QString)), this, SLOT(actionSlot(QString,QString))); + connect(iface, &org::example::chat::action, + this, &ChatMainWindow::actionSlot); NicknameDialog dialog; dialog.cancelButton->setVisible(false); |