/build/openboard-git/src/OpenBoard/src/web/simplebrowser/tabwidget.cpp: In member function ‘void TabWidget::handleContextMenuRequested(const QPoint&)’:
/build/openboard-git/src/OpenBoard/src/web/simplebrowser/tabwidget.cpp:123:19: warning: ‘typename std::enable_if<((! std::is_same<const char*, Func1>::value) && QtPrivate::IsPointerToTypeDerivedFromQObject<T*>::Value), QAction*>::type QMenu::addAction(const QString&, const Obj*, Func1, const QKeySequence&) [with Obj = TabWidget; Func1 = WebView* (TabWidget::*)(); typename std::enable_if<((! std::is_same<const char*, Func1>::value) && QtPrivate::IsPointerToTypeDerivedFromQObject<T*>::Value), QAction*>::type = QAction*]’ is deprecated: Use addAction(text, shortcut, object, slot) instead. [-Wdeprecated-declarations]
123 | menu.addAction(tr("New &Tab"), this, &TabWidget::createTab, QKeySequence::AddTab);
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/qt6/QtWidgets/QMenu:1,
from /build/openboard-git/src/OpenBoard/src/web/simplebrowser/tabwidget.cpp:55:
/usr/include/qt6/QtWidgets/qmenu.h:78:9: note: declared here
78 | addAction(const QString &text, const Obj *object, Func1 slot,
| ^~~~~~~~~
Describe the problem
The PR #1001 removed many warnings that were cluttering the build logs while improving compatibility and potentially preempting future refactorings.
However, not all warnings were removed because they are trickier and might involve larger code changes. This issue shall provide a platform to collect and categorise these warnings and work towards a solution for them.
At the time of writing, 6 warnings remain.
Versions
Current dev (e9abc43)
Build commands
I'm using the
cmakecommunity build for Arch Linux, thoughqmakeshould be similarly affected. Full instructions: PKGBUILDWarnings
1. SingleApplication: QCryptographicHash::addData is deprecated
2. UBPreferencesController.cpp: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20
3. UBPersistenceManager.cpp: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20
4. UBMainWindow.cpp: constexpr QKeyCombination operator+ is deprecated
5. UBNetworkAccessManager.cpp: ‘++’ expression of ‘volatile’-qualified type is deprecated
6. web/simplebrowser/tabwidget.cpp: addAction overload is deprecated
Progress
this(andsettings). refactor(UBPreferencesController): narrow lambda capture #1050createDocumentProxyStructurewhich is static, making the lambda overkill. refactor(UBPersistenceManager): Make createDocumentProxyStructure static #1047|was introduced in Qt 6.0.0 [5][6]. Qt5 sort of works with the | operator due to its arithmetic representation of keys which is also used for +. refactor(UBMainWindow): Use | to combine keys #1051std::atomic_intinstead? fix(UBNetworkAccessManager): Use atomic_int instead of volatile #1048Warning 1 needs a dependency update. For the other warnings, there is a PR for further discussion.
@letsfindaway What do you think of warnings 4 and 6 in particular? Are there better solutions?
-- Vekhir