[Qt-interest] childCount()

Ender EREL erelender at yahoo.com
Fri Jul 31 10:54:37 CEST 2009


Sujan Dasmahapatra wrote:
> Dear Friends
> 
> After I added a child TreeWidgetItem into an existing TreeWidgetItem but 
> the value of childCount() is not updated. What could be the reason can  
> anyone tell me ? 
>  
> *Sample*
> *QTreeWidget *treeWidget = new QTreeWidget;*
> *QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget);*
> *QTreeWidgetItem *child = new QTreeWidgetItem(item);*
> *child->setText("I am a child");*
> *item1->addChild(child);*

Is this a typo? You are adding the child to item1 and calling childCount 
of item.

-- 
Ender EREL



More information about the Qt-interest-old mailing list