diff --git a/HX_CameraLoopPlay/CameraLoopPlay.cpp b/HX_CameraLoopPlay/CameraLoopPlay.cpp index f6aeb28..35d83c2 100644 --- a/HX_CameraLoopPlay/CameraLoopPlay.cpp +++ b/HX_CameraLoopPlay/CameraLoopPlay.cpp @@ -35,6 +35,8 @@ CameraLoopPlay::CameraLoopPlay(QWidget* parent) connect(this, &CameraLoopPlay::realPlaySignal, m_cameraThread, &CameraThread::realPlay); connect(this, &CameraLoopPlay::stopReadPlaySignal, m_cameraThread, &CameraThread::stopRealPlay); + connect(m_cameraThread, &CameraThread::loginResultSignal, this, &CameraLoopPlay::loginResult); + m_cameraLoopThread->start(); calendarTimerUpdater(); @@ -119,6 +121,14 @@ void CameraLoopPlay::changeWindowNumber(int index) } } +void CameraLoopPlay::loginResult(int a, int b) +{ + if (a >= 0) { + m_treeCameraItemList[b]->setIcon( + QIcon(":/CameraLoopPlay/Resource/image/online.png")); + } +} + void CameraLoopPlay::addCameraWidgetToCameraFarmes(int rows, int cols) { // 清除已有的布局项 diff --git a/HX_CameraLoopPlay/CameraLoopPlay.h b/HX_CameraLoopPlay/CameraLoopPlay.h index 0ef84b0..7d02130 100644 --- a/HX_CameraLoopPlay/CameraLoopPlay.h +++ b/HX_CameraLoopPlay/CameraLoopPlay.h @@ -98,6 +98,12 @@ private slots: */ void changeWindowNumber(int index); + /** + * @brief ÉãÏñÍ·µÇ¼½á¹û. + * @author XuChao (xxu715737@163.com) + * @date 2024-10-24 + */ + void loginResult(int a, int b); private: diff --git a/HX_CameraLoopPlay/CameraThread.cpp b/HX_CameraLoopPlay/CameraThread.cpp index bc76b18..8b60595 100644 --- a/HX_CameraLoopPlay/CameraThread.cpp +++ b/HX_CameraLoopPlay/CameraThread.cpp @@ -51,6 +51,7 @@ void CameraThread::login(QString strIP, QString strUser, QString strPwd, int hWn HWNDlogin.insert(hWndIndex, loginId); iIpcStartChan.insert(hWndIndex, struDeviceInfoV40.struDeviceV30.byStartChan); + emit loginResultSignal(loginId, hWndIndex); } bool CameraThread::realPlay(HWND hWnd, int index) diff --git a/HX_CameraLoopPlay/CameraThread.h b/HX_CameraLoopPlay/CameraThread.h index 9fd7f44..c3ef629 100644 --- a/HX_CameraLoopPlay/CameraThread.h +++ b/HX_CameraLoopPlay/CameraThread.h @@ -22,7 +22,7 @@ public: ~CameraThread(); signals: - void loginResultSignal(long loginId, int iRealPlayHandle, int hWndIndex); + void loginResultSignal(long loginId, int iRealPlayHandle); public slots: /**