Fix context menu in db query widget
* Signal is `QAction::triggered` and not `QAction::trigger` * Better use Qt 5.6 overload anyways
This commit is contained in:
parent
dcea67ad16
commit
43b55e0a5a
|
@ -430,12 +430,11 @@ void DbQueryWidget::showResultsContextMenu()
|
|||
if(!selection.isEmpty()) {
|
||||
QMenu contextMenu;
|
||||
if(m_ui->applyPushButton->isEnabled()) {
|
||||
connect(contextMenu.addAction(m_ui->applyPushButton->icon(), tr("Use selected row")), &QAction::trigger, this, static_cast<void(DbQueryWidget::*)(void)>(&DbQueryWidget::applySelectedResults));
|
||||
// NOTE: available in Qt 5.6 or later: contextMenu.addAction(m_ui->applyPushButton->icon(), tr("Use selected row"), this, static_cast<void(DbQueryWidget::*)(void)>(&DbQueryWidget::applySelectedResults));
|
||||
contextMenu.addAction(m_ui->applyPushButton->icon(), tr("Use selected row"), this, static_cast<void(DbQueryWidget::*)(void)>(&DbQueryWidget::applySelectedResults));
|
||||
}
|
||||
if(m_model && m_model->areResultsAvailable()) {
|
||||
connect(contextMenu.addAction(QIcon::fromTheme(QStringLiteral("view-preview")), tr("Show cover")), &QAction::trigger, this, &DbQueryWidget::fetchAndShowCoverForSelection);
|
||||
connect(contextMenu.addAction(QIcon::fromTheme(QStringLiteral("view-media-lyrics")), tr("Show lyrics")), &QAction::trigger, this, &DbQueryWidget::fetchAndShowLyricsForSelection);
|
||||
contextMenu.addAction(QIcon::fromTheme(QStringLiteral("view-preview")), tr("Show cover"), this, &DbQueryWidget::fetchAndShowCoverForSelection);
|
||||
contextMenu.addAction(QIcon::fromTheme(QStringLiteral("view-media-lyrics")), tr("Show lyrics"), this, &DbQueryWidget::fetchAndShowLyricsForSelection);
|
||||
}
|
||||
contextMenu.exec(QCursor::pos());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue