mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Fix deprecated in GUI utility class
This commit is contained in:
committed by
Mat Sutcliffe
parent
f8e8318902
commit
7d068cf979
@@ -690,7 +690,9 @@ namespace BlackGui
|
||||
|
||||
void CGuiUtility::centerWidget(QWidget *widget)
|
||||
{
|
||||
const QRect screenGeometry = QApplication::desktop()->screenGeometry();
|
||||
// const QRect screenGeometry = QApplication::desktop()->screenGeometry();
|
||||
const QScreen *pScreen = QGuiApplication::screenAt(widget->mapToGlobal({widget->width() / 2, 0}));
|
||||
const QRect screenGeometry = pScreen->availableGeometry();
|
||||
const int x = (screenGeometry.width() - widget->width()) / 2;
|
||||
const int y = (screenGeometry.height() - widget->height()) / 2;
|
||||
widget->move(x, y);
|
||||
|
||||
Reference in New Issue
Block a user