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

Declarative Engine treats Q_PROPERTY with a type of QWidget* differently than QObject*

XMLWordPrintable

      class Bar: has a Q_PROPERTY(bool whatever READ whatever)
      class Foo: has a Q_PROPERTY(QWidget* bar READ bar NOTIFY barChanged)

      And an instance of "Foo" is set as a property "foo" in the root context.

      Then the qml "Text

      { text: foo.bar.whatever }

      " will NOT complain about the lack of a NOTIFY signal for Bar::whatever. (Note, I can still successfully access the property 'whatever').

      However, if instead, Foo's property is a QObject*, then qml WILL complain (as appropriate).

      I think that any class that derives from QObject* should have the appropriate warnings provided.

        1. foo.h
          0.6 kB
          Ryan van der Bijl
        2. main.cpp
          0.4 kB
          Ryan van der Bijl
        3. main.qml
          0.2 kB
          Ryan van der Bijl
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            aakenned Aaron Kennedy
            ryan@enzosystems.com Ryan van der Bijl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes