# HG changeset patch # User Yuya Nishihara # Date 1579333027 -32400 # Sat Jan 18 16:37:07 2020 +0900 # Node ID 57b1858016442f3b1b62d18aa85e26306a13b1b9 # Parent fe975725df040c5672ff3ae8583edd330e7ac703 feed more data to TreeView diff --git a/mainwindow.cpp b/mainwindow.cpp --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -9,7 +9,12 @@ { ui_->setupUi(this); - auto *model = new QStringListModel({"Foo", "Bar", "Baz"}, this); + QStringList list; + list.reserve(100); + for (int i = 0; i < 100; ++i) { + list.append((i % 2 == 0) ? "The quick fox jumps over" : "the lazy dog."); + } + auto *model = new QStringListModel(list, this); ui_->treeView->setModel(model); ui_->treeView->setItemDelegateForColumn(0, new QuickItemDelegate(this)); }