From 774e57779d9d017b19a4f549582177d420dc13d6 Mon Sep 17 00:00:00 2001 From: rankun Date: Mon, 5 Nov 2018 11:18:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=98=BE=E7=A4=BA=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/videoform.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/videoform.cpp b/src/videoform.cpp index 7f0849a..73760b1 100644 --- a/src/videoform.cpp +++ b/src/videoform.cpp @@ -22,18 +22,16 @@ VideoForm::VideoForm(QWidget *parent) : connect(m_server, &Server::connectToResult, this, [this](bool success, const QString &deviceName, const QSize &size){ if (success) { + // update ui setWindowTitle(deviceName); - updateShowSize(size); - // 双屏有问题,位置有问题 QDesktopWidget* desktop = QApplication::desktop(); if (desktop) { - QSize screenSize = desktop->size(); - if (!screenSize.isEmpty()) { - move((screenSize.width() - width())/2, (screenSize.height() - height())/2); - } + QRect mainScreenRc = desktop->availableGeometry(); + move((mainScreenRc.width() - width())/2, (mainScreenRc.height() - height())/2); } + // init decode m_decoder.setDeviceSocket(m_server->getDeviceSocketByThread(&m_decoder)); m_decoder.startDecode(); }