From 81236c8836abda6a39829c2ab96dd6b77f7e1c86 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Sat, 18 Jan 2014 20:12:21 +0100 Subject: [PATCH] qt5 ifdef --- src/core/hint.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/core/hint.h b/src/core/hint.h index 0619f59..fa2b82e 100644 --- a/src/core/hint.h +++ b/src/core/hint.h @@ -49,6 +49,21 @@ private: }; + + +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +template +inline Type myQVariantCast(const QVariant &dat) +{ + return qvariant_cast(dat); +} + +template +inline QVariant myQVariantFromValue(const Type &dat) +{ + return qVariantFromValue(dat); +} +#else template inline Type myQVariantCast(const QVariant &dat) { @@ -60,6 +75,7 @@ inline QVariant myQVariantFromValue(const Type &dat) { return qVariantFromValue(qobject_cast(dat)); } +#endif }