mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
Fix deprecated in GUI utility class
This commit is contained in:
committed by
Mat Sutcliffe
parent
f8e8318902
commit
7d068cf979
@@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>260</width>
|
<width>300</width>
|
||||||
<height>367</height>
|
<height>367</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -159,9 +159,6 @@
|
|||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="tabStopWidth">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -200,9 +197,6 @@
|
|||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="tabStopWidth">
|
|
||||||
<number>10</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
@@ -690,7 +690,9 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CGuiUtility::centerWidget(QWidget *widget)
|
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 x = (screenGeometry.width() - widget->width()) / 2;
|
||||||
const int y = (screenGeometry.height() - widget->height()) / 2;
|
const int y = (screenGeometry.height() - widget->height()) / 2;
|
||||||
widget->move(x, y);
|
widget->move(x, y);
|
||||||
|
|||||||
Reference in New Issue
Block a user