+ // do nothing when clicked on whitespace (item=NULL)
+ if( !item )
+ return;
+
+ // if we have a category, expand the tree and go to the
+ // first item
+ if (item->childCount() > 0) {
+ item->setExpanded(true);
+ if (previous && previous->parent() != item)
+ switchPanel( item->child(0), previous );
+ }
+ else if (QWidget * w = widget_map_.value(item, 0)) {