QEverCloud  4.1.0
Unofficial Evernote Cloud API for Qt
qt4helpers.h
Go to the documentation of this file.
1 
12 #ifndef QEVERCLOUD_QT4_HELPERS_H
13 #define QEVERCLOUD_QT4_HELPERS_H
14 
15 #include <QtGlobal>
16 #include <QString>
17 
18 #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
19 
20 #if __cplusplus >= 201103L
21 
22 #ifndef Q_DECL_OVERRIDE
23 #define Q_DECL_OVERRIDE override
24 #endif
25 
26 #ifndef Q_DECL_FINAL
27 #define Q_DECL_FINAL final
28 #endif
29 
30 #ifndef Q_STATIC_ASSERT_X
31 #define Q_STATIC_ASSERT_X(x1,x2) static_assert(x1, x2)
32 #endif
33 
34 #ifndef Q_DECL_EQ_DELETE
35 #define Q_DECL_EQ_DELETE = delete
36 #endif
37 
38 #ifndef Q_NULLPTR
39 #define Q_NULLPTR nullptr
40 #endif
41 
42 #else // __cplusplus
43 
44 #ifndef Q_DECL_OVERRIDE
45 #define Q_DECL_OVERRIDE
46 #endif
47 
48 #ifndef Q_DECL_FINAL
49 #define Q_DECL_FINAL
50 #endif
51 
52 #ifndef Q_STATIC_ASSERT_X
53 #define Q_STATIC_ASSERT_X(x1,x2)
54 #endif
55 
56 #ifndef Q_DECL_EQ_DELETE
57 #define Q_DECL_EQ_DELETE
58 #endif
59 
60 #ifndef Q_NULLPTR
61 #define Q_NULLPTR NULL
62 #endif
63 
64 #endif // __cplusplus
65 
66 #ifndef QStringLiteral
67 #define QStringLiteral(x) QString::fromUtf8(x, sizeof(x) - 1)
68 #endif
69 
70 #define QEC_SIGNAL(className, methodName, ...) SIGNAL(methodName(__VA_ARGS__))
71 #define QEC_SLOT(className, methodName, ...) SLOT(methodName(__VA_ARGS__))
72 
73 #else // QT_VERSION
74 
75 // VS2010 is supposed to be C++11 but does not fulfull the entire standard.
76 #if defined(_MSC_VER) && _MSC_VER <= 1600 // MSVC <= 2010
77 
78 #ifdef Q_DECL_OVERRIDE
79 #undef Q_DECL_OVERRIDE
80 #endif
81 #define Q_DECL_OVERRIDE
82 
83 #endif // VS2010
84 
85 #define QEC_SIGNAL(className, methodName, ...) &className::methodName
86 #define QEC_SLOT(className, methodName, ...) &className::methodName
87 
88 #endif // QT_VERSION
89 
90 #endif // QEVERCLOUD_QT4_HELPERS_H