debug: Window: 当编译为Debug时固定窗口大小

方便双显示器上下排列时的显示.
This commit is contained in:
Calcitem 2019-11-23 23:27:26 +08:00
parent eec33160fb
commit 03069e2bf2
2 changed files with 7 additions and 0 deletions

View File

@ -28,7 +28,9 @@ int main(int argc, char *argv[])
QApplication a(argc, argv);
MillGameWindow w;
w.show();
#ifndef _DEBUG
w.move((QApplication::desktop()->width() - w.width()) / 4, (QApplication::desktop()->height() - w.height()) / 2);
#endif
return QApplication::exec();
}

View File

@ -97,6 +97,11 @@ MillGameWindow::MillGameWindow(QWidget * parent) :
int unith = (deskTopRect.height() - height()) / 2;
this->move(unitw, unith);
#ifdef _DEBUG
this->setFixedWidth(width());
this->setFixedHeight(height());
#endif
#ifdef MOBILE_APP_UI
// 隐藏菜单栏、工具栏、状态栏等
ui.menuBar->setVisible(false);