//----------------------------------------------------------------------------- int ctkCheckableHeaderViewTest1(int argc, char * argv [] ) { QApplication app(argc, argv); #if 0 QFileSystemModel model; model.setRootPath(QDir::currentPath()); #else QStandardItemModel model; QStandardItem item; item.insertColumns(0, 5); item.insertRows(0, 7); model.insertRow(0, &item); #endif QTableView table; table.setModel(&model); model.setHeaderData(0, Qt::Horizontal, Qt::Checked, Qt::CheckStateRole); QHeaderView* previousHeaderView = table.horizontalHeader(); ctkCheckableHeaderView* headerView = new ctkCheckableHeaderView(Qt::Horizontal, &table); qDebug() << previousHeaderView->isClickable(); headerView->setClickable(previousHeaderView->isClickable()); headerView->setMovable(previousHeaderView->isMovable()); headerView->setHighlightSections(previousHeaderView->highlightSections()); headerView->setPropagateToItems(true); table.setHorizontalHeader(headerView); qDebug() << headerView->isCheckable(0); table.show(); table.raise(); //app.exec(); return EXIT_SUCCESS; }