chore:生成到画面中间

This commit is contained in:
momen 2025-07-27 15:23:57 +08:00
parent de581fd000
commit cfa8e04755

View File

@ -75,6 +75,12 @@ MainWindow::MainWindow(QWidget *parent)
watcher->setFuture(QtConcurrent::run([this](){
runAptssUpgrade();
}));
QScreen *screen = QGuiApplication::screenAt(QCursor::pos());
if (!screen) screen = QGuiApplication::primaryScreen();
QRect screenGeometry = screen->geometry();
int x = screenGeometry.x() + (screenGeometry.width() - this->width()) / 2;
int y = screenGeometry.y() + (screenGeometry.height() - this->height()) / 2;
this->move(x, y);
}
//初始化控件样式
void MainWindow::initStyle()