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. Reload QQuickView into the same window container
Forum Updated to NodeBB v4.3 + New Features

Reload QQuickView into the same window container

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.3k Views 2 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.
  • R Offline
    R Offline
    Rem-Kolomna
    wrote on 4 Apr 2015, 08:09 last edited by Rem-Kolomna 4 Apr 2015, 08:10
    #1

    I want to write plugins to my program as qml displaying inside dock widget

    I load plugin this way:

      if (!qview) 
        qview = new QQuickView();
      qview->engine()->clearComponentCache();
      qview->setSource(QUrl(path));
      QQuickItem *item_main = qview->rootObject();
      QWindow* main_page = item_main->window();  
      auto container = QWidget::createWindowContainer( main_page, ui->dockWidgetContents );
      container->show();
    

    It works ok, but reloading plugin is quite slow. I think it is because createWindowContainer creates native window each time.
    Can I speed up loading by forcing QQuickView use the same window container after reload?

    P 1 Reply Last reply 4 Apr 2015, 08:55
    0
    • R Rem-Kolomna
      4 Apr 2015, 08:09

      I want to write plugins to my program as qml displaying inside dock widget

      I load plugin this way:

        if (!qview) 
          qview = new QQuickView();
        qview->engine()->clearComponentCache();
        qview->setSource(QUrl(path));
        QQuickItem *item_main = qview->rootObject();
        QWindow* main_page = item_main->window();  
        auto container = QWidget::createWindowContainer( main_page, ui->dockWidgetContents );
        container->show();
      

      It works ok, but reloading plugin is quite slow. I think it is because createWindowContainer creates native window each time.
      Can I speed up loading by forcing QQuickView use the same window container after reload?

      P Offline
      P Offline
      p3c0
      Moderators
      wrote on 4 Apr 2015, 08:55 last edited by
      #2

      @Rem-Kolomna I'm not sure about what is the problem exactly. But did you try QQuickWidget instead ? It is a new class added since Qt 5.3 and it loads QML too.

      157

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Rem-Kolomna
        wrote on 4 Apr 2015, 18:48 last edited by
        #3

        Thank you, QQuickWidget is a solution for my problem

        1 Reply Last reply
        0

        1/3

        4 Apr 2015, 08:09

        • Login

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