QAbstractItemModel::multiData() ?
-
I read about the QAbstractItemModel::multiData() method with an example. But I didn't understand when it is called from QML? Or just as a wrapper for data() ?
@BVladimir said in QAbstractItemModel::multiData() ?:
But I didn't understand when it is called from QML? Or just as a wrapper for data() ?
Where do you directl call data() from QML?
QAIM::multiData() can be called when you need more than one role for a specific index so you don't have to call QAIM::data() with the same index more than once.
-
...
delegate: myHeader_column {
init_width: col_width
txt: col_name
}col_width and col_name are role's names in my model. Direct call for data() for each role name. What with multiData ?
@BVladimir said in QAbstractItemModel::multiData() ?:
Direct call for data() for each role name.
How do you know? I don't see a call here and don't know what's done under the hood. But you're right - since those are two different properties to fill those are two calls
What with multiData ?
I don't see how you can use it here.
-
@Christian-Ehrlicher said in QAbstractItemModel::multiData() ?:
I don't see how you can use it here.
So how exactly to use multiData ?
-
@Christian-Ehrlicher said in QAbstractItemModel::multiData() ?:
I don't see how you can use it here.
So how exactly to use multiData ?
@BVladimir said in QAbstractItemModel::multiData() ?:
So how exactly to use multiData ?
With c++ - don't know how/if/where it's exposed to QML - never used it.