Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Strange behavior of QQuickView and QMainWindow
Forum Updated to NodeBB v4.3 + New Features

Strange behavior of QQuickView and QMainWindow

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 920 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.
  • M Offline
    M Offline
    maxvanceffer
    wrote on last edited by
    #1

    I have Qt 5.2 and have next problem:

    On my QMainwindow i have QQuickView, which is inserted into layout like this:

    @
    QQuickView * view = new QQuickView;
    container = QWidget::createWindowContainer(view, this);--
    container->setFocusPolicy(Qt::TabFocus);
    view->setSource(QUrl("qrc:/qml/main.qml"));
    ui->layout->addWidget(container);
    @

    ui->layout - cover all mainwidow size

    Then on some action i am creating other QQmlView as dialog( window ), with the same code except i don't putting it to container. And show it :

    @
    QQuickView * dialog = new QQuickView;

        dialog->setResizeMode(QQuickView::SizeRootObjectToView);
        dialog->setSource(QUrl("qrc:/qml/main.qml"));
    
        view->show();
    

    @

    And strange thing that and mainwindow and this dialog start display the same. Other words dialog embends into mainwindow too. How to avoid this ?

    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