QDialog
-
Hi folks!
I'm having a problem with QDialog.
The title bar of my window does not appear the 'X' option to close it. But it is loaded in the center of the screen.
But when I do this set:
l-> setWindowFlags (Qt :: Window);
The window does not carry more in the center of the screen, but 'X' appears.
Have any option that carries it to the center?
thanks -
Hi,
How are you constructing your dialog ? Which version of Qt are you using ? On which OS ?
-
Hi,
How are you constructing your dialog ? Which version of Qt are you using ? On which OS ?
-
So Loading is a subclass of QDialog ? Can you show its initialization ?
-
#include "loading.h" #include "ui_loading.h" #include "brprint3d.h" Loading::Loading(QWidget *parent) : QDialog(parent), ui(new Ui::Loading) { ui->setupUi(this); } Loading::~Loading() { delete ui; } //Ignore void Loading::on_pushButton_clicked() { this->close(); }
-
Did you do any special configuration in Designer for that widget ?
-
What desktop environment are you using ?
-
Hi,
void Loading::showEvent(QShowEvent *event) { QDialog::showEvent(event); setGeometry(QStyle::alignedRect(Qt::LeftToRight,Qt::AlignCenter,size(),QApplication::desktop()->availableGeometry())); }