mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-02 05:48:38 +00:00
调整显示位置
This commit is contained in:
parent
dd467b76c1
commit
774e57779d
1 changed files with 4 additions and 6 deletions
|
@ -22,18 +22,16 @@ VideoForm::VideoForm(QWidget *parent) :
|
||||||
|
|
||||||
connect(m_server, &Server::connectToResult, this, [this](bool success, const QString &deviceName, const QSize &size){
|
connect(m_server, &Server::connectToResult, this, [this](bool success, const QString &deviceName, const QSize &size){
|
||||||
if (success) {
|
if (success) {
|
||||||
|
// update ui
|
||||||
setWindowTitle(deviceName);
|
setWindowTitle(deviceName);
|
||||||
|
|
||||||
updateShowSize(size);
|
updateShowSize(size);
|
||||||
// 双屏有问题,位置有问题
|
|
||||||
QDesktopWidget* desktop = QApplication::desktop();
|
QDesktopWidget* desktop = QApplication::desktop();
|
||||||
if (desktop) {
|
if (desktop) {
|
||||||
QSize screenSize = desktop->size();
|
QRect mainScreenRc = desktop->availableGeometry();
|
||||||
if (!screenSize.isEmpty()) {
|
move((mainScreenRc.width() - width())/2, (mainScreenRc.height() - height())/2);
|
||||||
move((screenSize.width() - width())/2, (screenSize.height() - height())/2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// init decode
|
||||||
m_decoder.setDeviceSocket(m_server->getDeviceSocketByThread(&m_decoder));
|
m_decoder.setDeviceSocket(m_server->getDeviceSocketByThread(&m_decoder));
|
||||||
m_decoder.startDecode();
|
m_decoder.startDecode();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue