mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-10-04 09:32:21 +08:00
chore:生成到画面中间
This commit is contained in:
parent
de581fd000
commit
cfa8e04755
@ -75,6 +75,12 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
watcher->setFuture(QtConcurrent::run([this](){
|
watcher->setFuture(QtConcurrent::run([this](){
|
||||||
runAptssUpgrade();
|
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()
|
void MainWindow::initStyle()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user