|
35 | 35 | #include <memory> |
36 | 36 | #include <string> |
37 | 37 | #include <stdexcept> |
38 | | -#if defined(USE_QT5)||defined(USE_QT4) |
| 38 | +#if defined(USE_QT5)||defined(USE_QT6) |
39 | 39 | #include <QString> |
40 | 40 | #include <QStringList> |
41 | 41 | #include <QSet> |
|
51 | 51 | // Get number of elements of a fixed-sized array |
52 | 52 | #define DIM(x) (sizeof( x ) / sizeof( x [0] ) ) |
53 | 53 |
|
54 | | -#if defined(USE_QT5)||defined(USE_QT4) |
| 54 | +#if defined(USE_QT5)||defined(USE_QT6) |
55 | 55 | typedef QString tStr; |
56 | 56 | typedef QString::iterator tStrIter; |
57 | 57 | typedef QStringList tVecStr; |
58 | 58 | typedef QSet<QString> tSetStr; |
| 59 | + |
59 | 60 | #else // only STL |
60 | 61 | typedef std::string tStr; |
61 | 62 | typedef std::string::iterator tStrIter; |
62 | 63 | typedef std::vector<std::string> tVecStr; |
63 | 64 | typedef std::set<std::string> tSetStr; |
64 | 65 | #endif |
65 | 66 |
|
66 | | -#if defined(USE_QT5) // use Qt5's QString |
| 67 | +#if defined(USE_QT5)||defined(USE_QT6) |
67 | 68 | #define C_STR(x) toLatin1(x).data(x) |
68 | 69 | #define STRISEMPTY(x) isEmpty(x) |
69 | 70 | #define STRTOLOWER(x,y) x = y.toLower() |
70 | 71 | #define CHAR_AT(x) at(x).toLatin1() |
71 | 72 |
|
72 | | -#elif defined(USE_QT4) // use Qt4's QString |
73 | | -#define C_STR(x) toAscii(x).data(x) |
74 | | -#define STRISEMPTY(x) isEmpty(x) |
75 | | -#define STRTOLOWER(x,y) x = y.toLower() |
76 | | -#define CHAR_AT(x) at(x).toLatin1() |
77 | | - |
78 | 73 | #else // use std::string |
79 | 74 | #define C_STR(x) c_str(x) |
80 | 75 | #define STRISEMPTY(x) empty(x) |
@@ -188,7 +183,7 @@ std::string string_format( const std::string& format, Args ... args ) |
188 | 183 | return std::string( buf.get(), buf.get() + size - 1 ); // We don't want the '\0' inside |
189 | 184 | } |
190 | 185 |
|
191 | | -#if defined(USE_QT5)||defined(USE_QT4) |
| 186 | +#if defined(USE_QT5)||defined(USE_QT6) |
192 | 187 | template<typename ... Args> |
193 | 188 | QString string_format( const QString& format, Args ... args ) |
194 | 189 | { |
|
0 commit comments