oclero / qlementine

⚠️🏗️ [WORK IN PROGRESS] 🍊Modern QStyle for desktop Qt6 applications.
https://oclero.github.io/qlementine/
MIT License
73 stars 16 forks source link

Build using Qt 6.6.1 fails `overload resolution selected deleted operator '+'` #51

Closed ManuelSchneid3r closed 6 months ago

ManuelSchneid3r commented 8 months ago
/Users/manuel/Desktop/qlementine/sandbox/src/SandboxWindow.cpp:1519:81: error: overload resolution selected deleted operator '+'
          menu.addAction(textList.join("") + QString(" %1").arg(i), cb, Qt::ALT + Qt::SHIFT + Qt::Key_0 + i);
                                                                        ~~~~~~~ ^ ~~~~~~~~~
/opt/homebrew/include/QtCore/qnamespace.h:1075:5: note: candidate function has been explicitly deleted
    Q_DECLARE_OPERATORS_FOR_FLAGS(Modifiers)
    ^
/opt/homebrew/include/QtCore/qflags.h:213:23: note: expanded from macro 'Q_DECLARE_OPERATORS_FOR_FLAGS'
constexpr inline void operator+(Flags::enum_type f1, Flags::enum_type f2) noexcept = delete; \
                      ^
/opt/homebrew/include/QtCore/qnamespace.h:1075:5: note: candidate function has been explicitly deleted
/opt/homebrew/include/QtCore/qflags.h:214:23: note: expanded from macro 'Q_DECLARE_OPERATORS_FOR_FLAGS'
constexpr inline void operator+(Flags::enum_type f1, QFlags<Flags::enum_type> f2) noexcept = delete; \
                      ^
/opt/homebrew/include/QtCore/qnamespace.h:1075:5: note: candidate function has been explicitly deleted
/opt/homebrew/include/QtCore/qflags.h:219:23: note: expanded from macro 'Q_DECLARE_OPERATORS_FOR_FLAGS'
constexpr inline void operator+(int f1, Flags::enum_type f2) noexcept = delete; \
                      ^
/opt/homebrew/include/QtCore/qnamespace.h:1075:5: note: candidate function has been explicitly deleted
/opt/homebrew/include/QtCore/qflags.h:220:23: note: expanded from macro 'Q_DECLARE_OPERATORS_FOR_FLAGS'
constexpr inline void operator+(Flags::enum_type f1, int f2) noexcept = delete; \
                      ^
/Users/manuel/Desktop/qlementine/sandbox/src/SandboxWindow.cpp:1519:81: note: built-in candidate operator+(unsigned int, unsigned int)
          menu.addAction(textList.join("") + QString(" %1").arg(i), cb, Qt::ALT + Qt::SHIFT + Qt::Key_0 + i);
                                                                                ^
oclero commented 8 months ago

@ManuelSchneid3r Are you using Qt6? This code was valid Qt5 code, but since Qt6, they changed that. I need to replace + by |

oclero commented 6 months ago

Fixed by e5a77a3