Hey,
i need header in table with checkbox and text. I did something this:
Qt Code:
  1.  
  2. ui->tableView->setModel(model);
  3.  
  4. QtCheckHeaderView *header = new QtCheckHeaderView(Qt::Horizontal, ui->tableView);
  5.  
  6.  
  7. QtCheckHeaderView *vheader = new QtCheckHeaderView(Qt::Vertical, ui->tableView);
  8.  
  9. ui->tableView->setHorizontalHeader(header);
  10. ui->tableView->setVerticalHeader(vheader);
  11.  
  12. QStandardItem *root = model->invisibleRootItem();
  13. QList<QList<QStandardItem *> > items;
  14. for (int i = 0; i < 10; ++i)
  15. {
  16. QList<QStandardItem *> res;
  17. for (int j = 0; j < 1000; ++j)
  18. {
  19. res.append(new QStandardItem(QString("%1;%2").arg(j).arg(i)));
  20. vheader->addCheckable(j);
  21. }
  22. items.append(res);
  23. root->appendColumn(res);
  24.  
  25. header->addCheckable(i);
  26. }
To copy to clipboard, switch view to plain text mode 

This work good, i have horizontal and vertical header with checkbox and text but this only works if i put this code to MainWindow constructor.
If i put this code to for example pushbutton function it wont work. Datas are fine but headers are invisible.
Qt Code:
  1. ui->tableView->repaint();
To copy to clipboard, switch view to plain text mode 
won't work.
Someone maybe knows the answer why this is happening and/or how to solve this?
thanks for answer