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

QtQuick cannot be imported multiple times when using static Qt

    XMLWordPrintable

    Details

    • Commits:
      6e1851de9595d7e7abe9acdc8c473e792d24c4c2

      Description

      using a static compilation of Qt-5.2.0-rc1, i'm unable to load the same QML file twice. Consider this code (adapted from examples/qtm/tutorials/extending/chapter1-basic):

      int main(int argc, char *argv[])
      {
          QGuiApplication app(argc, argv);
      
          qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");
      
          QQuickView view;
          view.setResizeMode(QQuickView::SizeRootObjectToView);
          view.setSource(QUrl("qrc:///app.qml"));
          view.show();
      
          QQuickView view2;
          view2.setResizeMode(QQuickView::SizeRootObjectToView);
          view2.setSource(QUrl("qrc:///app.qml"));
          view2.show();
      
          return app.exec();
      }
      

      running this code gives me:

      qrc:///app.qml:42:1: static plugin for module "QtQuick" with name "QtQuick2Plugin" cannot be loaded: Namespace 'QtQuick' has already been used for type registration 
      

      this problem does not occur when using Qt as shared library/dll.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              richard Richard Moe Gustavsen
              Reporter:
              timblechmann tim blechmann
              Votes:
              5 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes