mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
fix: Qt5 compat - fix addAction wrapper, qHash for NodeKind, add windows-qt5 CI
This commit is contained in:
@@ -32,7 +32,7 @@ enum class NodeKind : uint8_t {
|
||||
|
||||
} // namespace rcx (temporarily close for qHash)
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
inline uint qHash(rcx::NodeKind key, uint seed = 0) { return ::qHash(static_cast<uint8_t>(key), seed); }
|
||||
inline uint qHash(rcx::NodeKind key, uint seed = 0) { return qHash(static_cast<int>(key), seed); }
|
||||
#endif
|
||||
namespace rcx { // reopen
|
||||
|
||||
|
||||
@@ -357,10 +357,12 @@ QIcon MainWindow::makeIcon(const QString& svgPath) {
|
||||
}
|
||||
|
||||
template < typename...Args >
|
||||
inline QAction* Qt5Qt6AddAction(QWidget* parent, const QString &text, const QKeySequence &shortcut, const QIcon &icon, Args&&...args)
|
||||
inline QAction* Qt5Qt6AddAction(QMenu* menu, const QString &text, const QKeySequence &shortcut, const QIcon &icon, Args&&...args)
|
||||
{
|
||||
QAction *result = parent->addAction(icon, text, shortcut);
|
||||
parent->connect(result, &QAction::triggered, std::forward<Args>(args)...);
|
||||
QAction *result = menu->addAction(icon, text);
|
||||
if (!shortcut.isEmpty())
|
||||
result->setShortcut(shortcut);
|
||||
QObject::connect(result, &QAction::triggered, std::forward<Args>(args)...);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user