@@ -79,12 +79,12 @@ ConnectionWindow::ConnectionWindow(QWidget *parent) :
79
79
// Need to make sure it tries to share the address in case there are
80
80
// multiple instances of SavvyCAN running.
81
81
rxBroadcastGVRET->bind (QHostAddress::AnyIPv4, 17222 , QAbstractSocket::ShareAddress);
82
- connect (rxBroadcastGVRET, SIGNAL ( readyRead ()) , this , SLOT ( readPendingDatagrams ()) );
82
+ connect (rxBroadcastGVRET, &QUdpSocket:: readyRead, this , &ConnectionWindow:: readPendingDatagrams);
83
83
84
84
// Doing the same for socketcand/kayak hosts:
85
85
rxBroadcastKayak = new QUdpSocket (this );
86
86
rxBroadcastKayak->bind (QHostAddress::AnyIPv4, 42000 , QAbstractSocket::ShareAddress);
87
- connect (rxBroadcastKayak, SIGNAL ( readyRead ()) , this , SLOT ( readPendingDatagrams ()) );
87
+ connect (rxBroadcastKayak, &QUdpSocket:: readyRead, this , &ConnectionWindow:: readPendingDatagrams);
88
88
89
89
}
90
90
@@ -236,12 +236,12 @@ void ConnectionWindow::consoleEnableChanged(bool checked) {
236
236
CANConnection* conn_p = connModel->getAtIdx (selIdx);
237
237
238
238
if (checked) { // enable console
239
- connect (conn_p, SIGNAL ( debugOutput (QString)) , this , SLOT ( getDebugText (QString)) );
240
- connect (this , SIGNAL ( sendDebugData (QByteArray)) , conn_p, SLOT ( debugInput (QByteArray)) );
239
+ connect (conn_p, &CANConnection:: debugOutput, this , &ConnectionWindow:: getDebugText, Qt::UniqueConnection );
240
+ connect (this , &ConnectionWindow:: sendDebugData, conn_p, &CANConnection:: debugInput, Qt::UniqueConnection );
241
241
}
242
242
else { // turn it off
243
- disconnect (conn_p, SIGNAL ( debugOutput (QString)) , nullptr , nullptr );
244
- disconnect (this , SIGNAL ( sendDebugData (QByteArray)) , conn_p, SLOT ( debugInput (QByteArray)) );
243
+ disconnect (conn_p, &CANConnection:: debugOutput, nullptr , nullptr );
244
+ disconnect (this , &ConnectionWindow:: sendDebugData, conn_p, &CANConnection:: debugInput);
245
245
}
246
246
}
247
247
@@ -454,8 +454,8 @@ void ConnectionWindow::currentRowChanged(const QModelIndex ¤t, const QMode
454
454
int selIdx = current.row ();
455
455
CANConnection* prevConn = connModel->getAtIdx (previous.row ());
456
456
if (prevConn != nullptr )
457
- disconnect (prevConn, SIGNAL ( debugOutput (QString)) , nullptr , nullptr );
458
- disconnect (this , SIGNAL ( sendDebugData (QByteArray)) , nullptr , nullptr );
457
+ disconnect (prevConn, &CANConnection:: debugOutput, nullptr , nullptr );
458
+ disconnect (this , &ConnectionWindow:: sendDebugData, nullptr , nullptr );
459
459
460
460
/* set parameters */
461
461
if (selIdx == -1 ) {
@@ -472,7 +472,7 @@ void ConnectionWindow::currentRowChanged(const QModelIndex ¤t, const QMode
472
472
if (!conn_p) return ;
473
473
474
474
// because this might have already been setup during the initial setup so tear that one down and then create the normal one.
475
- // disconnect(conn_p, SIGNAL( debugOutput(QString)) , 0, 0);
475
+ // disconnect(conn_p, &CANConnection:: debugOutput, 0, 0);
476
476
477
477
numBuses = conn_p->getNumBuses ();
478
478
int numB = ui->tabBuses ->count ();
@@ -485,8 +485,8 @@ void ConnectionWindow::currentRowChanged(const QModelIndex ¤t, const QMode
485
485
populateBusDetails (0 );
486
486
if (ui->ckEnableConsole ->isChecked ())
487
487
{
488
- connect (conn_p, SIGNAL ( debugOutput (QString)) , this , SLOT ( getDebugText (QString)) );
489
- connect (this , SIGNAL ( sendDebugData (QByteArray)) , conn_p, SLOT ( debugInput (QByteArray)) );
488
+ connect (conn_p, &CANConnection:: debugOutput, this , &ConnectionWindow:: getDebugText, Qt::UniqueConnection );
489
+ connect (this , &ConnectionWindow:: sendDebugData, conn_p, &CANConnection:: debugInput, Qt::UniqueConnection );
490
490
}
491
491
}
492
492
}
@@ -524,12 +524,11 @@ CANConnection* ConnectionWindow::create(CANCon::type pTye, QString pPortName, QS
524
524
if (conn_p)
525
525
{
526
526
/* connect signal */
527
- connect (conn_p, SIGNAL (status (CANConStatus)),
528
- this , SLOT (connectionStatus (CANConStatus)));
527
+ connect (conn_p, &CANConnection::status, this , &ConnectionWindow::connectionStatus);
529
528
if (ui->ckEnableConsole ->isChecked ())
530
529
{
531
530
// set up the debug console to operate if we've selected it. Doing so here allows debugging right away during set up
532
- connect (conn_p, SIGNAL ( debugOutput (QString)) , this , SLOT ( getDebugText (QString)) );
531
+ connect (conn_p, &CANConnection:: debugOutput, this , &ConnectionWindow:: getDebugText, Qt::UniqueConnection );
533
532
}
534
533
/* TODO add return value and checks */
535
534
conn_p->start ();
0 commit comments