void FileManagerWidget::rename(){ Q_D(FileManagerWidget); QModelIndexList indexes = d->selectedIndexes(); if (indexes.count() != 1) {// emit error(); } else { d->currentView->edit(indexes.first()); }}
m_widget = new FileManagerWidget(); QAction* act = new QAction(tr("Rename"), this); act->setShortcut(tr("Return")); act->setShortcutContext(Qt::WidgetShortcut); container()->addAction(act); m_widget->addAction(act); connect(act, SIGNAL(triggered()), m_widget, SLOT(rename()));
QModelIndexList indexes = d->selectedIndexes(); if (indexes.count() != 1) {// emit error(); } else { d->currentView->edit(indexes.first());
d->currentView->edit(d->currentView->currentIndex());