mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 03:25:02 +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){
|
||||
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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue