17 #ifndef NURIA_VARIANT_HPP
18 #define NURIA_VARIANT_HPP
20 #include "essentials.hpp"
41 template<
typename ... Items >
42 static QVariantList
buildList (
const Items &... items) {
44 buildListImpl (list, items ...);
56 static void *stealPointer (QVariant &variant);
64 static void *getPointer (QVariant &variant);
69 template<
typename T >
static inline const T &passThrough (
const T &t) {
return t; }
72 #ifndef NURIA_NO_CHAR_ARRAY_TO_QSTRING
73 static inline QString passThrough (
const char *str) {
return QString (str); }
77 static inline void buildListImpl (QVariantList &) { }
80 template<
typename T,
typename ... Items >
81 static inline void buildListImpl (QVariantList &list,
const T &cur,
const Items & ... items) {
82 list.append (QVariant::fromValue (passThrough (cur)));
83 buildListImpl (list, items ...);
93 #endif // NURIA_VARIANT_HPP
static QVariantList buildList(const Items &...items)
Definition: variant.hpp:42
Definition: abstractsessionmanager.hpp:24
Utilities for working with QVariants.
Definition: variant.hpp:28