Skip to content

Commit e67147e

Browse files
committed
update webserver example for qt6
1 parent ee99dd9 commit e67147e

File tree

6 files changed

+12
-18
lines changed

6 files changed

+12
-18
lines changed

WebServer/WebServer.pro

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
TARGET = WebServer
44
TEMPLATE = app
55

6-
equals( QT_MAJOR_VERSION, 6 ) {
7-
QT += core5compat
8-
}
9-
106
QT += core
117
QT += network
128
QT -= gui

WebServer/context.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
#include <QVariant>
66
#include <QHash>
77

8-
#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version
9-
#include <QtCore5Compat>
10-
#endif
11-
128
#include "request.hpp"
139
#include "response.hpp"
1410

WebServer/main.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
#include <QVector>
88
#include <QList>
99

10-
#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version
11-
#include <QtCore5Compat>
12-
#endif
13-
1410
#include "recurse.hpp"
1511

1612
#include "xlsxdocument.h"

WebServer/recurse.hpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
#include <QVector>
1919

2020
#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version
21-
#include <QtCore5Compat>
21+
#include <QRegularExpression>
22+
#include <QRegularExpressionMatch>
2223
#endif
2324

2425
#include <functional>
@@ -439,10 +440,19 @@ namespace Recurse
439440
{
440441
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
441442

443+
#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version
444+
QRegularExpression debug_strings("(recurse|development)");
445+
446+
QRegularExpressionMatch rem = debug_strings.match(env.value("DEBUG"));
447+
if ( rem.hasMatch() )
448+
m_debug = true;
449+
#else
442450
QRegExp debug_strings("(recurse|development)");
443451

444452
if (debug_strings.indexIn(env.value("DEBUG")) != -1)
445453
m_debug = true;
454+
#endif
455+
446456
}
447457

448458
inline Application::Application(int &argc, char **argv, QObject *parent)

WebServer/request.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <QUrlQuery>
99

1010
#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version
11-
#include <QtCore5Compat>
11+
#include <QRegularExpression>
1212
#endif
1313

1414
class Request

WebServer/response.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
#include <QHash>
66
#include <QJsonDocument>
77

8-
#if QT_VERSION_MAJOR >= 6 // Qt6 or higher version
9-
#include <QtCore5Compat>
10-
#endif
11-
128
#include <functional>
139

1410
class Response

0 commit comments

Comments
 (0)