Skip to main content

All Questions

Filter by
Sorted by
Tagged with
8 votes
2 answers
26k views

How to update QAbstractItemModel view when a Data is updated

I use the Qt example for QAbstractItemModel and I try to update an Item to a given index. I tried to use emit DataChangedbut it doesn't work, the view is not updated. Here is an example: What I ...
Ed Nio's user avatar
  • 593
1 vote
1 answer
2k views

QML QAbstractItemModel : How to insert at index i

I use the Qt example forQAbstractItemModel and I try to add an Item to a given index. I read the doc and I try to use this But it doesn't work as expected and instead of adding a new Item, it just ...
Ed Nio's user avatar
  • 593
0 votes
0 answers
65 views

QAbstracktListModel which consists of QAbstractListModels. How to implement?

I need to have List whitch contains Lists. It's not a tree. So the problem is that I need to dynamically get new data models from QML. Can I implement QAbstractItemModel and use in in TreeView?? How ...
Coaxial's user avatar
  • 143
0 votes
1 answer
463 views

Using QAbstractItemModel to return QQuickPaintedItem for use in QML delegate

I implemented a subclass of QQuickPaintedItem to be used in QML which works on its own when registered through qmlRegisterType<T> Instances of this class are created at application startup and ...
MrBolton's user avatar
14 votes
5 answers
25k views

How to implement QML ListModel like get method for an QAbstractListModel derived model

I want to use an QAbstractListModel derived model in QML. Binding the model to views already works great. The next thing I want achieve is the ability to access specific items and their role like it ...
avb's user avatar
  • 1,751
1 vote
2 answers
2k views

Bind a QIcon provided by a class derived from QAbstractListModel to QML Image

I try to bind a QIcon provided by a class derived from QAbstractListModel to QML Image like this: Component { id: myDelegate //... Column { anchors.verticalCenter: ...
avb's user avatar
  • 1,751
6 votes
2 answers
5k views

QML view wont update when adding a new item to a QAbstractListModel based model

I've figured out how to bind a model derived from QAbstractListModel to a QML view. But the next thing I tired does not work. If a new Item is added to the model the QML view will not update. Why is ...
avb's user avatar
  • 1,751