Hi,

I'm using QAbstractTableModel/QTableView to display a table of numeric data stored as strings that have been cast to QVariant--that is, in a vector<QVariant> in my QAbstractTableModel subclass. When I show the data, in every cell there is a checkbox in tri-state mode--checked when the value is 2, darkened when it is 1, and empty otherwise.
In no place did I (explicitly) 'ask' for this checkbox, I just want to display the data in the cell all by itself. Here is the code I use to set the QTableView properties:

(DataTable is a QWidget, saTableModel is my QAbstractTableModel subclass)

Qt Code:
  1. DataTable::DataTable(QWidget* parent, saTableModel* _satm) : QWidget(parent), satm(_satm)
  2. {
  3. QVBoxLayout* layMain = new QVBoxLayout;
  4. tblv = new QTableView(this);
  5. layMain->addWidget(tblv);
  6. setLayout(layMain);
  7.  
  8. SetUpTableView();
  9.  
  10. hdrv = new QHeaderView(Qt::Horizontal,tblv);
  11. tblv->setHorizontalHeader(hdrv);
  12. hdrv->resizeSections(QHeaderView::ResizeToContents);
  13.  
  14. tblv->show();
  15. }
  16. void DataTable::SetUpTableView()
  17. {
  18. tblv->setModel(satm);
  19. tblv->setEditTriggers(QAbstractItemView::NoEditTriggers);
  20. tblv->setAlternatingRowColors(true);
  21. tblv->setSelectionModel(select);
  22. tblv->setSelectionBehavior(QAbstractItemView::SelectRows);
  23. }
To copy to clipboard, switch view to plain text mode 

Anybody know why I'm getting unwanted checkboxes?

Best,
Matt