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

Qt quick compiler produces error in C++

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 6.2.5, 6.3.1
    • 6.3.0 RC
    • QML: Compiler
    • None
    • All
    • c5b1321711 (qt/tqtc-qmlcompilerplus/6.2) 37fd49d236 (qt/qtdeclarative/6.3) 37fd49d236 (qt/tqtc-qtdeclarative/6.3)

    Description

      Qt quick compiler produces an error in C++ compilation with this QML code:

      import QtQuick 6
      
      Item {
        height: !(parent && parent.visible) ? 100 : 0
      }
      

      Generated C++:

      // generate_UNot
      r2_1 = !aotContext->engine->fromVariant<bool>();
      

      Error:

      error: no matching member function for call to 'fromVariant'
      r2_1 = !aotContext->engine->fromVariant<bool>();
              ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
      /Applications/Qt/6.3.0/macos/lib/QtQml.framework/Headers/qjsengine.h:117:14: note: candidate function template not viable: requires single argument 'value', but no arguments were provided
          inline T fromVariant(const QVariant &value)
                   ^
      1 error generated.
      

      Looks like the conversion between an object and a boolean property into bool causes the problem.

      Attachments

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              Chrisu Christian Bartsch
              Votes:
              6 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes