qt - How can I add a user editable checkbox in QTableView using only QStandardItemModel -


I have a QTableView and QStandardItemModel . Can a column contain checkboxes that can be editable without using a user representative or without the use of abstract model squares? It's not that I can not do this, I just want to reduce the code, I'll get it overkill for a simple check box.

model.setData (index, Qt ::

I have used the modelTX.setData (index, FALSE)

< / P>

Code> but it creates a combo box which is true and false.

I will try setItemData .

pls, check what the following example will work for you:

  QStandardItemModel * tableModel = new QStandardItemModel (); // Create text item table - Model- & gt; set item (0, 0, new QStandardItem ("text item")); // check Create Item O- ; Table MODEL-gt; Set item (0, 1, item 0); // set model UI-> Table view-> Setmodel (table model);  

Hopefully That it helps,


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

jquery - SimpleModal Confirm fails to submit form -