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. App stoped working after `QTP0004 = NEW`
QtWS25 Last Chance

App stoped working after `QTP0004 = NEW`

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 465 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.
  • D Offline
    D Offline
    Dmitry.Sokolov
    wrote on last edited by
    #1

    I've upgraded from v6.5 to v6.8. Then I've got CMake warnings regarding QTP0004, and switched it on as required:

    if(QT_KNOWN_POLICY_QTP0004)
        qt_policy(SET QTP0004 NEW)
    endif()
    
    qt_add_qml_module(${PROJECT_NAME}
        URI         "myapp"
        QML_FILES   ${QML_FILES}
    )
    

    After that I have no any CMake warnings, but the app just stopped working (it exits without showing GUI). Logs:

    ...
    qt.qml.import: addImplicitImport: qrc:/qt/qml/myapp/UI/MainWindow.qml
    qt.qml.import: addFileImport: qrc:/qt/qml/myapp/UI/MainWindow.qml "." version "(latest)" as ""
    qt.qml.import: importExtension: qrc:/qt/qml/myapp/UI/MainWindow.qml loaded ":/qt/qml/myapp/UI/qmldir"
    qt.qml.diskcache: "qrc:/qt/qml/myapp/UI/MainWindow.qml: \"myapp\" is ambiguous. Found in qrc:/qt/qml/myapp/ and in qrc:/qt/qml/myapp/"
    QQmlApplicationEngine failed to load component
    qrc:/qt/qml/myapp/UI/MainWindow.qml: "myapp" is ambiguous. Found in qrc:/qt/qml/myapp/ and in qrc:/qt/qml/myapp/
    The thread 'QQmlThread' (41572) has exited with code 0 (0x0).
    qt.qml.gc.statistics: Qml GC memory allocation statistics:
    qt.qml.gc.statistics: Total memory allocated: 0
    ...
    

    The strange error: "myapp" is ambiguous. Found in qrc:/qt/qml/myapp/ and in qrc:/qt/qml/myapp/
    What does it mean, and how to fix it?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Dmitry.Sokolov
      wrote on last edited by
      #2

      Reverting to SET QTP0004 OLD fix the problem. But there is CMake warning...

      1 Reply Last reply
      0
      • F Offline
        F Offline
        FKosmale
        wrote on last edited by
        #3

        Hi, it's a bit hard to tell what is causing the issue without more information. Could you describe how the files stored in ${QML_FILES} are structured? Do you have QML files which are part of your module and which explicitly import the module itself?

        But generally, this sounds like a bug (in Qt itself) – if only to improve the warning message – and I'd be interested in a bug report.

        Lastly, as a workaround to avoid warnings, you could also set the "NO_GENERATE_EXTRA_QMLDIRS" option instead of setting the policy to old (if the Qt version is high enough).

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          https://bugreports.qt.io/browse/QTBUG-133587

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Dmitry.Sokolov
            wrote on last edited by
            #5

            Looks like it's QTBUG-133587. I also have .js files in QML_FILES.

            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