diff --git a/paletteeditor/paletteeditor.cpp b/paletteeditor/paletteeditor.cpp index 1dcfeba..6ad799b 100644 --- a/paletteeditor/paletteeditor.cpp +++ b/paletteeditor/paletteeditor.cpp @@ -14,6 +14,8 @@ #include #include +#include + namespace QtUtilities { enum { BrushRole = 33 }; @@ -72,8 +74,9 @@ void PaletteEditor::setPalette(const QPalette &palette) resolve() #endif ; + using MaskType = std::remove_cv_t; for (int i = 0; i < static_cast(QPalette::NColorRoles); ++i) { - if (mask & (static_cast(1) << static_cast(i))) { + if (mask & (static_cast(1) << static_cast(i))) { continue; } m_editPalette.setBrush( @@ -248,8 +251,9 @@ QPalette PaletteEditor::getPalette(QWidget *parent, const QPalette &init, const resolve() #endif ; + using MaskType = std::remove_cv_t; for (int i = 0; i < static_cast(QPalette::NColorRoles); ++i) { - if (mask & (static_cast(1) << static_cast(i))) { + if (mask & (static_cast(1) << static_cast(i))) { continue; } parentPalette.setBrush( @@ -308,9 +312,8 @@ QVariant PaletteModel::data(const QModelIndex &index, int role) const resolve() #endif ; - if (mask & (static_cast(1) << static_cast(index.row()))) - return true; - return false; + using MaskType = std::remove_cv_t; + return mask & (static_cast(1) << static_cast(index.row())); } return QVariant(); }