summaryrefslogtreecommitdiffhomepage
path: root/options/metatype.hpp
blob: c889766af394bc6a7f3715f3508f46aaaf8db0e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once

#include <QMetaType>
#include <QList>
#include <QString>
#include <QPointF>
#include <QDataStream>
#include <QDebug>

#include "export.hpp"
#include "slider.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>)
Q_DECLARE_METATYPE(::options::slider_value)

namespace options {
namespace detail {

struct custom_type_initializer final
{
    static const custom_type_initializer singleton;

    custom_type_initializer();

    template<typename t> static void declare_for_type(const char* str)
    {
        qRegisterMetaType<t>(str);
        qRegisterMetaTypeStreamOperators<t>();
    }
};

}
}