parent
a98c209101
commit
f901f802bb
|
@ -343,6 +343,22 @@ void CollectionView::mouseReleaseEvent(QMouseEvent *e) {
|
|||
|
||||
}
|
||||
|
||||
void CollectionView::keyPressEvent(QKeyEvent *e) {
|
||||
|
||||
switch (e->key()) {
|
||||
case Qt::Key_Enter:
|
||||
case Qt::Key_Return:
|
||||
if (currentIndex().isValid()) {
|
||||
AddToPlaylist();
|
||||
}
|
||||
e->accept();
|
||||
break;
|
||||
}
|
||||
|
||||
AutoExpandingTreeView::keyPressEvent(e);
|
||||
|
||||
}
|
||||
|
||||
void CollectionView::contextMenuEvent(QContextMenuEvent *e) {
|
||||
|
||||
if (!context_menu_) {
|
||||
|
|
|
@ -93,6 +93,7 @@ class CollectionView : public AutoExpandingTreeView {
|
|||
protected:
|
||||
// QWidget
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
void keyPressEvent(QKeyEvent *e) override;
|
||||
void mouseReleaseEvent(QMouseEvent *e) override;
|
||||
void contextMenuEvent(QContextMenuEvent *e) override;
|
||||
|
||||
|
|
Loading…
Reference in New Issue