Skip to content

Commit 6457f1e

Browse files
committed
examples: port dbus examples to new connection style
Task-number: QTBUG-106893 Change-Id: Ic857f694b836fba30e41ef0a40107917bd05b64c Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
1 parent 93f15f8 commit 6457f1e

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

examples/dbus/chat/chat.cpp

+12-7
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ ChatMainWindow::ChatMainWindow()
1414
setupUi(this);
1515
sendButton->setEnabled(false);
1616

17-
connect(messageLineEdit, SIGNAL(textChanged(QString)),
18-
this, SLOT(textChangedSlot(QString)));
19-
connect(sendButton, SIGNAL(clicked(bool)), this, SLOT(sendClickedSlot()));
20-
connect(actionChangeNickname, SIGNAL(triggered(bool)), this, SLOT(changeNickname()));
21-
connect(actionAboutQt, SIGNAL(triggered(bool)), this, SLOT(aboutQt()));
22-
connect(qApp, SIGNAL(lastWindowClosed()), this, SLOT(exiting()));
17+
connect(messageLineEdit, &QLineEdit::textChanged,
18+
this, &ChatMainWindow::textChangedSlot);
19+
connect(sendButton, &QPushButton::clicked,
20+
this, &ChatMainWindow::sendClickedSlot);
21+
connect(actionChangeNickname, &QAction::triggered,
22+
this, &ChatMainWindow::changeNickname);
23+
connect(actionAboutQt, &QAction::triggered,
24+
this, &ChatMainWindow::aboutQt);
25+
connect(qApp, &QApplication::lastWindowClosed,
26+
this, &ChatMainWindow::exiting);
2327

2428
// add our D-Bus interface and connect to D-Bus
2529
new ChatAdaptor(this);
@@ -29,7 +33,8 @@ ChatMainWindow::ChatMainWindow()
2933
iface = new org::example::chat(QString(), QString(), QDBusConnection::sessionBus(), this);
3034
//connect(iface, SIGNAL(message(QString,QString)), this, SLOT(messageSlot(QString,QString)));
3135
QDBusConnection::sessionBus().connect(QString(), QString(), "org.example.chat", "message", this, SLOT(messageSlot(QString,QString)));
32-
connect(iface, SIGNAL(action(QString,QString)), this, SLOT(actionSlot(QString,QString)));
36+
connect(iface, &org::example::chat::action,
37+
this, &ChatMainWindow::actionSlot);
3338

3439
NicknameDialog dialog;
3540
dialog.cancelButton->setVisible(false);

0 commit comments

Comments
 (0)