C++98 compatibility.
This commit is contained in:
@@ -10,10 +10,10 @@ static void centerWidget(QWidget* widget)
|
||||
if (widget)
|
||||
{
|
||||
QDesktopWidget deskWidget;
|
||||
const auto screenIndex = deskWidget.primaryScreen();
|
||||
const auto deskRect = deskWidget.availableGeometry(screenIndex);
|
||||
const auto x = (deskRect.width() - widget->rect().width()) / 2;
|
||||
const auto y = (deskRect.height() - widget->rect().height()) / 2;
|
||||
const int screenIndex = deskWidget.primaryScreen();
|
||||
const QRect deskRect = deskWidget.availableGeometry(screenIndex);
|
||||
const int x = (deskRect.width() - widget->rect().width()) / 2;
|
||||
const int y = (deskRect.height() - widget->rect().height()) / 2;
|
||||
widget->move(x, y);
|
||||
}
|
||||
}
|
||||
@@ -23,10 +23,10 @@ static void resizeWidgetPerCent(QWidget* widget, qreal widthPC, qreal heightPC)
|
||||
if (widget && widthPC >= 0.0 && heightPC >= 0.0)
|
||||
{
|
||||
QDesktopWidget deskWidget;
|
||||
const auto screenIndex = deskWidget.primaryScreen();
|
||||
const auto deskRect = deskWidget.availableGeometry(screenIndex);
|
||||
const auto w = (deskRect.width() / 100) * widthPC;
|
||||
const auto h = (deskRect.height() / 100) * heightPC;
|
||||
const int screenIndex = deskWidget.primaryScreen();
|
||||
const QRect deskRect = deskWidget.availableGeometry(screenIndex);
|
||||
const int w = (deskRect.width() / 100) * widthPC;
|
||||
const int h = (deskRect.height() / 100) * heightPC;
|
||||
widget->resize(w, h);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user