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#include <qtreewidget.h>
5
6class TreeMainWindow :public QWidget // Provide tr()
7{
8public:
9 TreeMainWindow()
10 {
11 //! [0]
12 auto *treeWidget = new QTreeWidget();
13 treeWidget->setColumnCount(1);
14 for (int i = 0; i < 10; ++i)
15 new QTreeWidgetItem(treeWidget, { tr("item: %1").arg(i) });
16 //! [0]
17 }
18};