[Qt-interest] QTreeWidget

Srdjan Todorovic todorovic.s at googlemail.com
Fri Mar 13 16:07:04 CET 2009


Hi,

2009/3/13 Sujan Dasmahapatra <sdh at lmglasfiber.com>:
> Dear Friends.
>
> I  am loading a geometry  on the screen.The filename of the geometry has to
> be uploaded in my  treeWidget…..for that I am doing like this ,

Is there a reason you keep spamming the list with near-identical emails?

> /////////////////////////////////////////////////////////////////////////////////////////////
>
> Const QString fileName; // This name I amgetting from the dialog.
>
> QTreeWidget *treeWidget = new QTreeWidget;
>
> QTreeWidgetItem  *item = new QTreeWidgetItem(treeWidget);
>
> Item->setText(1,fileName);

What happens if you try setText(0, fileName) ?

> treeWidget->addTopLevelItem(item);

Why are you adding it again? Passing the tree widget to the item's
constructor should append it to the widget.

> But with this my filename is not being loaded on the  treeeWidget…Can anyone
> tell me whats wrong and what should be the correct implementation ???

Is the problem that you are not reading the documentation?

Good luck
Srdjan




More information about the Qt-interest-old mailing list