QObject::connect(tw, SIGNAL(itemExpanded(QTreeWidgetItem*)),this, SLOT(skipHide()));QObject::connect(tw, SIGNAL(itemCollapsed(QTreeWidgetItem*)),this, SLOT(skipHide()));
void TreeComboBox::hidePopup(){ if (skipNextHide){ skipNextHide = false; } else{ QComboBox::hidePopup(); }}
tw->setCurrentItem(item);setRootModelIndex(tw->currentIndex().parent());setCurrentIndex(tw->currentIndex().row());
void TreeComboBox::showPopup(){ setRootModelIndex(QModelIndex()); QComboBox::showPopup();}
setModel(tw->model());
setRootModelIndex(tv->currentIndex().parent()); setCurrentIndex(tv->currentIndex().row()); setRootModelIndex(QModelIndex());