From 6457f1ee71e5de3b14bc30b9e9a22d3a7534a196 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Thu, 22 Sep 2022 22:37:03 +0200 Subject: examples: port dbus examples to new connection style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-106893 Change-Id: Ic857f694b836fba30e41ef0a40107917bd05b64c Reviewed-by: Jörg Bornemann --- examples/dbus/chat/chat.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'examples') 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); -- cgit v1.2.3