From 8edb3185b0f1510930f3cf65211da480a14a3e40 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sat, 6 Jun 2020 22:15:33 +0200 Subject: [PATCH] using Qt5 connections instead of the old Qt4 ones (just a subset converted right now, more TODO) --- src/clientsettingsdlg.cpp | 40 +++++++++---------- src/connectdlg.cpp | 44 ++++++++++----------- src/historygraph.cpp | 8 ++-- src/protocol.cpp | 4 +- src/server.cpp | 83 ++++++++++++++++----------------------- src/serverdlg.cpp | 64 +++++++++++++++--------------- src/serverlist.cpp | 20 +++++----- src/socket.cpp | 31 ++++++--------- src/socket.h | 5 +-- src/testbench.h | 13 +++--- src/util.cpp | 24 +++++------ 11 files changed, 156 insertions(+), 180 deletions(-) diff --git a/src/clientsettingsdlg.cpp b/src/clientsettingsdlg.cpp index 51b95b3e..50e24e33 100755 --- a/src/clientsettingsdlg.cpp +++ b/src/clientsettingsdlg.cpp @@ -369,35 +369,35 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent, // Connections ------------------------------------------------------------- // timers - QObject::connect ( &TimerStatus, SIGNAL ( timeout() ), - this, SLOT ( OnTimerStatus() ) ); + QObject::connect ( &TimerStatus, &QTimer::timeout, + this, &CClientSettingsDlg::OnTimerStatus ); // slider controls - QObject::connect ( sldNetBuf, SIGNAL ( valueChanged ( int ) ), - this, SLOT ( OnNetBufValueChanged ( int ) ) ); + QObject::connect ( sldNetBuf, &QSlider::valueChanged, + this, &CClientSettingsDlg::OnNetBufValueChanged ); - QObject::connect ( sldNetBufServer, SIGNAL ( valueChanged ( int ) ), - this, SLOT ( OnNetBufServerValueChanged ( int ) ) ); + QObject::connect ( sldNetBufServer, &QSlider::valueChanged, + this, &CClientSettingsDlg::OnNetBufServerValueChanged ); // check boxes - QObject::connect ( chbGUIDesignFancy, SIGNAL ( stateChanged ( int ) ), - this, SLOT ( OnGUIDesignFancyStateChanged ( int ) ) ); + QObject::connect ( chbGUIDesignFancy, &QCheckBox::stateChanged, + this, &CClientSettingsDlg::OnGUIDesignFancyStateChanged ); - QObject::connect ( chbDisplayChannelLevels, SIGNAL ( stateChanged ( int ) ), - this, SLOT ( OnDisplayChannelLevelsStateChanged ( int ) ) ); + QObject::connect ( chbDisplayChannelLevels, &QCheckBox::stateChanged, + this, &CClientSettingsDlg::OnDisplayChannelLevelsStateChanged ); - QObject::connect ( chbAutoJitBuf, SIGNAL ( stateChanged ( int ) ), - this, SLOT ( OnAutoJitBufStateChanged ( int ) ) ); + QObject::connect ( chbAutoJitBuf, &QCheckBox::stateChanged, + this, &CClientSettingsDlg::OnAutoJitBufStateChanged ); - QObject::connect ( chbEnableOPUS64, SIGNAL ( stateChanged ( int ) ), - this, SLOT ( OnEnableOPUS64StateChanged ( int ) ) ); + QObject::connect ( chbEnableOPUS64, &QCheckBox::stateChanged, + this, &CClientSettingsDlg::OnEnableOPUS64StateChanged ); // line edits - QObject::connect ( edtCentralServerAddress, SIGNAL ( editingFinished() ), - this, SLOT ( OnCentralServerAddressEditingFinished() ) ); + QObject::connect ( edtCentralServerAddress, &QLineEdit::editingFinished, + this, &CClientSettingsDlg::OnCentralServerAddressEditingFinished ); - QObject::connect ( edtNewClientLevel, SIGNAL ( editingFinished() ), - this, SLOT ( OnNewClientLevelEditingFinished() ) ); + QObject::connect ( edtNewClientLevel, &QLineEdit::editingFinished, + this, &CClientSettingsDlg::OnNewClientLevelEditingFinished ); // combo boxes QObject::connect ( cbxSoundcard, SIGNAL ( activated ( int ) ), @@ -422,8 +422,8 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent, this, SLOT ( OnAudioQualityActivated ( int ) ) ); // buttons - QObject::connect ( butDriverSetup, SIGNAL ( clicked() ), - this, SLOT ( OnDriverSetupClicked() ) ); + QObject::connect ( butDriverSetup, &QPushButton::clicked, + this, &CClientSettingsDlg::OnDriverSetupClicked ); // misc QObject::connect ( &SndCrdBufferDelayButtonGroup, diff --git a/src/connectdlg.cpp b/src/connectdlg.cpp index a711f40a..6e716a4b 100755 --- a/src/connectdlg.cpp +++ b/src/connectdlg.cpp @@ -151,46 +151,44 @@ CConnectDlg::CConnectDlg ( CClient* pNCliP, // Connections ------------------------------------------------------------- // list view - QObject::connect ( lvwServers, - SIGNAL ( itemSelectionChanged() ), - this, SLOT ( OnServerListItemSelectionChanged() ) ); + QObject::connect ( lvwServers, &QTreeWidget::itemSelectionChanged, + this, &CConnectDlg::OnServerListItemSelectionChanged ); - QObject::connect ( lvwServers, - SIGNAL ( itemDoubleClicked ( QTreeWidgetItem*, int ) ), - this, SLOT ( OnServerListItemDoubleClicked ( QTreeWidgetItem*, int ) ) ); + QObject::connect ( lvwServers, &QTreeWidget::itemDoubleClicked, + this, &CConnectDlg::OnServerListItemDoubleClicked ); - QObject::connect ( lvwServers, // to get default return key behaviour working - SIGNAL ( activated ( QModelIndex ) ), - this, SLOT ( OnConnectClicked() ) ); + // to get default return key behaviour working + QObject::connect ( lvwServers, &QTreeWidget::activated, + this, &CConnectDlg::OnConnectClicked ); // line edit - QObject::connect ( edtFilter, SIGNAL ( textEdited ( const QString& ) ), - this, SLOT ( OnFilterTextEdited ( const QString& ) ) ); + QObject::connect ( edtFilter, &QLineEdit::textEdited, + this, &CConnectDlg::OnFilterTextEdited ); // combo boxes - QObject::connect ( cbxServerAddr, SIGNAL ( editTextChanged ( const QString& ) ), - this, SLOT ( OnServerAddrEditTextChanged ( const QString& ) ) ); + QObject::connect ( cbxServerAddr, &QComboBox::editTextChanged, + this, &CConnectDlg::OnServerAddrEditTextChanged ); QObject::connect ( cbxCentServAddrType, SIGNAL ( activated ( int ) ), this, SLOT ( OnCentServAddrTypeChanged ( int ) ) ); // check boxes - QObject::connect ( chbExpandAll, SIGNAL ( stateChanged ( int ) ), - this, SLOT ( OnExpandAllStateChanged ( int ) ) ); + QObject::connect ( chbExpandAll, &QCheckBox::stateChanged, + this, &CConnectDlg::OnExpandAllStateChanged ); // buttons - QObject::connect ( butCancel, SIGNAL ( clicked() ), - this, SLOT ( close() ) ); + QObject::connect ( butCancel, &QPushButton::clicked, + this, &CConnectDlg::close ); - QObject::connect ( butConnect, SIGNAL ( clicked() ), - this, SLOT ( OnConnectClicked() ) ); + QObject::connect ( butConnect, &QPushButton::clicked, + this, &CConnectDlg::OnConnectClicked ); // timers - QObject::connect ( &TimerPing, SIGNAL ( timeout() ), - this, SLOT ( OnTimerPing() ) ); + QObject::connect ( &TimerPing, &QTimer::timeout, + this, &CConnectDlg::OnTimerPing ); - QObject::connect ( &TimerReRequestServList, SIGNAL ( timeout() ), - this, SLOT ( OnTimerReRequestServList() ) ); + QObject::connect ( &TimerReRequestServList, &QTimer::timeout, + this, &CConnectDlg::OnTimerReRequestServList ); } void CConnectDlg::Init ( const CVector& vstrIPAddresses ) diff --git a/src/historygraph.cpp b/src/historygraph.cpp index 175e9de2..eed8ffca 100644 --- a/src/historygraph.cpp +++ b/src/historygraph.cpp @@ -350,8 +350,8 @@ CJpegHistoryGraph::CJpegHistoryGraph ( const int iMaxDaysHistory ) : // Connections ------------------------------------------------------------- - QObject::connect ( &TimerDailyUpdate, SIGNAL ( timeout() ), - this, SLOT ( OnTimerDailyUpdate() ) ); + QObject::connect ( &TimerDailyUpdate, &QTimer::timeout, + this, &CJpegHistoryGraph::OnTimerDailyUpdate ); } // Override Update to blank out the plot area each time @@ -426,8 +426,8 @@ CSvgHistoryGraph::CSvgHistoryGraph ( const int iMaxDaysHistory ) : // Connections ------------------------------------------------------------- - QObject::connect ( &TimerDailyUpdate, SIGNAL ( timeout() ), - this, SLOT ( OnTimerDailyUpdate() ) ); + QObject::connect ( &TimerDailyUpdate, &QTimer::timeout, + this, &CSvgHistoryGraph::OnTimerDailyUpdate ); } // Override Update to create the fresh SVG stream each time diff --git a/src/protocol.cpp b/src/protocol.cpp index 50be6eb5..e72d171e 100755 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -389,8 +389,8 @@ CProtocol::CProtocol() // Connections ------------------------------------------------------------- - QObject::connect ( &TimerSendMess, SIGNAL ( timeout() ), - this, SLOT ( OnTimerSendMess() ) ); + QObject::connect ( &TimerSendMess, &QTimer::timeout, + this, &CProtocol::OnTimerSendMess ); } void CProtocol::Reset() diff --git a/src/server.cpp b/src/server.cpp index fa25b694..0945fe43 100755 --- a/src/server.cpp +++ b/src/server.cpp @@ -417,68 +417,53 @@ CServer::CServer ( const int iNewMaxNumChan, // Connections ------------------------------------------------------------- // connect timer timeout signal - QObject::connect ( &HighPrecisionTimer, SIGNAL ( timeout() ), - this, SLOT ( OnTimer() ) ); + QObject::connect ( &HighPrecisionTimer, &CHighPrecisionTimer::timeout, + this, &CServer::OnTimer ); - QObject::connect ( &ConnLessProtocol, - SIGNAL ( CLMessReadyForSending ( CHostAddress, CVector ) ), - this, SLOT ( OnSendCLProtMessage ( CHostAddress, CVector ) ) ); + QObject::connect ( &ConnLessProtocol, &CProtocol::CLMessReadyForSending, + this, &CServer::OnSendCLProtMessage ); - QObject::connect ( &ConnLessProtocol, - SIGNAL ( CLPingReceived ( CHostAddress, int ) ), - this, SLOT ( OnCLPingReceived ( CHostAddress, int ) ) ); + QObject::connect ( &ConnLessProtocol, &CProtocol::CLPingReceived, + this, &CServer::OnCLPingReceived ); - QObject::connect ( &ConnLessProtocol, - SIGNAL ( CLPingWithNumClientsReceived ( CHostAddress, int, int ) ), - this, SLOT ( OnCLPingWithNumClientsReceived ( CHostAddress, int, int ) ) ); + QObject::connect ( &ConnLessProtocol, &CProtocol::CLPingWithNumClientsReceived, + this, &CServer::OnCLPingWithNumClientsReceived ); - QObject::connect ( &ConnLessProtocol, - SIGNAL ( CLRegisterServerReceived ( CHostAddress, CHostAddress, CServerCoreInfo ) ), - this, SLOT ( OnCLRegisterServerReceived ( CHostAddress, CHostAddress, CServerCoreInfo ) ) ); + QObject::connect ( &ConnLessProtocol, &CProtocol::CLRegisterServerReceived, + this, &CServer::OnCLRegisterServerReceived ); - QObject::connect ( &ConnLessProtocol, - SIGNAL ( CLUnregisterServerReceived ( CHostAddress ) ), - this, SLOT ( OnCLUnregisterServerReceived ( CHostAddress ) ) ); + QObject::connect ( &ConnLessProtocol, &CProtocol::CLUnregisterServerReceived, + this, &CServer::OnCLUnregisterServerReceived ); - QObject::connect ( &ConnLessProtocol, - SIGNAL ( CLReqServerList ( CHostAddress ) ), - this, SLOT ( OnCLReqServerList ( CHostAddress ) ) ); + QObject::connect ( &ConnLessProtocol, &CProtocol::CLReqServerList, + this, &CServer::OnCLReqServerList ); - QObject::connect ( &ConnLessProtocol, - SIGNAL ( CLRegisterServerResp ( CHostAddress, ESvrRegResult ) ), - this, SLOT ( OnCLRegisterServerResp ( CHostAddress, ESvrRegResult ) ) ); + QObject::connect ( &ConnLessProtocol, &CProtocol::CLRegisterServerResp, + this, &CServer::OnCLRegisterServerResp ); - QObject::connect ( &ConnLessProtocol, - SIGNAL ( CLSendEmptyMes ( CHostAddress ) ), - this, SLOT ( OnCLSendEmptyMes ( CHostAddress ) ) ); + QObject::connect ( &ConnLessProtocol, &CProtocol::CLSendEmptyMes, + this, &CServer::OnCLSendEmptyMes ); - QObject::connect ( &ConnLessProtocol, - SIGNAL ( CLDisconnection ( CHostAddress ) ), - this, SLOT ( OnCLDisconnection ( CHostAddress ) ) ); + QObject::connect ( &ConnLessProtocol, &CProtocol::CLDisconnection, + this, &CServer::OnCLDisconnection ); - QObject::connect ( &ConnLessProtocol, - SIGNAL ( CLReqVersionAndOS ( CHostAddress ) ), - this, SLOT ( OnCLReqVersionAndOS ( CHostAddress ) ) ); + QObject::connect ( &ConnLessProtocol, &CProtocol::CLReqVersionAndOS, + this, &CServer::OnCLReqVersionAndOS ); - QObject::connect ( &ConnLessProtocol, - SIGNAL ( CLReqConnClientsList ( CHostAddress ) ), - this, SLOT ( OnCLReqConnClientsList ( CHostAddress ) ) ); + QObject::connect ( &ConnLessProtocol, &CProtocol::CLReqConnClientsList, + this, &CServer::OnCLReqConnClientsList ); - QObject::connect ( &ServerListManager, - SIGNAL ( SvrRegStatusChanged() ), - SIGNAL ( SvrRegStatusChanged() ) ); + QObject::connect ( &ServerListManager, &CServerListManager::SvrRegStatusChanged, + this, &CServer::SvrRegStatusChanged ); - QObject::connect( &JamRecorder, - SIGNAL ( RecordingSessionStarted ( QString ) ), - SIGNAL ( RecordingSessionStarted ( QString ) ) ); + QObject::connect( &JamRecorder, &recorder::CJamRecorder::RecordingSessionStarted, + this, &CServer::RecordingSessionStarted ); - QObject::connect ( QCoreApplication::instance(), - SIGNAL ( aboutToQuit() ), - this, SLOT ( OnAboutToQuit() ) ); + QObject::connect ( QCoreApplication::instance(), &QCoreApplication::aboutToQuit, + this, &CServer::OnAboutToQuit ); - QObject::connect ( pSignalHandler, - SIGNAL ( HandledSignal ( int ) ), - this, SLOT ( OnHandledSignal ( int ) ) ); + QObject::connect ( pSignalHandler, &CSignalHandler::HandledSignal, + this, &CServer::OnHandledSignal ); connectChannelSignalsToServerSlots(); @@ -532,10 +517,10 @@ inline void CServer::connectChannelSignalsToServerSlots() this, pOnServerAutoSockBufSizeChangeCh ); connectChannelSignalsToServerSlots(); -}; +} template<> -inline void CServer::connectChannelSignalsToServerSlots<0>() {}; +inline void CServer::connectChannelSignalsToServerSlots<0>() {} void CServer::CreateAndSendJitBufMessage ( const int iCurChanID, const int iNNumFra ) diff --git a/src/serverdlg.cpp b/src/serverdlg.cpp index 72ab904e..3b6c9c0b 100755 --- a/src/serverdlg.cpp +++ b/src/serverdlg.cpp @@ -334,27 +334,27 @@ lvwClients->setMinimumHeight ( 140 ); // Connections ------------------------------------------------------------- // check boxes - QObject::connect ( chbRegisterServer, SIGNAL ( stateChanged ( int ) ), - this, SLOT ( OnRegisterServerStateChanged ( int ) ) ); + QObject::connect ( chbRegisterServer, &QCheckBox::stateChanged, + this, &CServerDlg::OnRegisterServerStateChanged ); - QObject::connect ( chbStartOnOSStart, SIGNAL ( stateChanged ( int ) ), - this, SLOT ( OnStartOnOSStartStateChanged ( int ) ) ); + QObject::connect ( chbStartOnOSStart, &QCheckBox::stateChanged, + this, &CServerDlg::OnStartOnOSStartStateChanged ); - QObject::connect ( chbUseCCLicence, SIGNAL ( stateChanged ( int ) ), - this, SLOT ( OnUseCCLicenceStateChanged ( int ) ) ); + QObject::connect ( chbUseCCLicence, &QCheckBox::stateChanged, + this, &CServerDlg::OnUseCCLicenceStateChanged ); - QObject::connect ( chbEnableRecorder, SIGNAL ( stateChanged ( int ) ), - this, SLOT ( OnEnableRecorderStateChanged ( int ) ) ); + QObject::connect ( chbEnableRecorder, &QCheckBox::stateChanged, + this, &CServerDlg::OnEnableRecorderStateChanged ); // line edits - QObject::connect ( edtCentralServerAddress, SIGNAL ( editingFinished() ), - this, SLOT ( OnCentralServerAddressEditingFinished() ) ); + QObject::connect ( edtCentralServerAddress, &QLineEdit::editingFinished, + this, &CServerDlg::OnCentralServerAddressEditingFinished ); - QObject::connect ( edtServerName, SIGNAL ( textChanged ( const QString& ) ), - this, SLOT ( OnServerNameTextChanged ( const QString& ) ) ); + QObject::connect ( edtServerName, &QLineEdit::textChanged, + this, &CServerDlg::OnServerNameTextChanged ); - QObject::connect ( edtLocationCity, SIGNAL ( textChanged ( const QString& ) ), - this, SLOT ( OnLocationCityTextChanged ( const QString& ) ) ); + QObject::connect ( edtLocationCity, &QLineEdit::textChanged, + this, &CServerDlg::OnLocationCityTextChanged ); // combo boxes QObject::connect ( cbxLocationCountry, SIGNAL ( activated ( int ) ), @@ -364,34 +364,34 @@ lvwClients->setMinimumHeight ( 140 ); this, SLOT ( OnCentServAddrTypeActivated ( int ) ) ); // push buttons - QObject::connect ( pbtNewRecording, SIGNAL ( released() ), - this, SLOT ( OnNewRecordingClicked() ) ); + QObject::connect ( pbtNewRecording, &QPushButton::released, + this, &CServerDlg::OnNewRecordingClicked ); // timers - QObject::connect ( &Timer, SIGNAL ( timeout() ), this, SLOT ( OnTimer() ) ); + QObject::connect ( &Timer, &QTimer::timeout, + this, &CServerDlg::OnTimer ); // other - QObject::connect ( pServer, SIGNAL ( Started() ), - this, SLOT ( OnServerStarted() ) ); + QObject::connect ( pServer, &CServer::Started, + this, &CServerDlg::OnServerStarted ); - QObject::connect ( pServer, SIGNAL ( Stopped() ), - this, SLOT ( OnServerStopped() ) ); + QObject::connect ( pServer, &CServer::Stopped, + this, &CServerDlg::OnServerStopped ); - QObject::connect ( pServer, SIGNAL ( SvrRegStatusChanged() ), - this, SLOT ( OnSvrRegStatusChanged() ) ); + QObject::connect ( pServer, &CServer::SvrRegStatusChanged, + this, &CServerDlg::OnSvrRegStatusChanged ); - QObject::connect ( pServer, SIGNAL ( RecordingSessionStarted ( QString ) ), - this, SLOT ( OnRecordingSessionStarted ( QString ) ) ); + QObject::connect ( pServer, &CServer::RecordingSessionStarted, + this, &CServerDlg::OnRecordingSessionStarted ); - QObject::connect ( pServer, SIGNAL ( StopRecorder() ), - this, SLOT ( OnStopRecorder() ) ); + QObject::connect ( pServer, &CServer::StopRecorder, + this, &CServerDlg::OnStopRecorder ); - QObject::connect ( QCoreApplication::instance(), SIGNAL ( aboutToQuit() ), - this, SLOT ( OnAboutToQuit() ) ); + QObject::connect ( QCoreApplication::instance(), &QCoreApplication::aboutToQuit, + this, &CServerDlg::OnAboutToQuit ); - QObject::connect ( &SystemTrayIcon, - SIGNAL ( activated ( QSystemTrayIcon::ActivationReason ) ), - this, SLOT ( OnSysTrayActivated ( QSystemTrayIcon::ActivationReason ) ) ); + QObject::connect ( &SystemTrayIcon, &QSystemTrayIcon::activated, + this, &CServerDlg::OnSysTrayActivated ); // Timers ------------------------------------------------------------------ diff --git a/src/serverlist.cpp b/src/serverlist.cpp index 1d8e1a48..2ef745c1 100755 --- a/src/serverlist.cpp +++ b/src/serverlist.cpp @@ -173,20 +173,20 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum, // Connections ------------------------------------------------------------- - QObject::connect ( &TimerPollList, SIGNAL ( timeout() ), - this, SLOT ( OnTimerPollList() ) ); + QObject::connect ( &TimerPollList, &QTimer::timeout, + this, &CServerListManager::OnTimerPollList ); - QObject::connect ( &TimerPingServerInList, SIGNAL ( timeout() ), - this, SLOT ( OnTimerPingServerInList() ) ); + QObject::connect ( &TimerPingServerInList, &QTimer::timeout, + this, &CServerListManager::OnTimerPingServerInList ); - QObject::connect ( &TimerPingCentralServer, SIGNAL ( timeout() ), - this, SLOT ( OnTimerPingCentralServer() ) ); + QObject::connect ( &TimerPingCentralServer, &QTimer::timeout, + this, &CServerListManager::OnTimerPingCentralServer ); - QObject::connect ( &TimerRegistering, SIGNAL ( timeout() ), - this, SLOT ( OnTimerRegistering() ) ); + QObject::connect ( &TimerRegistering, &QTimer::timeout, + this, &CServerListManager::OnTimerRegistering ); - QObject::connect ( &TimerCLRegisterServerResp, SIGNAL ( timeout() ), - this, SLOT ( OnTimerCLRegisterServerResp() ) ); + QObject::connect ( &TimerCLRegisterServerResp, &QTimer::timeout, + this, &CServerListManager::OnTimerCLRegisterServerResp ); } void CServerListManager::SetCentralServerAddress ( const QString sNCentServAddr ) diff --git a/src/socket.cpp b/src/socket.cpp index ebcddb5d..b87f9d5f 100755 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -111,37 +111,30 @@ void CSocket::Init ( const quint16 iPortNumber ) { // client connections: - QObject::connect ( this, - SIGNAL ( ProtcolMessageReceived ( int, int, CVector, CHostAddress ) ), - pChannel, SLOT ( OnProtcolMessageReceived ( int, int, CVector, CHostAddress ) ) ); + QObject::connect ( this, &CSocket::ProtcolMessageReceived, + pChannel, &CChannel::OnProtcolMessageReceived ); - QObject::connect ( this, - SIGNAL ( ProtcolCLMessageReceived ( int, CVector, CHostAddress ) ), - pChannel, SLOT ( OnProtcolCLMessageReceived ( int, CVector, CHostAddress ) ) ); + QObject::connect ( this, &CSocket::ProtcolCLMessageReceived, + pChannel, &CChannel::OnProtcolCLMessageReceived ); - QObject::connect ( this, - SIGNAL ( NewConnection() ), + QObject::connect ( this, SIGNAL ( NewConnection() ), pChannel, SLOT ( OnNewConnection() ) ); } else { // server connections: - QObject::connect ( this, - SIGNAL ( ProtcolMessageReceived ( int, int, CVector, CHostAddress ) ), - pServer, SLOT ( OnProtcolMessageReceived ( int, int, CVector, CHostAddress ) ) ); + QObject::connect ( this, &CSocket::ProtcolMessageReceived, + pServer, &CServer::OnProtcolMessageReceived ); - QObject::connect ( this, - SIGNAL ( ProtcolCLMessageReceived ( int, CVector, CHostAddress ) ), - pServer, SLOT ( OnProtcolCLMessageReceived ( int, CVector, CHostAddress ) ) ); + QObject::connect ( this, &CSocket::ProtcolCLMessageReceived, + pServer, &CServer::OnProtcolCLMessageReceived ); - QObject::connect ( this, - SIGNAL ( NewConnection ( int, CHostAddress ) ), + QObject::connect ( this, SIGNAL ( NewConnection ( int, CHostAddress ) ), pServer, SLOT ( OnNewConnection ( int, CHostAddress ) ) ); - QObject::connect ( this, - SIGNAL ( ServerFull ( CHostAddress ) ), - pServer, SLOT ( OnServerFull ( CHostAddress ) ) ); + QObject::connect ( this, &CSocket::ServerFull, + pServer, &CServer::OnServerFull ); } } diff --git a/src/socket.h b/src/socket.h index 864b82c5..e040f8a7 100755 --- a/src/socket.h +++ b/src/socket.h @@ -217,9 +217,8 @@ protected: NetworkWorkerThread.SetSocket ( &Socket ); // connect the "InvalidPacketReceived" signal - QObject::connect ( &Socket, - SIGNAL ( InvalidPacketReceived ( CHostAddress ) ), - SIGNAL ( InvalidPacketReceived ( CHostAddress ) ) ); + QObject::connect ( &Socket, &CSocket::InvalidPacketReceived, + this, &CHighPrioSocket::InvalidPacketReceived ); } CSocketThread NetworkWorkerThread; diff --git a/src/testbench.h b/src/testbench.h index e2dd2cda..423a2c73 100755 --- a/src/testbench.h +++ b/src/testbench.h @@ -61,14 +61,15 @@ public: } // connect protocol signals - QObject::connect ( &Protocol, SIGNAL ( MessReadyForSending ( CVector ) ), - this, SLOT ( OnSendProtMessage ( CVector ) ) ); - QObject::connect ( &Protocol, SIGNAL ( CLMessReadyForSending ( CHostAddress, CVector ) ), - this, SLOT ( OnSendCLMessage ( CHostAddress, CVector ) ) ); + QObject::connect ( &Protocol, &CProtocol::MessReadyForSending, + this, &CTestbench::OnSendProtMessage ); + + QObject::connect ( &Protocol, &CProtocol::CLMessReadyForSending, + this, &CTestbench::OnSendCLMessage ); // connect and start the timer (testbench heartbeat) - QObject::connect ( &Timer, SIGNAL ( timeout() ), - this, SLOT ( OnTimer() ) ); + QObject::connect ( &Timer, &QTimer::timeout, + this, &CTestbench::OnTimer ); Timer.start ( 1 ); // 1 ms } diff --git a/src/util.cpp b/src/util.cpp index a6e5eb0e..9ede9148 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -531,14 +531,14 @@ CLicenceDlg::CLicenceDlg ( QWidget* parent ) : QDialog ( parent ) tr ( "You may not apply legal terms or technological measures that legally restrict " "others from doing anything the license permits." ) + "

