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

return number of selected row in QTableView

I have the following code: model = new QStandardItemModel(); channel = new QTableView(this); channel->setModel(model); model->setData(model->index(d,0,QModelIndex()), 0…
jackajack
  • 153
  • 1
  • 1
  • 11
0
votes
1 answer

How to manipulate a pointer to TableView model?

When it´s necessary manipulate a model of a TableView, it's necessary to get this model using the function tableView->model() . But, this returns a pointer to an QAbstractItem, and it's necessary one to a QAbstractModel. So... I convert, using a…
0
votes
1 answer

QStandardItem inserting rows in a weird way

i am creating a table and uinserting the row in it like this.only one row is inserted in the table and that too conditional and if condition isnt satisfied than an error is shown. the problem is that when a row is inserted on satisfying condition…
Mcolorz
  • 145
  • 1
  • 5
  • 20
0
votes
0 answers

Subclassing QStandardItemModel to avoid QAbstractItemModel

I'm implementing a Model/View for a tree like structure, and I've decided to try the QStandardItemModel on which I want to wrap on it a specific class, (which I call here "appSpecificClass"). Basically, I want part of that class (like names, or…
Jorge Leitao
  • 19,085
  • 19
  • 85
  • 121
0
votes
1 answer

How to assign different Url to my TreeView Items

I am new to Qt. I had created a Qtree View using QStandard item model. Now I want to set Url to my items. How can I assign url for tree view items.
New Moon
  • 787
  • 6
  • 21
  • 35
-1
votes
1 answer

How to apply Filter for Tree which is developed using QStandardItemModel

Implemented Tree using QStandardItemModel.. like below QStandardItem *americaItem = new QStandardItem("America"); QStandardItem *mexicoItem = new QStandardItem("Canada"); QStandardItem *usaItem = new QStandardItem("USA"); QStandardItem…
-2
votes
1 answer

PyQt: Getting the index of an appended row after QStandardItemModel.appendRow()

I am appending a row in PyQt like so: model = QStandardItemModel(0, 3) model.appendRow([item1, item2, item2]) Now I would like to get the QModelIndex of the appended row so that I can select the row in the user interface using…
knipknap
  • 5,934
  • 7
  • 39
  • 43
1 2 3
15
16