Fix delete shortcut not working in bin tree

parent 4044d875
......@@ -395,23 +395,6 @@ void MyTreeView::editorDestroyed(QObject *editor)
setEditing(false);
}
void MyTreeView::keyPressEvent(QKeyEvent *event)
{
if (isEditing()) {
QTreeView::keyPressEvent(event);
return;
}
QModelIndex currentIndex = this->currentIndex();
if (event->key() == Qt::Key_Return && currentIndex.isValid()) {
if (this->isExpanded(currentIndex)) {
this->collapse(currentIndex);
} else {
this->expand(currentIndex);
}
}
QTreeView::keyPressEvent(event);
}
bool MyTreeView::isEditing() const
{
return state() == QAbstractItemView::EditingState;
......
......@@ -93,7 +93,6 @@ protected:
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void focusInEvent(QFocusEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
protected slots:
void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint) override;
......
......@@ -159,8 +159,8 @@ void Core::initGUI(const QUrl &Url)
}
m_projectManager = new ProjectManager(this);
m_binWidget = new Bin(m_projectItemModel);
m_library = new LibraryWidget(m_projectManager);
m_binWidget = new Bin(m_projectItemModel, m_mainWindow);
m_library = new LibraryWidget(m_projectManager, m_mainWindow);
connect(m_library, SIGNAL(addProjectClips(QList<QUrl>)), m_binWidget, SLOT(droppedUrls(QList<QUrl>)));
connect(this, &Core::updateLibraryPath, m_library, &LibraryWidget::slotUpdateLibraryPath);
m_monitorManager = new MonitorManager(this);
......
......@@ -1285,8 +1285,9 @@ void MainWindow::setupActions()
Qt::SHIFT + Qt::Key_R, clipActionCategory);
act->setEnabled(false);
act = addAction(QStringLiteral("delete_timeline_clip"), i18n("Delete Selected Item"), this, SLOT(slotDeleteItem()),
QIcon::fromTheme(QStringLiteral("edit-delete")), Qt::Key_Delete, clipActionCategory);
QIcon::fromTheme(QStringLiteral("edit-delete")), Qt::Key_Delete);
QAction *resizeStart = new QAction(QIcon(), i18n("Resize Item Start"), this);
addAction(QStringLiteral("resize_timeline_clip_start"), resizeStart, Qt::Key_1, clipActionCategory);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment