Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. In full Screen The child widget is not visible
Qt 6.11 is out! See what's new in the release blog

In full Screen The child widget is not visible

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shubh91
    wrote on last edited by
    #1

    I have an application in qml. I am using quickview and setting it as full screen. But when I try to open a .ui file(QWidget) from full screen mode it is going behind the mainwindow. this doesn't happen when I am not in full screen mode. I have tried setting flag (Qt::WindowStaysOnTopHint) but it doesn't work. I am using QT5 . Thanks for the help.

    @QUiLoader loader;
    QFile file("abc.ui");
    file.open(QFile::ReadOnly);
    QWidget _parent = loader.load(&file);
    file.close();
    _parent->setParent(mainlayout);
    _parent->setWindowFlags(Qt::Tool);
    _parent->setWindowFlags(_parent->windowFlags() | Qt::WindowStaysOnTopHint)
    @

    In this the mainlayout is quickview

    1 Reply Last reply
    1
    • S Offline
      S Offline
      shubh91
      wrote on last edited by
      #2

      can someone please help.... any suggestion is welcomed..

      1 Reply Last reply
      0
      • p3c0P Offline
        p3c0P Offline
        p3c0
        Moderators
        wrote on last edited by
        #3

        Can you paste more of you code ? How have you created QQuickView and how is mainlayout set for QQuickView ?

        157

        1 Reply Last reply
        0
        • S Offline
          S Offline
          shubh91
          wrote on last edited by
          #4

          @// this is my main layout file
          QUiLoader loader;
          QFile file("mainLayoutFile.ui");
          file.open(QFile::ReadOnly);
          QWidget* pw = loader.load(&file);
          file.close();
          QMainWindow mainWindow = dynamic_cast<QMainWindow>(pw)

          //this us my main qml
          QQuickView *quickView = new QQuickView;
          quickView->setSource("main.qml");

          QEngine *engine = quickView->engine();

          //this are for the viewports which will be inside main.qml i will create them elsewhere
          QQmlComponent ViewportComponent = new QQmlComponent(engine, "Viewport.qml");

          QWidget *quickViewWidget = QWidget::createWindowContainer(quickView, mainWindow);
          mainWindow->setCentralWidget(quickViewWidget);

          //
          @

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved