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

three dependencies in binding of Q_OBJECT_BINDABLE_PROPERTY causes crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.4.3, 6.5.0, 6.6.0
    • 6.4.2, 6.5
    • Core: Other
    • None
    • b12417130 (dev), 41e036ec7 (6.5), 4822af4f4 (6.4)

    Description

      #include <QCoreApplication>
      #include <QProperty>
      
      class Object : public QObject {
      public:
          Object() noexcept
          { v.setBinding([this] { return x.value() + y.value() + z.value(); }); }
          Q_OBJECT_BINDABLE_PROPERTY(Object, int, v)
          Q_OBJECT_BINDABLE_PROPERTY(Object, int, x)
          Q_OBJECT_BINDABLE_PROPERTY(Object, int, y)
          Q_OBJECT_BINDABLE_PROPERTY(Object, int, z)
      };
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
          Object c;
          c.x = 1;
          return a.exec();
      }
      

      Here, v depends on x, y and z. When I run this code, it crashes.
      If I remove z from dependency of v, it does not crash.

      Attachments

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

        Activity

          People

            fabiankosmale Fabian Kosmale
            xylosper Byoung-young Lee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews