These functions are obsolete:
Qt Code:
  1. QApplication::desktop()->screenGeometry()
  2. QApplication::desktop()->availableGeometry()
  3. QDesktopWidget::screen()
To copy to clipboard, switch view to plain text mode 

Use QScreen instead:

Qt Code:
  1. #include "MainWindow.h"
  2. #include "ui_MainWindow.h"
  3. #include <QScreen>
  4.  
  5. MainWindow::MainWindow(QWidget *parent)
  6. : QMainWindow(parent)
  7. , ui(new Ui::MainWindow)
  8. {
  9. ui->setupUi(this);
  10. move(QGuiApplication::screens().at(0)->geometry().center() - frameGeometry().center());
  11. }
To copy to clipboard, switch view to plain text mode