Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_gui_itemviews_qtreewidget.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4//! [0]
5QTreeWidget *treeWidget = new QTreeWidget();
6treeWidget->setColumnCount(1);
8for (int i = 0; i < 10; ++i)
9 items.append(new QTreeWidgetItem(static_cast<QTreeWidget *>(nullptr), QStringList(QString("item: %1").arg(i))));
10treeWidget->insertTopLevelItems(0, items);
11//! [0]
QList< QTreeWidgetItem * > items
QTreeWidget * treeWidget
[0]