UI: add context menu for later use
This commit is contained in:
@ -27,6 +27,7 @@
|
||||
#include <QListView>
|
||||
#include <QCollator>
|
||||
#include <QMimeData>
|
||||
#include <QMenu>
|
||||
#include <QWindow>
|
||||
#include <QStandardPaths>
|
||||
#include <QMediaDevices>
|
||||
@ -267,6 +268,16 @@ void MainWindow::dropEvent(QDropEvent *e)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::contextMenuEvent(QContextMenuEvent *event)
|
||||
{
|
||||
QMenu * menu = new QMenu;
|
||||
menu->addAction(ui->actionHelp);
|
||||
menu->exec(mapToGlobal(event->pos()));
|
||||
menu->deleteLater();
|
||||
|
||||
return QMainWindow::contextMenuEvent(event);
|
||||
}
|
||||
|
||||
void MainWindow::loadFile()
|
||||
{
|
||||
QStringList musicFolders(QStandardPaths::standardLocations(QStandardPaths::MusicLocation));
|
||||
@ -734,4 +745,3 @@ QGraphicsDropShadowEffect *MainWindow::createLabelShadowEffect()
|
||||
effect->setOffset(1, 1);
|
||||
return effect;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user