From b78cfd45ce5c979ab646cb280ef96bceec9a7419 Mon Sep 17 00:00:00 2001 From: Steven de Ridder Date: Thu, 27 Jan 2022 11:13:49 +0100 Subject: [PATCH] Qt6 / c++17 changes. --- CMakeLists.txt | 2 ++ src/CMakeLists.txt | 8 ++++---- src/dbconnector.cpp | 2 +- src/dbconnector.h | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fd403f..10939ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,8 @@ endif() # ============================================================================== +set(CMAKE_CXX_STANDARD 17) + include(projectheader) project_header(osdev_dbconnector) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a367dc3..9fd9a1b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -25,12 +25,12 @@ endif() include(projectheader) project_header(dbconnector) -find_package( Qt5Core REQUIRED ) -find_package( Qt5Sql REQUIRED ) +find_package( Qt6Core REQUIRED ) +find_package( Qt6Sql REQUIRED ) include_directories( SYSTEM - ${Qt5Core_INCLUDE_DIRS} - ${Qt5Sql_INCLUDE_DIRS} + ${Qt6Core_INCLUDE_DIRS} + ${Qt6Sql_INCLUDE_DIRS} ) include(compiler) diff --git a/src/dbconnector.cpp b/src/dbconnector.cpp index 6f84b24..0c50fa4 100644 --- a/src/dbconnector.cpp +++ b/src/dbconnector.cpp @@ -509,7 +509,7 @@ bool DbConnector::recordsExist( const QString& sTable, const QString& sField, co { valueList.append(this->toSqlValueString(v)); } - QStringList uniqueValueList = valueList.toSet().toList(); + QStringList uniqueValueList = valueList.toList(); auto queryResult = this->executeQuery(countQuery .arg(this->quoteTableName(sTable)) .arg(this->quoteFieldName(sField)) diff --git a/src/dbconnector.h b/src/dbconnector.h index ecb432b..0eab291 100644 --- a/src/dbconnector.h +++ b/src/dbconnector.h @@ -38,7 +38,7 @@ class QSqlQuery; class QString; -class QStringList; +//class QStringList; template class QHash; class QSqlDatabase; -- libgit2 0.21.4