Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-63168

Getting QWindow back into parent QWidget from the fullscreen crashes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.9.1
    • Fix Version/s: 5.9.3
    • Labels:
      None
    • Environment:
      Windows 10 64bit. Qt 5.9.1 64bit . MSVC2015 compiler.
    • Commits:
      ff2e9a17e7583fe18b9ac3527e4aab2a6b395174

      Description

      I have an object that subclasses QWindow. I add it into my QMainWindow's layout by wrapping it into QWidget container like this:

      {{myWinContainer= QWidget::createWindowContainer(myWindow,this); vbox->addWidget(myWinContainer); myWinContainer->setFixedSize(640,360); }}

      Then there is a fullscreen mode. I tried to set screen mode directly on myWindow (QWindow):

      {{myWindow->setParent(nullptr); myWindow->showFullScreen(); }}

      The windows goes full screen all right. But I can't get it back into its widget when exiting from the full screen.

      {{myWindow->setWindowState(Qt::WindowNoState); myWindow->setParent(p);//where p is cached pointer to parent: myWindow->parent() myWindow->showNormal(); }}

      The window stays detached from the main window.

      Then I tried to do the full screen via myWindow's parent widget (myWinContainer). In this case, every time I am inserting myWinContainer back into its parent :

      {{vbox->insertWidget(0,myWinContainer); }}

      layout object, it crashes with  internal error:

      Program: D:\Qt\5.9.1\msvc2015_64\bin\Qt5Cored.dll
      Module: 5.9.1
      File: global\qglobal.cpp
      Line: 3049
      ASSERT: "toplevel->windowHandle()" in file kernel\qwindowcontainer.cpp, line 380

       

      Other people from the  Qt dev forum who tried this, reported the same issue. Here is the link to the thread:

      https://forum.qt.io/topic/82879/getting-qwindow-back-into-parent-qwidget-from-the-fullscreen/3

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            tvete Paul Olav Tvete
            Reporter:
            sasmaster Michael Iv
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes