From 62b6fe7f8f6e0209ff7c65d2da7e841e0a752b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20de=20Chalendar?= Date: Fri, 19 Apr 2024 12:31:43 +0200 Subject: [PATCH] Port to Qt6 --- CMakeLists.txt | 1 + Dockerfile-debian12 | 3 ++- examples/CMakeLists.txt | 2 +- examples/bodydata/CMakeLists.txt | 2 +- examples/greeting/CMakeLists.txt | 2 +- examples/helloworld/CMakeLists.txt | 2 +- src/CMakeLists.txt | 2 +- src/qhttprequest.h | 2 +- 8 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7753e0a..b2f4d0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,6 +110,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) find_package(Qt6 REQUIRED COMPONENTS Core Network) set(Qt6_LIBRARIES Qt6::Core Qt6::Network ) +qt_standard_project_setup() message("Found Qt6 ${Qt6Core_VERSION}") message("\n\n\n{Qt6_LIBRARIES}=${Qt6_LIBRARIES} ") diff --git a/Dockerfile-debian12 b/Dockerfile-debian12 index 52e95eb..6295b10 100644 --- a/Dockerfile-debian12 +++ b/Dockerfile-debian12 @@ -6,7 +6,8 @@ ENV DEBIAN_FRONTEND=noninteractive # Setup RUN apt-get update -y -qq && apt-get install -y apt-utils wget bzip2 git gcc g++ cmake cmake-data ninja-build qt6-base-dev-tools qt6-declarative-dev packaging-dev -qq RUN mkdir -p /src/ -RUN git clone https://github.com/aymara/qhttpserver /src/qhttpserver +COPY . /src/qhttpserver +#RUN git clone https://github.com/aymara/qhttpserver /src/qhttpserver RUN mkdir -p /src/qhttpserver/build diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 8188137..69584c6 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,3 +1,3 @@ add_subdirectory(helloworld) -add_subdirectory(greeting) +# add_subdirectory(greeting) #add_subdirectory(bodydata) diff --git a/examples/bodydata/CMakeLists.txt b/examples/bodydata/CMakeLists.txt index 66e0bfa..58eb469 100644 --- a/examples/bodydata/CMakeLists.txt +++ b/examples/bodydata/CMakeLists.txt @@ -8,7 +8,7 @@ SET(œ_EXE_SRCS add_executable(bodydata_server ${bodydata_EXE_SRCS}) -target_link_libraries(bodydata_server qhttpserver ${Qt5_LIBRARIES}) +target_link_libraries(bodydata_server qhttpserver ${Qt6_LIBRARIES}) add_test( NAME bodydata_Test diff --git a/examples/greeting/CMakeLists.txt b/examples/greeting/CMakeLists.txt index a3c3f7c..431fd8b 100644 --- a/examples/greeting/CMakeLists.txt +++ b/examples/greeting/CMakeLists.txt @@ -8,7 +8,7 @@ SET(greeting_EXE_SRCS add_executable(greeting_server ${greeting_EXE_SRCS}) -target_link_libraries(greeting_server qhttpserver ${Qt5_LIBRARIES}) +target_link_libraries(greeting_server qhttpserver ${Qt6_LIBRARIES}) add_test( NAME greeting_Test diff --git a/examples/helloworld/CMakeLists.txt b/examples/helloworld/CMakeLists.txt index a112392..e96eabf 100644 --- a/examples/helloworld/CMakeLists.txt +++ b/examples/helloworld/CMakeLists.txt @@ -8,7 +8,7 @@ SET(helloworld_EXE_SRCS add_executable(helloworld_server ${helloworld_EXE_SRCS}) -target_link_libraries(helloworld_server qhttpserver ${Qt5_LIBRARIES}) +target_link_libraries(helloworld_server qhttpserver ${Qt6_LIBRARIES}) add_test( NAME helloworld_Test diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 633b50b..07ab246 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,7 +15,7 @@ SET(qhttpserver_LIB_SRCS add_library(qhttpserver SHARED ${qhttpserver_LIB_SRCS}) -target_link_libraries(qhttpserver ${Qt5_LIBRARIES}) +target_link_libraries(qhttpserver ${Qt6_LIBRARIES}) install(TARGETS qhttpserver DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/qhttprequest.h b/src/qhttprequest.h index 4f9cc3b..03ee0e4 100644 --- a/src/qhttprequest.h +++ b/src/qhttprequest.h @@ -46,7 +46,7 @@ class QHTTPSERVER_API QHttpRequest : public QObject Q_PROPERTY(HeaderHash headers READ headers) Q_PROPERTY(QString remoteAddress READ remoteAddress) Q_PROPERTY(quint16 remotePort READ remotePort) - Q_PROPERTY(QString method READ method) + Q_PROPERTY(QString method READ methodString) Q_PROPERTY(QUrl url READ url) Q_PROPERTY(QString path READ path) Q_PROPERTY(QString httpVersion READ httpVersion)