QxOrm 1.4.9
C++ Object Relational Mapping library
Loading...
Searching...
No Matches
is_qt_variant_compatible.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** https://www.qxorm.com/
4** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)
5**
6** This file is part of the QxOrm library
7**
8** This software is provided 'as-is', without any express or implied
9** warranty. In no event will the authors be held liable for any
10** damages arising from the use of this software
11**
12** Commercial Usage
13** Licensees holding valid commercial QxOrm licenses may use this file in
14** accordance with the commercial license agreement provided with the
15** Software or, alternatively, in accordance with the terms contained in
16** a written agreement between you and Lionel Marty
17**
18** GNU General Public License Usage
19** Alternatively, this file may be used under the terms of the GNU
20** General Public License version 3.0 as published by the Free Software
21** Foundation and appearing in the file 'license.gpl3.txt' included in the
22** packaging of this file. Please review the following information to
23** ensure the GNU General Public License version 3.0 requirements will be
24** met : http://www.gnu.org/copyleft/gpl.html
25**
26** If you are unsure which license is appropriate for your use, or
27** if you have questions regarding the use of this file, please contact :
28** contact@qxorm.com
29**
30****************************************************************************/
31
32#ifndef _QX_IS_QT_VARIANT_COMPATIBLE_H_
33#define _QX_IS_QT_VARIANT_COMPATIBLE_H_
34
35#ifdef _MSC_VER
36#pragma once
37#endif
38
46#include <QtCore/qvariant.h>
47
48#include <QxCommon/QxConfig.h>
49
50namespace qx {
51namespace trait {
52
57template <typename T>
59{ enum { value = (std::is_enum<T>::value || std::is_integral<T>::value) }; };
60
61template <> struct is_qt_variant_compatible<bool> { enum { value = true }; };
62template <> struct is_qt_variant_compatible<short> { enum { value = true }; };
63template <> struct is_qt_variant_compatible<int> { enum { value = true }; };
64template <> struct is_qt_variant_compatible<long> { enum { value = true }; };
65template <> struct is_qt_variant_compatible<long long> { enum { value = true }; };
66template <> struct is_qt_variant_compatible<float> { enum { value = true }; };
67template <> struct is_qt_variant_compatible<double> { enum { value = true }; };
68template <> struct is_qt_variant_compatible<long double> { enum { value = true }; };
69template <> struct is_qt_variant_compatible<unsigned short> { enum { value = true }; };
70template <> struct is_qt_variant_compatible<unsigned int> { enum { value = true }; };
71template <> struct is_qt_variant_compatible<unsigned long> { enum { value = true }; };
72template <> struct is_qt_variant_compatible<unsigned long long> { enum { value = true }; };
73template <> struct is_qt_variant_compatible<QString> { enum { value = true }; };
74template <> struct is_qt_variant_compatible<QDate> { enum { value = true }; };
75template <> struct is_qt_variant_compatible<QTime> { enum { value = true }; };
76template <> struct is_qt_variant_compatible<QDateTime> { enum { value = true }; };
77template <> struct is_qt_variant_compatible<QBitArray> { enum { value = true }; };
78template <> struct is_qt_variant_compatible<QByteArray> { enum { value = true }; };
79template <> struct is_qt_variant_compatible<QLatin1String> { enum { value = true }; };
80template <> struct is_qt_variant_compatible<QStringList> { enum { value = true }; };
81template <> struct is_qt_variant_compatible<QChar> { enum { value = true }; };
82template <> struct is_qt_variant_compatible<QLocale> { enum { value = true }; };
83template <> struct is_qt_variant_compatible<QSize> { enum { value = true }; };
84template <> struct is_qt_variant_compatible<QSizeF> { enum { value = true }; };
85template <> struct is_qt_variant_compatible<QPoint> { enum { value = true }; };
86template <> struct is_qt_variant_compatible<QPointF> { enum { value = true }; };
87template <> struct is_qt_variant_compatible<QLine> { enum { value = true }; };
88template <> struct is_qt_variant_compatible<QLineF> { enum { value = true }; };
89template <> struct is_qt_variant_compatible<QRect> { enum { value = true }; };
90template <> struct is_qt_variant_compatible<QRectF> { enum { value = true }; };
91template <> struct is_qt_variant_compatible<QUrl> { enum { value = true }; };
92template <> struct is_qt_variant_compatible<QVariant> { enum { value = true }; };
93
94#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
95template <> struct is_qt_variant_compatible<QRegExp> { enum { value = true }; };
96#endif // (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
97
98#ifdef _QX_ENABLE_QT_GUI
99template <> struct is_qt_variant_compatible<QBrush> { enum { value = true }; };
100template <> struct is_qt_variant_compatible<QColor> { enum { value = true }; };
101template <> struct is_qt_variant_compatible<QFont> { enum { value = true }; };
102template <> struct is_qt_variant_compatible<QImage> { enum { value = true }; };
103template <> struct is_qt_variant_compatible<QPixmap> { enum { value = true }; };
104template <> struct is_qt_variant_compatible<QRegion> { enum { value = true }; };
105#endif // _QX_ENABLE_QT_GUI
106
107template <> struct is_qt_variant_compatible< QList<QVariant> > { enum { value = true }; };
108template <> struct is_qt_variant_compatible< QMap<QString, QVariant> > { enum { value = true }; };
109template <> struct is_qt_variant_compatible< QHash<QString, QVariant> > { enum { value = true }; };
110
111} // namespace trait
112} // namespace qx
113
114#endif // _QX_IS_QT_VARIANT_COMPATIBLE_H_
List of parameters to compile and build QxOrm library.
Root namespace for all QxOrm library features.
qx::trait::is_qt_variant_compatible<T>::value : return true if T can be host into a QVariant object o...