#include #include int main(int argc, char *argv[]) { QApplication a(argc, argv); // create a tree widget with appropriate properties QTreeWidget w; w.setSelectionBehavior(QAbstractItemView::SelectRows); w.setSelectionMode(QAbstractItemView::ExtendedSelection); w.setAllColumnsShowFocus(false); w.setRootIsDecorated(false); // add some columns and rows to the tree widget int columns = 100; w.setColumnCount(columns); QStringList labels; for (int j = 0; j < columns; ++j) labels << QString("%1").arg(j); w.setHeaderLabels(labels); int rows = 100; for (int i = 0; i < rows; ++i) { QStringList row; for (int j = 0; j < columns; ++j) row << QString("%1.%2").arg(i).arg(j); w.addTopLevelItem(new QTreeWidgetItem(row)); } w.show(); return a.exec(); }