void popupPublic::enable() { QListViewItem *current = keysList->firstChild(); if (current==NULL) return; current->setVisible(true); while ( current->nextSibling() ) { current = current->nextSibling(); current->setVisible(true); } keysList->ensureItemVisible(keysList->currentItem()); }
void popupPublic::sort() { bool reselect=false; QListViewItem *current = keysList->firstChild(); if (current==NULL) return; if ((untrustedList.find(current->text(2))!=untrustedList.end()) && (!current->text(2).isEmpty())){ if (current->isSelected()) { current->setSelected(false); reselect=true; } current->setVisible(false); } while ( current->nextSibling() ) { current = current->nextSibling(); if ((untrustedList.find(current->text(2))!=untrustedList.end()) && (!current->text(2).isEmpty())) { if (current->isSelected()) { current->setSelected(false); reselect=true; } current->setVisible(false); } } if (reselect || !keysList->currentItem()->isVisible()) { QListViewItem *firstvisible; firstvisible=keysList->firstChild(); while (firstvisible->isVisible()!=true) { firstvisible=firstvisible->nextSibling(); if (firstvisible==NULL) return; } keysList->setSelected(firstvisible,true); keysList->setCurrentItem(firstvisible); keysList->ensureItemVisible(firstvisible); } }
/** * Makes all descendants of the given item visible. * This slot is connected to the showAll() signal of the QueryResultsMenu * object. */ void TreeWidget::slotShowAll(QListViewItem* pParent) { QListViewItem* pItem; // Get the first child if (pParent != NULL) pItem = pParent->firstChild(); else pItem = firstChild(); // Iterate over all child items while (pItem != NULL) { pItem->setVisible(true); // Show child items recursively slotShowAll(pItem); pItem = pItem->nextSibling(); } }
/** * Hides all descendant that do not meet the given search criteria. * This slot is connected to the search() signal of the QueryResultsMenu * object. * The search is incremental: only visible items are checked, so that a new * search goes over the results of the previous one. * @param pParent The parent item whose child are searched * @param re The pattern to search * @param nCol The list column to search in */ void TreeWidget::slotSearch(QListViewItem* pParent, const QRegExp& re, int nCol) { QListViewItem* pItem; // Get the first child if (pParent != NULL) pItem = pParent->firstChild(); else pItem = firstChild(); // Iterate over all child items while (pItem != NULL) { // Filter visible items only if (pItem->isVisible() && re.search(pItem->text(nCol)) == -1) pItem->setVisible(false); // Search child items recursively slotSearch(pItem, re, nCol); pItem = pItem->nextSibling(); } }