Logo Search packages:      
Sourcecode: qtsmbstatus version File versions  Download package

Q3ListViewItem * main_windows::nextItem ( Q3ListViewItem *  item  )  [private]

Find next item.

Parameters:
item pointer on item
Returns:
pointer on next item
See also:
selectItem search

Definition at line 553 of file main_windows.cpp.

Referenced by search().

{
      debugQt("main_windows::nextItem()");
      Q3ListViewItem * tempNextItem;
      Q3ListViewItem * parent;
      Q3ListViewItem * tempItem=dynamic_cast<Q3ListViewItem *>(item);
      // if item is incorrect
      if (!tempItem)
            return listView->firstChild ();
      // first child of this item
      tempNextItem=tempItem->firstChild();
      // if child exist
      if (tempNextItem)
      {
            return tempNextItem;
      }
      else // no child
      {
            // next
            tempNextItem=tempItem->nextSibling();
            // if next exist
            if (tempNextItem)
            {
                  return tempNextItem;
            }
            else // if next doesn't exist
            {
                  parent=tempItem;
                  // find next from parent
                  while (parent->parent() )
                  {
                        parent=parent->parent();
                        // find next
                        tempNextItem=parent->nextSibling();
                        // find oncle
                        if (tempNextItem) return tempNextItem;
                  }
                  // nothing found
            }
      }
      // nothing found , return first child of listview
      return listView->firstChild ();
}


Generated by  Doxygen 1.6.0   Back to index