These functions are obsolete:
QApplication::desktop()->screenGeometry()
QApplication::desktop()->availableGeometry()
QDesktopWidget::screen()
To copy to clipboard, switch view to plain text mode
Use QScreen instead:
#include "MainWindow.h"
#include "ui_MainWindow.h"
#include <QScreen>
MainWindow
::MainWindow(QWidget *parent
) , ui(new Ui::MainWindow)
{
ui->setupUi(this);
move(QGuiApplication::screens().at(0)->geometry().center() - frameGeometry().center());
}
#include "MainWindow.h"
#include "ui_MainWindow.h"
#include <QScreen>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
move(QGuiApplication::screens().at(0)->geometry().center() - frameGeometry().center());
}
To copy to clipboard, switch view to plain text mode
Bookmarks