Questions tagged [qstandarditemmodel]

The QStandardItemModel class provides a generic model for storing custom data.

The QStandardItemModel class provides a generic model for storing custom data.

QStandardItemModel can be used as a repository for standard Qt data types. It is one of the Model/View Classes and is part of Qt's model/view framework.

QStandardItemModel provides a classic item-based approach to working with the model. The items in a QStandardItemModel are provided by QStandardItem.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

233 questions
0
votes
1 answer

qt QStandardItemModel data() not being called

I have very simple, custom model derived from QStandardItemModel. Functions rowCount and columnCount are called several times whereas none of the remaining functions, in particular data() is never called. I cannot find the reason. #include…
4pie0
  • 29,204
  • 9
  • 82
  • 118
0
votes
1 answer

Qt5 C++ How do you access items from a model to check state?

I have a combobox with multiple checkbox items and I need to be able to iterate through them and determine if they are checked or even more appropriately, as soon as an item is checked, have an event fire off but I can't seem to get the signal/slot…
Jarrod Cabalzar
  • 408
  • 1
  • 5
  • 24
0
votes
1 answer

QT QStandardItemModel - how to store a list of items in one cell

I am new with QT, so I'll apprciate any help. In my application, I'm creating a QStandardItemModel with rows and columns. Now I want to save in one cell a list of QStrings - but I dont know how to do that. I've tried to write this code: …
RRR
  • 3,937
  • 13
  • 51
  • 75
0
votes
1 answer

Where is a row appended in QStandardItemModel?

There is a method void QStandardItemModel::appendRow(QStandardItem * item) in class QStandardItemModel. I cannot figure out where the item is appended, or who the item's parent is after appending? And another method bool…
user1899020
  • 13,167
  • 21
  • 79
  • 154
0
votes
1 answer

Associating a key with a row of QStandardItemModel

I wanted to know how I could associate a key with an entry to the QstandardItemModel. This would help me retrieve the row of the entry.
MistyD
  • 16,373
  • 40
  • 138
  • 240
0
votes
0 answers

Why does ::TableView.model return nilClass when Nokogiri is used?

EDIT The problem was with something else so the trouble wasn't really Qt, still I don't know why this happened. The thing was that in the method display_filesize @yt.get_filesize(row_id, format) I used Nokogiri to parse the XML. I don't know if the…
k_ly
  • 1
  • 1
0
votes
1 answer

QStandardItemModel within QTtableview

I am using QStandardItemModel inside QTtableview. Is it possible to add checkbox in on column cell & combobox in another column cell. So that i can select predefined option from the combo box. Please suggest how to achieve this.
Allan
  • 2,971
  • 4
  • 24
  • 28
0
votes
1 answer

Scrolling to the exact end or beginning of the QListView containing QStandardItems?

I have a QListView with a horizontal scroll bar in which QStandardItems are inserted. When I drag an item over the existing items the scroll bar moves as per the QModelIndex. But when i reach the end of the listview ,the scroll bar does’nt move to…
Gojira
  • 171
  • 4
  • 14
0
votes
1 answer

Apply regex to all items of a QStandardItemModel

I use a QStandardItemModel with a QTtableview to hold regexes I also use a *QStandardItemModel with a QTableview to which I want to apply all regexes from QTableview described in 1) What is the best way to do that please ?
dlewin
  • 1,673
  • 1
  • 19
  • 37
0
votes
1 answer

Can I set an Overlay Image for a QstandardItem that has been bound in a QListview?

The application on which I'm working on has QStandardItems laid in QListView. I want to set a transparent image on the QStandardItem which is bound in a listview. How can a set an Overlay image on the QListView item ?
Gojira
  • 171
  • 4
  • 14
0
votes
1 answer

img viewer with Qt

I'm trying to create an application based on model/view concept. i need to open some directory, find all imgs in it and show them in MainWindow (subclass of QMainWindow). The architecture is something like this: 1) via QDir create QStringList of…
Illia Levandovskyi
  • 1,228
  • 1
  • 11
  • 20
0
votes
1 answer

When subclassing QAbstractItemModel, nothing shown in QTreeView

I am trying to use simple tree model, but I am not able to make the example works in my project. First, I was able to use QTreeView without problem, with QStandardItemModel. In the following case, I am able to see my QTreeView with data inside. …
peterphonic
  • 951
  • 1
  • 19
  • 38
0
votes
1 answer

QStandardItemModel removeRows does not remove signals on cells?

Got a QStandardItemModel on my QTableView and trying to remove all the rows in it. I was first calling a method I created with a call to takeRow, which does not delete the object if I'm right. What about removeRows from QAbstractItemModel? I've…
Syrupsystem
  • 181
  • 1
  • 11
0
votes
1 answer

setTextAlignment() doesn't work when editing data

I use QStandardItem::setTextAlignment() to make sure elements displayed in center, but when you double click on a item, aka editing mode, it is still displayed at the left most position. So, how can I make editing mode work as display mode?
daisy
  • 22,498
  • 29
  • 129
  • 265
0
votes
0 answers

QT: Qtableview wrapping text

I am working with QtableView of Qt. I am facing one problem. I am not able to fix the content in to complete cell . In my case i have fix size of column and rows can be stretched. following is sample code #include…
vinay patel
  • 177
  • 3
  • 5
  • 10
1 2 3
15
16