" ); - QObject::connect ( chbAgree, SIGNAL ( stateChanged ( int ) ), - this, SLOT ( OnAgreeStateChanged ( int ) ) ); + QObject::connect ( chbAgree, &QCheckBox::stateChanged, + this, &CLicenceDlg::OnAgreeStateChanged ); - QObject::connect ( butAccept, SIGNAL ( clicked() ), - this, SLOT ( accept() ) ); + QObject::connect ( butAccept, &QPushButton::clicked, + this, &CLicenceDlg::accept ); - QObject::connect ( butDecline, SIGNAL ( clicked() ), - this, SLOT ( reject() ) ); + QObject::connect ( butDecline, &QPushButton::clicked, + this, &CLicenceDlg::reject ); } @@ -728,8 +728,8 @@ CMusProfDlg::CMusProfDlg ( CClient* pNCliP, // Connections ------------------------------------------------------------- - QObject::connect ( pedtAlias, SIGNAL ( textChanged ( const QString& ) ), - this, SLOT ( OnAliasTextChanged ( const QString& ) ) ); + QObject::connect ( pedtAlias, &QLineEdit::textChanged, + this, &CMusProfDlg::OnAliasTextChanged ); QObject::connect ( pcbxInstrument, SIGNAL ( activated ( int ) ), this, SLOT ( OnInstrumentActivated ( int ) ) ); @@ -737,14 +737,14 @@ CMusProfDlg::CMusProfDlg ( CClient* pNCliP, QObject::connect ( pcbxCountry, SIGNAL ( activated ( int ) ), this, SLOT ( OnCountryActivated ( int ) ) ); - QObject::connect ( pedtCity, SIGNAL ( textChanged ( const QString& ) ), - this, SLOT ( OnCityTextChanged ( const QString& ) ) ); + QObject::connect ( pedtCity, &QLineEdit::textChanged, + this, &CMusProfDlg::OnCityTextChanged ); QObject::connect ( pcbxSkill, SIGNAL ( activated ( int ) ), this, SLOT ( OnSkillActivated ( int ) ) ); - QObject::connect ( butClose, SIGNAL ( clicked() ), - this, SLOT ( accept() ) ); + QObject::connect ( butClose, &QPushButton::clicked, + this, &CMusProfDlg::accept ); } void CMusProfDlg::showEvent ( QShowEvent* )