Inline ExtraDataType hash function

This commit is contained in:
Sine Striker 2023-09-28 20:23:12 +08:00
parent 0563bb8342
commit dd75e73e50
2 changed files with 3 additions and 8 deletions

View File

@ -117,7 +117,9 @@ enum class ExtraDataType : quint8
}; };
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
FRAMELESSHELPER_CORE_API uint qHash(ExtraDataType key, uint seed = 0) noexcept; inline uint qHash(ExtraDataType key, uint seed = 0) noexcept {
return ::qHash(static_cast<quint8>(key), seed);
}
#endif #endif
struct FRAMELESSHELPER_CORE_API FramelessExtraData struct FRAMELESSHELPER_CORE_API FramelessExtraData

View File

@ -26,7 +26,6 @@
#include "framelesshelpercore_global_p.h" #include "framelesshelpercore_global_p.h"
#include "versionnumber_p.h" #include "versionnumber_p.h"
#include "utils.h" #include "utils.h"
#include <QtCore/qhashfunctions.h>
#include <QtCore/qiodevice.h> #include <QtCore/qiodevice.h>
#include <QtCore/qcoreapplication.h> #include <QtCore/qcoreapplication.h>
#include <QtCore/qloggingcategory.h> #include <QtCore/qloggingcategory.h>
@ -124,12 +123,6 @@ FramelessCallbacksPtr FramelessCallbacks::create()
return std::make_shared<FramelessCallbacks>(); return std::make_shared<FramelessCallbacks>();
} }
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
uint qHash(ExtraDataType key, uint seed) noexcept {
return ::qHash(static_cast<quint8>(key), seed);
}
#endif
FramelessExtraData::FramelessExtraData() = default; FramelessExtraData::FramelessExtraData() = default;
FramelessExtraData::~FramelessExtraData() = default; FramelessExtraData::~FramelessExtraData() = default;