qabstractitemmodel Questions

3

I wanted to have a tree view which shows the item name, the item description, and two related Boolean values in respective columns. I started by modifying the Editable Tree Mode example, so there's...
Hesse asked 4/1, 2013 at 13:33

3

Solved

Question: how to find sub item, in a QTreeView loaded QAbstractItemModel model with model->match() method? Problem: model->match() can't find sub items, wtf?! Here is the example: As yo...
Rincon asked 20/7, 2010 at 13:59

2

Solved

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 ...
Buddleia asked 19/4, 2017 at 11:48

3

I have a custom subclass of QSortFilterProxyModel. I overrode filterAcceptsRow with the custom filter I wanted. Then I used it as such: proxy = new MyFilterModel(); proxy->setSourceModel(...); ...
Haynes asked 19/8, 2015 at 22:15

2

Solved

I have a QTableView that dynamically loads data from a custom model that inherits QAbstractItemModel. The model implements both fetchMore and canFetchMore. The problem is that I would like to be ...
Mayo asked 21/7, 2016 at 14:20

2

Solved

I am confused how to use setData, setItemData and setItem method of QStandardItemModel, these method seem have the same effect, i wonder to know which method should i choose to use will be best? c...
Terpsichorean asked 11/11, 2019 at 2:57

3

Solved

I'm attempting to create a QTreeView and use a custom model for it. I have placed qDebug() statements at various places, and I have determined that data() is never being called. How can I fix this ...
Elliotelliott asked 23/7, 2011 at 16:36

2

I have a map = std::map<std::string, myItemModel *>, where myItemModel inherits QAbstractItemModel. I want now to combine all myItemModel in one single myItemModel (every other item model w...
Cleopatra asked 4/9, 2014 at 9:13

3

Solved

I'm using a QListView with a custom model derived from QAbstractItemModel. I have on the order of millions of items. I have called listView->setUniformItemSizes(true) to prevent a bunch of layou...
Yonder asked 8/9, 2015 at 5:9

2

Solved

I would like to have something like QString QSqlTableModel::getColumnName(int col).
Federate asked 4/1, 2011 at 16:48

5

Solved

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 ...
Catholic asked 28/3, 2014 at 11:19

1

Solved

I'm implementing a Qt based tree view, where the view is a QTreeView-based class and the model is a QAbstractItemModel-based class. The tree is supposed to have millions of nodes in it. I'm impleme...
Schizogenesis asked 21/12, 2017 at 6:7

1

Solved

We usually set view's model in Qt like this: view->setModel(model); But is there any way to remove a model from view? I mean literally leave a view empty like it was just created and there was ...
Cooks asked 8/10, 2017 at 10:44

1

Solved

Qt offers the possibility to combine C++ models with QML and suggests three approaches in the docs: QStringList QObjectList QAbstractItemModel The two former are extremely simple to use, e.g. Q...
Ikkela asked 5/5, 2017 at 16:27

4

Solved

I have a model class TreeModel : public QAbstractItemModel which I populate with instances of my TreeItem excluding column==1. In column 1 I've created CheckBoxes: QVariant TreeModel::data(cons...
Absurd asked 22/7, 2013 at 11:10

2

Solved

I use QTableView + QStandardItemModel to show some data (data stored in some other data structure), and this table view is sortable. Since it is sortable, when sorting this model, I also need to s...
Bobbe asked 20/6, 2010 at 23:35

1

Solved

I'm subclassing QAbstractItemModel to display items in a QTreeView, and within this subclass (projectModel), I have a function to delete the currently-selected index in the tree view. Component is ...
Macneil asked 22/7, 2015 at 16:54

1

Solved

I have an application that stores and edits notes. The list of notes is displayed in a listview like this: Page { id: noteList title: i18n.tr("QNote") visible: false Column { anchors.fill: p...
Playpen asked 5/5, 2013 at 22:37

2

Solved

I am trying to implement a simple model for a treeview and I can't figure out why it isn't working.. It seems that all my nodes are children of my root node although three of them should be childre...
Outside asked 28/12, 2012 at 20:25

1

I have a QTreeView rendering QAbstractItemModel, where I would like to set the background of certain cells based on the data in the model. I return QBrush from model::data(Qt::BackgroundColorRole) ...
Tisdale asked 11/5, 2015 at 14:52

4

I have a QTableView which have set a QStandardItemModel. The user edits data in some index in the view and then the model emits the dataChanged() signal. In the SLOT where I am handling the SIGNAL ...
Springclean asked 1/12, 2014 at 11:56

1

Solved

It is required to implement QAbstractItemModel.parent() method or else get this nasty error: NotImplementedError: QAbstractItemModel.parent() is abstract and must be overridden Aside from .pare...
Omaromara asked 10/1, 2015 at 2:41

1

I have some models that use the QAbstractItemModel rules for retrieving and providing data for a table. My example model has multiple columns and rows. Unfortunately QtQuick widgets can only hand...
Febri asked 12/10, 2014 at 19:36

3

Solved

I'm new to model view and I have been following this tutorial while checking the documentation at the same time and I stumbled upon this little detail : The code of the tutorial which can be downlo...
Airworthy asked 26/12, 2013 at 12:4

2

Solved

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 ...
Mobocracy asked 17/2, 2014 at 12:35

© 2022 - 2025 — McMap. All rights reserved.