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

Q_INVOKABLE with NOTIFY support

    XMLWordPrintable

Details

    Description

      There are some use cases where you would like to make a QML binding to a function that can change based on e.g. some system level properties.

      For example:

      class Screen : public QObject
      {
      ...
      Q_INVOKABLE QString resourcePath(const QString &path);
      }

      ...where the return value of "resourcePath" depends on the screen resolution and/or dpi

      And in QML you would write:

      Loader

      { source: screen.resourcePath("SomeItem.qml") }

      (Yes... Screen properties do not change in run-time in real life, but they could do so in testing environment)

      Attachments

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

        Activity

          People

            ogoffart Olivier Goffart (Woboq GmbH)
            skananoj Sami Kananoja
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes