#include <QGridLayout>
#include <QStringListModel>
#include <QTreeView>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
auto model = new QStringListModel(this);
QStringList list;
list << "a" << "b" << "c"<< "a" << "b" << "c"<< "a" << "b" << "c";
model->setStringList(list);
auto tree = new QTreeView(this);
tree->setModel(model);
QGridLayout *mainLayout = new QGridLayout;
mainLayout->setSpacing(0);
mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->addWidget(tree);
ui->centralwidget->setLayout(mainLayout);
}