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

Expose ItemDataRole enum to QML

    XMLWordPrintable

Details

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

    Description

      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
                  }
              }
      

      Attachments

        Issue Links

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

          Activity

            People

              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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes