diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-07-24 12:47:05 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-07-24 12:47:05 +0200 |
commit | 9762ccffa4df162d8574d76749d21d09b57c52ad (patch) | |
tree | dce2ffda8811adb868745e132c126276cd05a545 /options/metatype.hpp | |
parent | 3f15d496d65600fdd53f0b91a39a8cd5d2d91f7d (diff) |
Revert "options/metatype: nuke it"
This was making sliders unable to save at all.
Diffstat (limited to 'options/metatype.hpp')
-rw-r--r-- | options/metatype.hpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/options/metatype.hpp b/options/metatype.hpp new file mode 100644 index 00000000..68480b55 --- /dev/null +++ b/options/metatype.hpp @@ -0,0 +1,36 @@ +#pragma once + +#include <QMetaType> +#include <QList> +#include <QString> +#include <QPointF> +#include <QDataStream> +#include <QDebug> + +#include "export.hpp" + +Q_DECLARE_METATYPE(QList<double>) +Q_DECLARE_METATYPE(QList<float>) +Q_DECLARE_METATYPE(QList<int>) +Q_DECLARE_METATYPE(QList<bool>) +Q_DECLARE_METATYPE(QList<QString>) +Q_DECLARE_METATYPE(QList<QPointF>) + +namespace options { +namespace detail { + +struct custom_type_initializer final +{ + static const custom_type_initializer singleton; + + custom_type_initializer(); + + template<typename t> static inline void declare_for_type(const char* str) + { + qRegisterMetaType<t>(str); + qRegisterMetaTypeStreamOperators<t>(); + } +}; + +} +} |