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

[REG 5.10 => 5.11] Expression depends on non-NOTIFYable properties

    XMLWordPrintable

Details

    • b2c71d6518143b3d2a9bd3aef1d72ee5929891fc

    Description

      Minimal example:

      main.cpp
      #include <QGuiApplication>
      #include <QQmlApplicationEngine>
      #include <QDebug>
      
      class Test : public QObject
      {
          Q_OBJECT
          Q_PROPERTY(int foo READ foo CONSTANT FINAL)
      
      public:
          int foo() const { return 1; }
      
          Test() {}
      };
      
      int main(int argc, char *argv[])
      {
      #if defined(Q_OS_WIN)
          QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
      #endif
      
          QGuiApplication app(argc, argv);
      
          QQmlApplicationEngine engine;
      
          qmlRegisterType<Test>("App", 1, 0, "Test");
      
          engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
          if (engine.rootObjects().isEmpty())
              return -1;
      
          return app.exec();
      }
      
      #include "main.moc"
      
      main.qml
      import QtQuick 2.9
      import QtQuick.Window 2.0
      
      import App 1.0
      
      Window {
          width: 600
          height: 600
          title: qsTr("Hello World")
          visible: true
      
          Test {
              objectName: foo ? "bar" : "baz"
          }
      }
      

      Stack trace before the warning is printed:

      1  QQmlPropertyCapture::captureProperty         qqmljavascriptexpression.cpp 306  0x7ffff765b7f7 
      2  QQmlPropertyCapture::registerQmlDependencies qqmljavascriptexpression.cpp 388  0x7ffff765c3b7 
      3  QQmlJavaScriptExpression::evaluate           qqmljavascriptexpression.cpp 234  0x7ffff765c9d2 
      4  QQmlJavaScriptExpression::evaluate           qqmljavascriptexpression.cpp 190  0x7ffff765d0fd 
      5  QQmlNonbindingBinding::doUpdate              qqmlbinding.cpp              206  0x7ffff76695a3 
      6  QQmlBinding::update                          qqmlbinding.cpp              168  0x7ffff76669cc 
      7  QQmlBinding::setEnabled                      qqmlbinding.cpp              503  0x7ffff7666ec8 
      8  QQmlObjectCreator::finalize                  qqmlobjectcreator.cpp        1306 0x7ffff7677cdc 
      9  QQmlComponentPrivate::complete               qqmlcomponent.cpp            921  0x7ffff75d855d 
      10 QQmlComponentPrivate::completeCreate         qqmlcomponent.cpp            957  0x7ffff75d8681 
      11 QQmlComponent::completeCreate                qqmlcomponent.cpp            950  0x7ffff75d872f 
      12 QQmlComponent::create                        qqmlcomponent.cpp            776  0x7ffff75d84b2 
      13 QQmlApplicationEnginePrivate::finishLoad     qqmlapplicationengine.cpp    134  0x7ffff766b904 
      14 QQmlApplicationEnginePrivate::startLoad      qqmlapplicationengine.cpp    118  0x7ffff766bb07 
      15 QQmlApplicationEngine::load                  qqmlapplicationengine.cpp    259  0x7ffff766bbce 
      16 main                                         main.cpp                     28   0x401d07       
      

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            mitch_curtis Mitch Curtis
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes