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. Qt 5.11 - qmlRegisterType gives "module is not installed".

Qt 5.11 - qmlRegisterType gives "module is not installed".

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 3 Posters 1.1k Views
  • 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.
  • P Offline
    P Offline
    parvathypb
    wrote on last edited by parvathypb
    #1

    I am using qt 5.11

    In main.cpp,
    qmlegisterSingletonType(QUrl("qrc:/qml/Components/Style.qml"), "com.xxx.yyy.dev.devStyle", 1, 0, "devStyle");

    Now in main.qml, i am using
    import com.xxx.yyy.dev.devStyle 1.0

    But it is throwing error qrc:/qml/MainNew.qml:4:1: module "com.xxx.yyy.dev.devStyle" is not installed

    Please provide a solution to how to solve this issue.

    Note : Same was working with qt 5.6. The issue is seen when qt version was upgraded to qt 5.11.

    Similar post is available in https://forum.qt.io/topic/36849/qt-5-qmlregistertype-gives-module-is-not-installed
    But not reply is seen for that also.

    Pablo J. RoginaP 1 Reply Last reply
    0
    • Pablo J. RoginaP Pablo J. Rogina

      @parvathypb could you please post your .pro file, the qrc contents and also describe the subfolder layout of your project...

      P Offline
      P Offline
      parvathypb
      wrote on last edited by parvathypb
      #3

      @Pablo-J-Rogina

      .pro file

      QT += widgets qml quick multimedia
      CONFIG += c++11

      SOURCES += qtquick2applicationviewer/qtquick2applicationviewer.cpp
      src/guidancemap.cpp
      src/liftmodehelper.cpp \

      HEADERS += qtquick2applicationviewer/qtquick2applicationviewer.h
      inc/guidancemap.h
      inc/acuids.h
      inc/liftmodehelper.h \

      INCLUDEPATH += qtquick2applicationviewer

      CONFIG(release, debug|release) {
      DEFINES+=QT_NO_DEBUG_OUTPUT
      }

      LIBS += -ludev
      TRANSLATIONS = i18n/tsdop_1.ts
      i18n/tsdop_2.ts
      i18n/tsdop_3.ts \

      include(updatelocalizations.pri)

      Target binary name

      TARGET = tsdop

      Target installs

      desktop {
      scripts.files=testtools/scripts
      } else {
      scripts.files=scripts
      }
      scripts.path=/opt/ksp858/tsdopmain
      configurations.files=configuration/*
      configurations.path=/data/tsdop
      target.path=/opt/ksp858/tsdopmain
      localization.files=i18n
      localization.files+=$${OUT_PWD}/i18n
      localization.path=/opt/ksp858/tsdopmain
      INSTALLS = target scripts configurations localization

      Additional import path used to resolve QML modules in Creator's code model

      QML_IMPORT_PATH =

      Get build version number from environment

      buildversion=$$BUILD_VERSION
      ! isEmpty(buildversion) {
      message("build-version is $$buildversion")
      DEFINES+="TSDOP_APP_VERSION=\"$$buildversion\""
      }

      buildid=$$BUILD_ID
      ! isEmpty(buildid) {
      message("build-id is $$buildid")
      DEFINES+="TSDOP_BUILD_ID=\"$$buildid\""
      }

      SOURCES += src/main.cpp
      src/tsdopcontroller.cpp
      src/tsdopsettings.cpp \

      HEADERS +=
      inc/tsdopplugininterface.h
      inc/tsdopcontroller.h
      inc/tsdopsettings.h \

      INCLUDEPATH += inc

      QMAKE_RESOURCE_FLAGS += -no-compress

      RESOURCES +=
      Resources.qrc
      Resources-fonts.qrc

      OTHER_FILES +=
      terms.txt
      scripts/*
      configuration/*
      qml/* \

      DISTFILES +=
      qml/Grid/Grid.qml
      qml/Grid/GridButton.qml
      qml/Grid/ListButton.qml
      qml/CommonPages/AddNewItemPage.qml
      qml/MainNew.qml \

      1 Reply Last reply
      0
      • P parvathypb

        I am using qt 5.11

        In main.cpp,
        qmlegisterSingletonType(QUrl("qrc:/qml/Components/Style.qml"), "com.xxx.yyy.dev.devStyle", 1, 0, "devStyle");

        Now in main.qml, i am using
        import com.xxx.yyy.dev.devStyle 1.0

        But it is throwing error qrc:/qml/MainNew.qml:4:1: module "com.xxx.yyy.dev.devStyle" is not installed

        Please provide a solution to how to solve this issue.

        Note : Same was working with qt 5.6. The issue is seen when qt version was upgraded to qt 5.11.

        Similar post is available in https://forum.qt.io/topic/36849/qt-5-qmlregistertype-gives-module-is-not-installed
        But not reply is seen for that also.

        Pablo J. RoginaP Offline
        Pablo J. RoginaP Offline
        Pablo J. Rogina
        wrote on last edited by
        #2

        @parvathypb could you please post your .pro file, the qrc contents and also describe the subfolder layout of your project...

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        P 1 Reply Last reply
        0
        • Pablo J. RoginaP Pablo J. Rogina

          @parvathypb could you please post your .pro file, the qrc contents and also describe the subfolder layout of your project...

          P Offline
          P Offline
          parvathypb
          wrote on last edited by parvathypb
          #3

          @Pablo-J-Rogina

          .pro file

          QT += widgets qml quick multimedia
          CONFIG += c++11

          SOURCES += qtquick2applicationviewer/qtquick2applicationviewer.cpp
          src/guidancemap.cpp
          src/liftmodehelper.cpp \

          HEADERS += qtquick2applicationviewer/qtquick2applicationviewer.h
          inc/guidancemap.h
          inc/acuids.h
          inc/liftmodehelper.h \

          INCLUDEPATH += qtquick2applicationviewer

          CONFIG(release, debug|release) {
          DEFINES+=QT_NO_DEBUG_OUTPUT
          }

          LIBS += -ludev
          TRANSLATIONS = i18n/tsdop_1.ts
          i18n/tsdop_2.ts
          i18n/tsdop_3.ts \

          include(updatelocalizations.pri)

          Target binary name

          TARGET = tsdop

          Target installs

          desktop {
          scripts.files=testtools/scripts
          } else {
          scripts.files=scripts
          }
          scripts.path=/opt/ksp858/tsdopmain
          configurations.files=configuration/*
          configurations.path=/data/tsdop
          target.path=/opt/ksp858/tsdopmain
          localization.files=i18n
          localization.files+=$${OUT_PWD}/i18n
          localization.path=/opt/ksp858/tsdopmain
          INSTALLS = target scripts configurations localization

          Additional import path used to resolve QML modules in Creator's code model

          QML_IMPORT_PATH =

          Get build version number from environment

          buildversion=$$BUILD_VERSION
          ! isEmpty(buildversion) {
          message("build-version is $$buildversion")
          DEFINES+="TSDOP_APP_VERSION=\"$$buildversion\""
          }

          buildid=$$BUILD_ID
          ! isEmpty(buildid) {
          message("build-id is $$buildid")
          DEFINES+="TSDOP_BUILD_ID=\"$$buildid\""
          }

          SOURCES += src/main.cpp
          src/tsdopcontroller.cpp
          src/tsdopsettings.cpp \

          HEADERS +=
          inc/tsdopplugininterface.h
          inc/tsdopcontroller.h
          inc/tsdopsettings.h \

          INCLUDEPATH += inc

          QMAKE_RESOURCE_FLAGS += -no-compress

          RESOURCES +=
          Resources.qrc
          Resources-fonts.qrc

          OTHER_FILES +=
          terms.txt
          scripts/*
          configuration/*
          qml/* \

          DISTFILES +=
          qml/Grid/Grid.qml
          qml/Grid/GridButton.qml
          qml/Grid/ListButton.qml
          qml/CommonPages/AddNewItemPage.qml
          qml/MainNew.qml \

          1 Reply Last reply
          0
          • dheerendraD Offline
            dheerendraD Offline
            dheerendra
            Qt Champions 2022
            wrote on last edited by
            #4
            1. Just ensure that Styles.qml exist in the resource file
            2. qml element name should be start with Capital letter. Make it as DevStyle rather than devStyle.

            Dheerendra
            @Community Service
            Certified Qt Specialist
            http://www.pthinks.com

            P 1 Reply Last reply
            0
            • dheerendraD dheerendra
              1. Just ensure that Styles.qml exist in the resource file
              2. qml element name should be start with Capital letter. Make it as DevStyle rather than devStyle.
              P Offline
              P Offline
              parvathypb
              wrote on last edited by parvathypb
              #5

              Hi @dheerendra , Thanks for the reply.

              Yes, your suggestion helped in solving the issue. The element name should start with Capital Letter. That was the issue and now when the qml element name changed to "DevStyle" , it is working perfectly.

              But , I could not find any info on that it qt doc website that qml element name should start with capital letter. Then how we will know, this was the issue .

              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