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

Expose ItemDataRole enum to QML

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • None
    • None

      This could be useful for the scenario where you're not in a delegate, but outside of it completely and need to set some data for a specific role. Using QTBUG-68001 as an example:

              on_User_acceptedChanged: {
                  if (_user_accepted) {
                      var qt_index = photo_model.index(index, 0)
                      // Old code:
                      //photo_model.setData(qt_index, color, 1)
                      // New code:
                      photo_model.setData(qt_index, color, Qt.DecorationRole)
                      _user_accepted = false
                  }
              }
      

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mitch_curtis Mitch Curtis
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes