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

Complex data exchange - QAbstractItemModel and QModelIndex integration as QtAbstractItemModel and QtModelIndex

XMLWordPrintable

    • Icon: User Story User Story
    • Resolution: Done
    • Icon: P1: Critical P1: Critical
    • 6.8.0 FF, 6.8.0 RC
    • None
    • Quick: Other
    • None
    • Android
    • 2024wk22s2FOQtforAndroid, 2024wk24s2FOQtforAndroid, 2024wk26s2FOQtforAndroid, 2024wk38s2FOQtforAndroid, 2024wk28s2FOQtforAndroid, 2024wk30s2FOQtforAndroid, 2024wk32s2FOQtforAndroid, 2024wk36s2FOQtforAndroid, 2024wk40s3FOQtforAndroid
    • d9ceacd41 (dev), 333dd9e27 (dev)

      Why?

      Enables complex data exchange between Java and QML

      How?

      Creating an equivalent Java interface/abstract for QAbstractItemModel which can be set as a property to QtQuickView.

      Possible Scenarios

      // A QtAbstractItemModel has been implemented by user
      MyConcreteModel model;
      qtQuickView.setProperty("dataModel", model);
      // the model will be used as an instance of QAIM in Quick application
      
      // QML: A QAbstractItemModel instance exists in the Quick component
      ListView {
          property ListModel dataModel : MyListModel{}
      }
      
      //Java:
      MyConcreteModel model = (MyConcreteModel)qtQuickView.getProperty("dataModel");
      model.insertRow(10, 20, 30);
      

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

            soarmin Soheil Armin
            soarmin Soheil Armin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes