@@ -116,77 +116,108 @@ public QAbstractItemModel()
116
116
Interop . NetAbstractItemModel . SetRoleNames ( Handle , roleNamesDelPtr ) ;
117
117
}
118
118
}
119
+ /// Flags for a given QModelIndex.
119
120
public virtual int Flags ( QModelIndex index ) {
120
121
return flagsDel ( index . Handle ) ;
121
122
}
123
+ /// The data for the given QModelIndex and role.
122
124
public virtual object Data ( QModelIndex index , int role ) {
123
125
var obj = dataDel ( index . Handle , role ) ;
124
126
var variant = new Internal . Qml . NetVariant ( obj , true ) ;
125
127
return variant . AsObject ( ) ;
126
128
}
129
+ /// The data for the header in a specific section and orientation and role.
127
130
public virtual object HeaderData ( int section , int orientation , int role ) {
128
131
var obj = headerDataDel ( section , orientation , role ) ;
129
132
var variant = new Internal . Qml . NetVariant ( obj , true ) ;
130
133
return variant . AsObject ( ) ;
131
134
}
135
+ /// How many rows the model has under the given parent.
132
136
public virtual int RowCount ( QModelIndex parent ) {
133
137
return rowCountDel ( parent . Handle ) ;
134
138
}
139
+ /// How many columns the model has.
135
140
public virtual int ColumnCount ( QModelIndex parent ) {
136
141
return columnCountDel ( parent . Handle ) ;
137
142
}
143
+ /// Creates a QModelIndex for the given row + column + parent index.
138
144
public virtual QModelIndex Index ( int row , int column , QModelIndex parent ) {
139
145
return new QModelIndex ( indexDel ( row , column , parent . Handle ) , true ) ;
140
146
}
147
+ /// Gets the parent index of a child index.
141
148
public virtual QModelIndex Parent ( QModelIndex child ) {
142
149
return new QModelIndex ( parentDel ( child . Handle ) , true ) ;
143
150
}
144
151
protected override void DisposeUnmanaged ( IntPtr ptr )
145
152
{
146
153
Interop . NetAbstractItemModel . Destroy ( ptr ) ;
147
154
}
155
+ /// Signals the start of inserting columns into the model.
156
+ /// You must call this function before inserting more columns into the model.
148
157
protected void BeginInsertColumns ( QModelIndex parent , int from , int to ) {
149
158
Interop . NetAbstractItemModel . BeginInsertColumns ( Handle , parent . Handle , from , to ) ;
150
159
}
160
+ /// Signals the end of inserting columns into the model.
151
161
protected void EndInsertColumns ( ) {
152
162
Interop . NetAbstractItemModel . EndInsertColumns ( Handle ) ;
153
163
}
164
+ /// Signals the start of removing columns from the model.
165
+ /// You must call this function before removing columns into the model.
154
166
protected void BeginRemoveColumns ( QModelIndex parent , int from , int to ) {
155
167
Interop . NetAbstractItemModel . BeginRemoveColumns ( Handle , parent . Handle , from , to ) ;
156
168
}
169
+ /// Signals the end of removing columns from the model.
157
170
protected void EndRemoveColumns ( ) {
158
171
Interop . NetAbstractItemModel . EndRemoveColumns ( Handle ) ;
159
172
}
173
+ /// Signals the start of moving columns in the model.
174
+ /// You must call this function before moving columns in the model.
160
175
protected void BeginMoveColumns ( QModelIndex sourceParent , int sourceFirst , int sourceLast , QModelIndex destinationParent , int destinationChild ) {
161
176
Interop . NetAbstractItemModel . BeginMoveColumns ( Handle , sourceParent . Handle , sourceFirst , sourceLast , destinationParent . Handle , destinationChild ) ;
162
177
}
178
+ /// Signals the end of moving columns in the model.
163
179
protected void EndMoveColumns ( ) {
164
180
Interop . NetAbstractItemModel . EndMoveColumns ( Handle ) ;
165
181
}
182
+ /// Signals the start of inserting rows into the model.
183
+ /// You must call this function before inserting more columns into the model.
166
184
protected void BeginInsertRows ( QModelIndex parent , int from , int to ) {
167
185
Interop . NetAbstractItemModel . BeginInsertRows ( Handle , parent . Handle , from , to ) ;
168
186
}
187
+ /// Signals the end of inserting rows into the model.
169
188
protected void EndInsertRows ( ) {
170
189
Interop . NetAbstractItemModel . EndInsertRows ( Handle ) ;
171
190
}
191
+ /// Signals the start of removing rows from the model.
192
+ /// You must call this function before removing columns into the model.
172
193
protected void BeginRemoveRows ( QModelIndex parent , int from , int to ) {
173
194
Interop . NetAbstractItemModel . BeginRemoveRows ( Handle , parent . Handle , from , to ) ;
174
195
}
196
+ /// Signals the end of removing rows from the model.
175
197
protected void EndRemoveRows ( ) {
176
198
Interop . NetAbstractItemModel . EndRemoveRows ( Handle ) ;
177
199
}
200
+ /// Signals the start of moving rows in the model.
201
+ /// You must call this function before moving columns in the model.
178
202
protected void BeginMoveRows ( QModelIndex sourceParent , int sourceFirst , int sourceLast , QModelIndex destinationParent , int destinationChild ) {
179
203
Interop . NetAbstractItemModel . BeginMoveRows ( Handle , sourceParent . Handle , sourceFirst , sourceLast , destinationParent . Handle , destinationChild ) ;
180
204
}
205
+ /// Signals the end of moving rows in the model.
181
206
protected void EndMoveRows ( ) {
182
207
Interop . NetAbstractItemModel . EndMoveRows ( Handle ) ;
183
208
}
209
+ /// Signals the start of resetting the model.
210
+ /// You must call this function before resetting the model's state.
184
211
protected void BeginResetModel ( ) {
185
212
Interop . NetAbstractItemModel . BeginResetModel ( Handle ) ;
186
213
}
214
+ /// Signals the end of resetting the model.
187
215
protected void EndResetModel ( ) {
188
216
Interop . NetAbstractItemModel . EndResetModel ( Handle ) ;
189
217
}
218
+ /// The mapping of strings to role IDs.
219
+ /// This is used to indicate the QML names of properties in
220
+ /// components such as the ListView and Repeater.
190
221
protected virtual Dictionary < int , string > RoleNames ( ) {
191
222
return new Dictionary < int , string > ( ) {
192
223
{ ( int ) ItemDataRole . DisplayRole , "display" } ,