[PyQt] QTreeWidget usage

Thorsten Kampe thorsten at thorstenkampe.de
Tue Apr 6 21:55:09 BST 2010


Hi,

while trying to read the Qt documentation, I came across the following:

"In its simplest form, a tree widget can be constructed in the following 
way:

QTreeWidget *treeWidget = new QTreeWidget();
treeWidget->setColumnCount(1);
QList<QTreeWidgetItem *> items;
for (int i = 0; i < 10; ++i)
    items.append(new QTreeWidgetItem((QTreeWidget*)0, QStringList
(QString("item: %1").arg(i))));
treeWidget->insertTopLevelItems(0, items);
"

Unfortunately that doesn't tell me anything since I don't know C++. Can 
anyone kindly translate this to Python?!


Thorsten



More information about the PyQt mailing list