Skip to content

Commit ec7bc57

Browse files
committed
Update compiler def for Qt
1 parent b2a6b11 commit ec7bc57

3 files changed

Lines changed: 7 additions & 12 deletions

File tree

gui/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ else (BUILD_QT5)
196196
set(CMAKE_AUTORCC OFF)
197197
set(CMAKE_AUTOUIC OFF)
198198

199-
add_definitions( -DUSE_QT5 )
199+
add_definitions( -DUSE_QT6 )
200200
add_compile_definitions(QT_DISABLE_DEPRECATED_UP_TO=0x050F00)
201201

202202
set_target_properties(Qt6::Core PROPERTIES MAP_IMPORTED_CONFIG_COVERAGE "RELEASE")

querylib/small_lib.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include <memory>
3636
#include <string>
3737
#include <stdexcept>
38-
#if defined(USE_QT5)||defined(USE_QT4)
38+
#if defined(USE_QT5)||defined(USE_QT6)
3939
#include <QString>
4040
#include <QStringList>
4141
#include <QSet>
@@ -51,30 +51,25 @@
5151
// Get number of elements of a fixed-sized array
5252
#define DIM(x) (sizeof( x ) / sizeof( x [0] ) )
5353

54-
#if defined(USE_QT5)||defined(USE_QT4)
54+
#if defined(USE_QT5)||defined(USE_QT6)
5555
typedef QString tStr;
5656
typedef QString::iterator tStrIter;
5757
typedef QStringList tVecStr;
5858
typedef QSet<QString> tSetStr;
59+
5960
#else // only STL
6061
typedef std::string tStr;
6162
typedef std::string::iterator tStrIter;
6263
typedef std::vector<std::string> tVecStr;
6364
typedef std::set<std::string> tSetStr;
6465
#endif
6566

66-
#if defined(USE_QT5) // use Qt5's QString
67+
#if defined(USE_QT5)||defined(USE_QT6)
6768
#define C_STR(x) toLatin1(x).data(x)
6869
#define STRISEMPTY(x) isEmpty(x)
6970
#define STRTOLOWER(x,y) x = y.toLower()
7071
#define CHAR_AT(x) at(x).toLatin1()
7172

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-
7873
#else // use std::string
7974
#define C_STR(x) c_str(x)
8075
#define STRISEMPTY(x) empty(x)
@@ -188,7 +183,7 @@ std::string string_format( const std::string& format, Args ... args )
188183
return std::string( buf.get(), buf.get() + size - 1 ); // We don't want the '\0' inside
189184
}
190185

191-
#if defined(USE_QT5)||defined(USE_QT4)
186+
#if defined(USE_QT5)||defined(USE_QT6)
192187
template<typename ... Args>
193188
QString string_format( const QString& format, Args ... args )
194189
{

showgraph/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ else (BUILD_QT5)
7373
set(CMAKE_AUTORCC ON)
7474
set(CMAKE_AUTOUIC ON)
7575

76-
add_definitions( -DUSE_QT5 )
76+
add_definitions( -DUSE_QT6 )
7777
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
7878

7979
set_target_properties(Qt6::Core PROPERTIES MAP_IMPORTED_CONFIG_COVERAGE "RELEASE")

0 commit comments

Comments
 (0)