Skip to content

Commit

Permalink
Make code backward compatible with Qt 5.12
Browse files Browse the repository at this point in the history
Names of the signals changed between Qt 5.12 and 5.15,
while we still need to maintain compatibility with 5.12

Signed-off-by: Viktor Kopp <[email protected]>
  • Loading branch information
vifactor committed Sep 12, 2024
1 parent 95655b7 commit 014e82b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3532,7 +3532,11 @@ void MainWindow::connectECU(EcuItem* ecuitem,bool force)
disconnect(ecuitem->socket,0,0,0);
connect(ecuitem->socket,SIGNAL(connected()),this,SLOT(connected()));
connect(ecuitem->socket,SIGNAL(disconnected()),this,SLOT(disconnected()));
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(ecuitem->socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(error(QAbstractSocket::SocketError)));
#else
connect(ecuitem->socket, &QAbstractSocket::errorOccurred, this, &MainWindow::error);
#endif
connect(ecuitem->socket,SIGNAL(readyRead()),this,SLOT(readyRead()));
connect(ecuitem->socket,SIGNAL(stateChanged(QAbstractSocket::SocketState)),this,SLOT(stateChangedIP(QAbstractSocket::SocketState)));
ecuitem->socket->connectToHost(ecuitem->getHostname(),ecuitem->getIpport());
Expand Down Expand Up @@ -3615,7 +3619,11 @@ void MainWindow::connectECU(EcuItem* ecuitem,bool force)

connect(ecuitem->socket,SIGNAL(connected()),this,SLOT(connected()));
connect(ecuitem->socket,SIGNAL(disconnected()),this,SLOT(disconnected()));
connect(ecuitem->socket,&QAbstractSocket::errorOccurred, this, &MainWindow::error);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect(ecuitem->socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(error(QAbstractSocket::SocketError)));
#else
connect(ecuitem->socket, &QAbstractSocket::errorOccurred, this, &MainWindow::error);
#endif
connect(ecuitem->socket,SIGNAL(readyRead()),this,SLOT(readyRead()));
connect(ecuitem->socket,SIGNAL(stateChanged(QAbstractSocket::SocketState)),this,SLOT(stateChangedIP(QAbstractSocket::SocketState)));
ecuitem->update();
Expand Down

0 comments on commit 014e82b

Please sign in to comment.