From ef8c7b0a4c54165a40bc1e3a2d066dff145876fa Mon Sep 17 00:00:00 2001 From: tenzap <46226844+tenzap@users.noreply.github.com> Date: Sun, 29 Jan 2023 17:12:12 +0100 Subject: [PATCH] Fix build failure with Qt5.6 (#8829) With Qt 5.6, build fails with error below. This is because in Qt 5.6, the 3rd argument is not optional. Starting from Qt 5.7 the default value for the 3rd argument is nullptr, so setting it to nullptr. https://doc.qt.io/archives/qt-5.6/qaction.html#QAction-2 https://doc.qt.io/archives/qt-5.7/qaction.html#QAction-2 Error: src/gui/tag/TagView.cpp:79:38: error: no matching constructor for initialization of 'QAction' auto action = menu.exec({new QAction(icons()->icon("trash"), tr("Remove Search"))}, mapToGlobal(pos)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- src/gui/tag/TagView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/tag/TagView.cpp b/src/gui/tag/TagView.cpp index 82a977f3..8afdac44 100644 --- a/src/gui/tag/TagView.cpp +++ b/src/gui/tag/TagView.cpp @@ -76,14 +76,14 @@ void TagView::contextMenuRequested(const QPoint& pos) if (type == TagModel::SAVED_SEARCH) { // Allow deleting saved searches QMenu menu; - auto action = menu.exec({new QAction(icons()->icon("trash"), tr("Remove Search"))}, mapToGlobal(pos)); + auto action = menu.exec({new QAction(icons()->icon("trash"), tr("Remove Search"), nullptr)}, mapToGlobal(pos)); if (action) { m_db->metadata()->deleteSavedSearch(index.data(Qt::DisplayRole).toString()); } } else if (type == TagModel::TAG) { // Allow removing tags from all entries in a database QMenu menu; - auto action = menu.exec({new QAction(icons()->icon("trash"), tr("Remove Tag"))}, mapToGlobal(pos)); + auto action = menu.exec({new QAction(icons()->icon("trash"), tr("Remove Tag"), nullptr)}, mapToGlobal(pos)); if (action) { auto tag = index.data(Qt::DisplayRole).toString(); auto ans = MessageBox::question(this,