PDA

View Full Version : Problem with opening a semi-transparent QDialog as Popup



nernst
4th December 2015, 09:38
Hi all,

I have a problem with opening a semi-transparent QDialog.

I have a QMainWindow with a centraWidget in it. This centralWidget has a QPushButton, that shall open a non-transparent QDialog, which also has a QPushButton. This QPushButton shall open a semi-transparent QDialog. When I do the following...



QDialog1::QDialog1(QWidget *parent) :
QFrame(parent),
ui(new Ui::QDialog1)
{
ui->setupUi(this);
this->setWindowFlags(Qt::FramelessWindowHint);
this->setAttribute(Qt::WA_NoSystemBackground);
this->show();
}

void QDialog1::on_pushButton_clicked()
{
Dialog2 *dial = new Dialog2(this);
}


...it opens the inner QDialog as a semi-transparent one, BUT with the "this" it is a child of the first QDialog and is opened within the first QDialog. But I want it to be opened in the centralWidget. So I tried the same thing without the "this", but in this case, it opens the inner QDialog with a black non-transparent background.

I just want to open the inner QDialog over all other QWidget (like a Popup).

Does anybody can help?

Thank you.