summaryrefslogtreecommitdiffhomepage
path: root/options/metatype.hpp
blob: 68480b55053f4b2e026c6881185928314a643781 (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
#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>();
    }
};

}
}