@@ -14,12 +14,16 @@ ChatMainWindow::ChatMainWindow()
14
14
setupUi (this );
15
15
sendButton->setEnabled (false );
16
16
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);
23
27
24
28
// add our D-Bus interface and connect to D-Bus
25
29
new ChatAdaptor (this );
@@ -29,7 +33,8 @@ ChatMainWindow::ChatMainWindow()
29
33
iface = new org::example::chat (QString (), QString (), QDBusConnection::sessionBus (), this );
30
34
// connect(iface, SIGNAL(message(QString,QString)), this, SLOT(messageSlot(QString,QString)));
31
35
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);
33
38
34
39
NicknameDialog dialog;
35
40
dialog.cancelButton ->setVisible (false );
0 commit comments