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

Be more picky if qmltype information is missing

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P2: Important
    • 6.7
    • 6.4.1
    • QML: Compiler
    • None

    Description

      The attached example contains a little, non obvious misconfiguration, which took me hours to nail down. Compiling the example claims:

      [ 70%] Built target sample_nativeplugin_init
      [ 72%] Running moc --collect-json for target sample
      [ 74%] Automatic QML type registration for target sample
      [ 76%] Generating .rcc/qmlcache/sample_main_qml.cpp
      Warning: main.qml:12:17: Cannot assign binding of type UIInterface to QObject
              target: FB.UIInterface
                      ^^^^^^^^^^^^^^
      Error: main.qml:12:31: Could not compile binding for target: cannot convert from UIInterface of UIInterface to QObject of QObject
              function onPasswordResult(res : string) {
              }
          }
      }
      
      
                                                                          ^
      [ 78%] Running rcc for resource qmake_base
      [ 80%] Running rcc for resource sample_raw_qml_0
      

      The compiler echos almost everything of the file following the error. I had nearly complete qml files in the build log output.

      Although everything looks more or less fine and the app compiles at the first glance, you'll notice that the src/app/foo/CMakeLists.txt lacks a "core" link target. And you'll notice that the only reason why the app actually links, is that "core" is linked to "model", and the missing symbols are coming in this way.

      For whatever reason, the qmltypes are incomplete if not being linked to "core". If there's an easy way to detect that, it could save time. If not, just close it

      Attachments

        Activity

          People

            qtqmlteam Qt Qml Team User
            cajus Cajus Pollmeier
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: