[Qt-interest] childCount()

Sujan Dasmahapatra sujan.dasmahapatra at gmail.com
Fri Jul 31 10:48:00 CEST 2009


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);*
**
*// Afte this I am trying to access childCount() values but it's giving junk
value*
*int n = item->childCount(); // it's not giving the value as = 1.*

tell me whats wrong ?


>
> --
> Ender EREL
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>



-- 
Thanks & Regards
S. Dasmahapatra
B.E. (Aeronautics-Aerodynamics)
Senior Engineer---CFD(Computational Fluid Dynamics)
L M Glasfiber R & D (India) Pvt Ltd
Bangalore, India
Ph:91-9900839788
Office:91-80-66470248
mail id : sujan.dasmahapatra at gmail.com
            sdh at lmglasfiber.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090731/3e280438/attachment.html 


More information about the Qt-interest-old mailing list