From fdbfeecb9c235a1885d882f02bfca044e72588a6 Mon Sep 17 00:00:00 2001 From: Jay Two Date: Sat, 5 Dec 2020 22:33:38 +0900 Subject: [PATCH] testing in qt6 --- QXlsx/header/xlsxworksheet_p.h | 1 + WebServer/context.hpp | 2 +- WebServer/main.cpp | 2 +- WebServer/recurse.hpp | 2 +- WebServer/request.hpp | 18 +++++++++--------- WebServer/response.hpp | 2 +- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/QXlsx/header/xlsxworksheet_p.h b/QXlsx/header/xlsxworksheet_p.h index 1897cc5..7ef81e2 100644 --- a/QXlsx/header/xlsxworksheet_p.h +++ b/QXlsx/header/xlsxworksheet_p.h @@ -9,6 +9,7 @@ #include #include #include + #if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) #include #else diff --git a/WebServer/context.hpp b/WebServer/context.hpp index d9c9861..33aa27a 100644 --- a/WebServer/context.hpp +++ b/WebServer/context.hpp @@ -5,7 +5,7 @@ #include #include -#ifdef QT_VERSION >= 0x060000 // Qt6 or higher version +#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version #include #endif diff --git a/WebServer/main.cpp b/WebServer/main.cpp index f0b1fc6..bd118d1 100644 --- a/WebServer/main.cpp +++ b/WebServer/main.cpp @@ -7,7 +7,7 @@ #include #include -#ifdef QT_VERSION >= 0x060000 // Qt6 or higher version +#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version #include #endif diff --git a/WebServer/recurse.hpp b/WebServer/recurse.hpp index fc9bee4..dcdac1c 100644 --- a/WebServer/recurse.hpp +++ b/WebServer/recurse.hpp @@ -17,7 +17,7 @@ #include #include -#ifdef QT_VERSION >= 0x060000 // Qt6 or higher version +#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version #include #endif diff --git a/WebServer/request.hpp b/WebServer/request.hpp index f56818c..47b995b 100644 --- a/WebServer/request.hpp +++ b/WebServer/request.hpp @@ -7,7 +7,7 @@ #include #include -#ifdef QT_VERSION >= 0x060000 // Qt6 or higher version +#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version #include #endif @@ -176,7 +176,7 @@ private: //! match HTTP request line //! -#ifdef QT_VERSION >= 0x060000 +#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version QRegularExpression httpRx = QRegularExpression("^(?=[A-Z]).* \\/.* HTTP\\/[0-9]\\.[0-9]\\r\\n"); #else QRegExp httpRx = QRegExp("^(?=[A-Z]).* \\/.* HTTP\\/[0-9]\\.[0-9]\\r\\n"); @@ -200,7 +200,7 @@ inline bool Request::parse(QString request) return true; } -#ifdef QT_VERSION >= 0x060000 +#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version auto data_list = this->data.split("\r\n"); #else auto data_list = this->data.splitRef("\r\n"); @@ -228,13 +228,13 @@ inline bool Request::parse(QString request) { auto first_line = entity_item.at(0).split(" "); -#ifdef QT_VERSION >= 0x060000 +#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version this->method = first_line.at(0); #else this->method = first_line.at(0).toString(); #endif -#ifdef QT_VERSION >= 0x060000 +#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version this->url = first_line.at(1); #else this->url = first_line.at(1).toString(); @@ -242,7 +242,7 @@ inline bool Request::parse(QString request) this->query.setQuery(this->url.query()); -#ifdef QT_VERSION >= 0x060000 +#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version this->protocol = first_line.at(2); #else this->protocol = first_line.at(2).toString(); @@ -251,7 +251,7 @@ inline bool Request::parse(QString request) continue; } -#ifdef QT_VERSION >= 0x060000 +#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version m_headers[entity_item.at(0).toLower()] = entity_item.at(1); #else m_headers[entity_item.at(0).toString().toLower()] = entity_item.at(1).toString(); @@ -267,7 +267,7 @@ inline bool Request::parse(QString request) if (m_headers.contains("cookie")) { -#ifdef QT_VERSION >= 0x060000 +#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version for (const auto &cookie : m_headers["cookie"].split(";")) #else for (const auto &cookie : m_headers["cookie"].splitRef(";")) @@ -283,7 +283,7 @@ inline bool Request::parse(QString request) auto value = cookie.mid(split + 1); -#ifdef QT_VERSION >= 0x060000 +#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version m_cookies[key.toLower()] = value; #else m_cookies[key.toString().toLower()] = value.toString(); diff --git a/WebServer/response.hpp b/WebServer/response.hpp index a8d2ec9..b742df9 100644 --- a/WebServer/response.hpp +++ b/WebServer/response.hpp @@ -5,7 +5,7 @@ #include #include -#ifdef QT_VERSION >= 0x060000 // Qt6 or higher version +#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version #include #endif