Exemplo n.º 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 );
}
Exemplo n.º 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();
}
Exemplo n.º 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);
  }
}
Exemplo n.º 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 );
}