Getting QWindow back into parent QWidget from the fullscreen
-
Yes,sure.
Inside MainWindow (QMainWindow):
myWindow = new MyWindow(); // inherits from QWindow myWinContainer= QWidget::createWindowContainer(myWindow ,this); myWinContainer->setFixedSize(640,360); //layouts: vbox = new QVBoxLayout(); vbox->setAlignment(Qt::AlignHCenter); vbox->addWidget(myWinContainer); ui->centralWidget->setLayout(vbox);
Slot that enters/exits fullscreen mode for myWinContainer:
if( myWinContainer->windowState() == Qt::WindowFullScreen ) { myWinContainer->setParent(this); myWinContainer->setWindowState(Qt::WindowNoState); vbox->insertWidget(0,myWinContainer); } else { vbox->removeWidget(myWinContainer); // myWinContainer->setParent(nullptr);//doesn't help either myWinContainer->setParent(this,Qt::Tool); myWinContainer->showFullScreen(); }
-
That's not a compilable example.
-
@sasmaster
Hi
it dont like some files. ( not for anyone at all )If possible use googledrive/dropbox or Github etc.
-
Hmm,indeed, DropBox is the option... Here is the link to the test prog that show the issue:
https://www.dropbox.com/s/dxow1ye9fo6r1ap/FullScrTest.rar?dl=0Thanks.
-
I don't know whether you are hitting an unusual code path or if there's really a bug. You should check the bug report system to see if there's something related.
In any case, since you are doing OpenGL with widgets, did you consider using QOpenGLWidget ?
On a side note, there's QOpenGLWindow that might also interest you.
-
If you check the code you see that the full screen problem error has no relation to OpenGL at all. What I see here is SDK bug. The reason I don't use any sort of widget is because I don't need all the pile of code which comes with QWidget. All I need is a thin GL surface to render to very very fast.So I guess that I need to file a bug?
-
What I see is that the assert comes from QWindowContainer which for some reason can't get a window handle from the top level widget. Hence my question whether you are hitting an unusual code path using QWindow as you do.
If you don't want widgets, then why are you using a QMainWindow ?
-
Simply that I don't know whether the top level widget handling works as expected and you are doing something wrong with your QWindow or if in fact you uncovered a use case not handled properly.
-
Hi i did run it on win 10, Qt 5.9/Qt 5.5 and
did have it crash consistently.
Also i removed much of the openGL code and seems not related to that at all unless
its some sort of hidden use or something i missed.It does smells like a (Qt) bug but I didn't get 100% proof.
-
Thanks for collaboration, guys. Submitted a bug:
https://bugreports.qt.io/browse/QTBUG-63168