Where it is more correct to define the function that I plan to use in all the created windows (QWidget, QDialog, QMainWindow).
void MainWindow::moveToCenter() { QDesktopWidget desktop; QRect rect = desktop.availableGeometry(desktop.primaryScreen()); QPoint center = rect.center(); //координаты центра экрана center.setX(center.x() - (this->width()/2)); center.setY(center.y() - (this->height()/2)); move(center); } separate class and connect? Or kokogo that parent?