In full Screen The child widget is not visible



  • 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



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


  • Moderators

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



  • @// 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);

    //
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.