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

QQmlScriptString and QQmlExpression bug with trivial script

    XMLWordPrintable

Details

    • 9e71faae038de4c41c206f1321da1b37ab6ca8b1 (qtdeclarative)

    Description

      I have a C++ QObject-based class that has a QQmlScriptString property.

      class MyClass : public QObject
      {
      Q_PROPERTY(QQmlScriptString script READ .. WRITE set_script NOTIFY...)
      
      void set_script (QQmlScriptString script)
      {
      ...
      qqml_expression_ = new QQmlExpression(script);
      
      }
      private : QQmlExpression *qqml_expression_;
      }
      

      It works most of the time, except when I set something too trivial

      MyClass
      {
      script: 1.0
      }
      

      which provokes a crash in QQmlExpression.cpp@169 : QVector<T>::at: "index out of range"

      I use the following workaround

      MyClass
      {
      script: 1.0*1.0
      }
      

      If necessary, I can try to work out a sample.

      Attachments

        Issue Links

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

          Activity

            People

              shausman Simon Hausmann
              maxlem Maxime Lemonnier
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes