void TreeCtrl::handleExpand(Root::Action & t) { QTreeView* tv = wnd(); QModelIndex i = tv->currentIndex(); ENABLED_IF( t, i.isValid() && ! tv->isExpanded( i ) ); tv->setExpanded( i, true ); }
void TreeCtrl::handleExpandSubs(Root::Action & t) { QTreeView* tv = wnd(); QModelIndex i = tv->currentIndex(); ENABLED_IF( t, i.isValid() ); QApplication::setOverrideCursor( Qt::WaitCursor ); expand( tv, i, true ); QApplication::restoreOverrideCursor(); }
/* * Copies the full path of the selected item in pkgFileListTreeView to clipboard */ void MainWindow::copyFullPathToClipboard() { QTreeView *tb = ui->twProperties->currentWidget()->findChild<QTreeView*>("tvPkgFileList"); if (tb && tb->hasFocus()) { QString path = utils::showFullPathOfItem(tb->currentIndex()); QClipboard *clip = qApp->clipboard(); clip->setText(path); } }
void TreeCtrl::handleCopy(Root::Action & t) { QTreeView* tv = wnd(); QModelIndex i = tv->currentIndex(); ENABLED_IF( t, i.isValid() ); QVariant v = i.data(); QMimeData *md = new QMimeData(); md->setText( v.toString() ); QApplication::clipboard()->setMimeData( md ); }