PDA

View Full Version : Cursor is not moving through QTreeWidgetItem list in QTreeWidget



sujan.dasmahapatra
11th December 2009, 06:52
Friends
I have TreeWdiget class Derived from QTreeWidget now I am adding some item and some child items also.I am not able to move through the items in my list smoothly. Its getting stuck on an item and my cursor is not moving in the treeWidget.Its not crashing but simply not moving through them.

What could be the reason for this . Any suggestions

class TreeWidget : public QTreeWidget
{
Q_OBJECT
public:
TreeWidget() { }
~TreeWidget() { }
QList <QTreeWdigetItem *>item;
};

QTreeWidgetItem *partname = new QTreeWidgetItem(treeWidgetMesh->item[i]);
QString mod = " grid.x2d " + QString::number(treeWidgetMesh->currentItem()->childCount());
partname->setText(0, mod);
treeWidgetMesh->item[0]->addChild(partname);
treeWidgetMesh->setCurrentItem(partname);

My items are coming properly in the treeWidget but I am not able select any from the list, my cursor is getting stuck on the currentItem.