Hello ppl,

I have got a probleem with QlistViewItemIterator, it doent not werk well by me.
i want to search in my listview voor something. I just get the first item on my list en it seems dat the search mechanism doen not work well.

this is my code:

Qt Code:
  1. void test::selectItem( QString name, int type )
  2. {
  3. QString _cmp_name = name.section(":", 0, 0);
  4. QListViewItem* item;
  5. QString _x_name = name.section(":", 1, 1);
  6. QListViewItem * _cmp_item = (((CView *)(pWorkView->pStack->visibleWidget()))->ui_view->firstChild()->firstChild());
  7. QListViewItemIterator it2= _cmp_item;
  8. QListViewItem * _child_item = _cmp_item->firstChild();
  9. item = _child_item;
  10.  
  11. while (_child_item)
  12. if ( _child_item->text(0) == _x_name )
  13. {
  14. item = _child_item;
  15. break;
  16. }
  17. else
  18. {
  19. item = _child_item->nextSibling();
  20. }
  21.  
  22. while(*it2)
  23. {
  24. if(it2.current()->text( 0 ).contains(_x_name))
  25. {
  26. if ((*it2) && !(*it2)->pixmap(0))
  27. {
  28. ((CView *)(pWorkView->pStack->visibleWidget()))->selectItem(*it2);
  29. pWorkView->m_TabView->setCurrentPage(0);
  30. ((CView *)(pWorkView->pStack->visibleWidget()))->ui_view->ensureItemVisible(*it2);
  31. break;
  32. }
  33. }
  34. it2++;
  35. }
  36.  
  37. }
To copy to clipboard, switch view to plain text mode 

thanx in advance