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

Weird compiler warning message when using unresolved function

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.8.3, 6.9.0 Beta3, 6.10.0 FF
    • 6.7
    • QML: Compiler
    • None
    • Fedora 40, KDE Plasma
    • c159f4e83 (dev), 746f38bf5 (dev), 0d810e373 (6.9), ff607cb51 (6.9), 1b85053c5 (6.8), 658c5d7ca (dev), d3492ff7c (dev), db0b996c7 (6.9), abf4a0951 (6.9), 983576dad (dev), 8053ed273 (dev), c1b5d46b6 (6.9), c72f22fe9 (6.9), a36e5168f (6.8), c66101af5 (dev)

    Description

      Consider the following QML code

      import QtQuick
      import QtQuick.Controls as QQC2
      
      Window {
          QQC2.Label {
              text: i18n("Display Style")
          }
      } 

      Compiling with qmlcachegen in verbose mode gives (among others) the following warning

      > Warning: Main.qml:6:9: Cannot resolve property type  for binding on text. [compiler]

      note the double space between type and for. It appears that there's supposed to be a type name there, but there isn't.

      i18n() in this case is a KDE function injected via setContextObject, so not visible to the compiler. Getting that to work properly is a whole other topic.

      qtdeclarative commit b75f34458f6060385b3cdcc46ce8e8e87f661251

      Attachments

        For Gerrit Dashboard: QTBUG-124913
        # Subject Branch Project Status CR V

        Activity

          People

            ulherman Ulf Hermann
            nicolasfella Nicolas Fella
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes