示例#1
0
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 );
}
示例#2
0
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();
}
示例#3
0
/*
 * 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);
  }
}
示例#4
0
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 );
}