Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
5b3704c6
Unverified
Commit
5b3704c6
authored
Aug 04, 2021
by
Noir
Committed by
GitHub
Aug 04, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1288
Port Qt examples to Qt 6
parents
7831c888
a45f31aa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
26 deletions
+30
-26
CHANGELOG.md
CHANGELOG.md
+7
-0
CMakeLists.txt
CMakeLists.txt
+1
-1
Jenkinsfile
Jenkinsfile
+2
-2
configure
configure
+2
-2
examples/CMakeLists.txt
examples/CMakeLists.txt
+11
-11
examples/qtsupport/chatwidget.cpp
examples/qtsupport/chatwidget.cpp
+7
-10
No files found.
CHANGELOG.md
View file @
5b3704c6
...
...
@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file. The format
is based on
[
Keep a Changelog
](
https://keepachangelog.com
)
.
## [Unreleased]
### Changed
-
Since support of Qt 5 expired, we have ported the Qt examples to version 6.
Hence, building the Qt examples now requires Qt in version 6.
## [0.18.5] - 2021-07-16
### Fixed
...
...
CMakeLists.txt
View file @
5b3704c6
...
...
@@ -23,7 +23,7 @@ option(THREADS_PREFER_PTHREAD_FLAG "Prefer -pthread flag if available " ON)
option
(
CAF_ENABLE_CURL_EXAMPLES
"Build examples with libcurl"
OFF
)
option
(
CAF_ENABLE_PROTOBUF_EXAMPLES
"Build examples with Google Protobuf"
OFF
)
option
(
CAF_ENABLE_QT
5_EXAMPLES
"Build examples with the Qt5
framework"
OFF
)
option
(
CAF_ENABLE_QT
6_EXAMPLES
"Build examples with the Qt6
framework"
OFF
)
option
(
CAF_ENABLE_RUNTIME_CHECKS
"Build CAF with extra runtime assertions"
OFF
)
option
(
CAF_ENABLE_UTILITY_TARGETS
"Include targets like consistency-check"
OFF
)
option
(
CAF_ENABLE_ACTOR_PROFILER
"Enable experimental profiler API"
OFF
)
...
...
Jenkinsfile
View file @
5b3704c6
...
...
@@ -115,9 +115,9 @@ config = [
extraBuildFlags:
[
'CAF_ENABLE_CURL_EXAMPLES:BOOL=ON'
,
'CAF_ENABLE_PROTOBUF_EXAMPLES:BOOL=ON'
,
'CAF_ENABLE_QT
5
_EXAMPLES:BOOL=ON'
,
'CAF_ENABLE_QT
6
_EXAMPLES:BOOL=ON'
,
'OPENSSL_ROOT_DIR:PATH=/usr/local/opt/openssl'
,
'Qt
5_DIR:PATH=/usr/local/opt/qt/lib/cmake/Qt5
'
,
'Qt
6_DIR:PATH=/usr/local/opt/qt/lib/cmake/Qt6
'
,
],
extraDebugBuildFlags:
[
'CAF_SANITIZERS:STRING=address'
,
...
...
configure
View file @
5b3704c6
...
...
@@ -55,7 +55,7 @@ Flags (use --enable-<name> to activate and --disable-<name> to deactivate):
prefer-pthread-flag prefer -pthread flag if available [ON]
curl-examples build examples with libcurl [OFF]
protobuf-examples build examples with Google Protobuf [OFF]
qt
5-examples build examples with the Qt5
framework [OFF]
qt
6-examples build examples with the Qt6
framework [OFF]
runtime-checks build CAF with extra runtime assertions [OFF]
utility-targets include targets like consistency-check [OFF]
actor-profiler enable experimental proiler API [OFF]
...
...
@@ -101,7 +101,7 @@ set_build_flag() {
prefer-pthread-flag
)
FlagName
=
'THREADS_PREFER_PTHREAD_FLAG'
;;
curl-examples
)
FlagName
=
'CAF_ENABLE_CURL_EXAMPLES'
;;
protobuf-examples
)
FlagName
=
'CAF_ENABLE_PROTOBUF_EXAMPLES'
;;
qt
5-examples
)
FlagName
=
'CAF_ENABLE_QT5
_EXAMPLES'
;;
qt
6-examples
)
FlagName
=
'CAF_ENABLE_QT6
_EXAMPLES'
;;
runtime-checks
)
FlagName
=
'CAF_ENABLE_RUNTIME_CHECKS'
;;
utility-targets
)
FlagName
=
'CAF_ENABLE_UTILITY_TARGETS'
;;
actor-profiler
)
FlagName
=
'CAF_ENABLE_ACTOR_PROFILER'
;;
...
...
examples/CMakeLists.txt
View file @
5b3704c6
...
...
@@ -81,10 +81,10 @@ if(TARGET CAF::io)
add_dependencies
(
protobuf_broker all_examples
)
endif
()
if
(
CAF_ENABLE_QT
5
_EXAMPLES
)
find_package
(
Qt
5
COMPONENTS Core Gui Widgets REQUIRED
)
qt
5
_wrap_ui
(
GROUP_CHAT_UI_HDR qtsupport/chatwindow.ui
)
qt
5
_wrap_cpp
(
GROUP_CHAT_MOC_SRC qtsupport/chatwidget.hpp
)
if
(
CAF_ENABLE_QT
6
_EXAMPLES
)
find_package
(
Qt
6
COMPONENTS Core Gui Widgets REQUIRED
)
qt
6
_wrap_ui
(
GROUP_CHAT_UI_HDR qtsupport/chatwindow.ui
)
qt
6
_wrap_cpp
(
GROUP_CHAT_MOC_SRC qtsupport/chatwidget.hpp
)
# generated headers will be in cmake build directory
add_executable
(
qt_group_chat
qtsupport/qt_group_chat.cpp
...
...
@@ -94,17 +94,17 @@ if(TARGET CAF::io)
target_link_libraries
(
qt_group_chat
CAF::io
CAF::internal
Qt
5
::Core
Qt
5
::Gui
Qt
5
::Widgets
)
Qt
6
::Core
Qt
6
::Gui
Qt
6
::Widgets
)
target_include_directories
(
qt_group_chat PRIVATE
qtsupport
${
CMAKE_CURRENT_BINARY_DIR
}
${
Qt
5
Core_INCLUDE_DIRS
}
${
Qt
5
Gui_INCLUDE_DIRS
}
${
Qt
5
Widgets_INCLUDE_DIRS
}
)
${
Qt
6
Core_INCLUDE_DIRS
}
${
Qt
6
Gui_INCLUDE_DIRS
}
${
Qt
6
Widgets_INCLUDE_DIRS
}
)
if
(
CMAKE_VERSION VERSION_LESS 3.8
)
message
(
STATUS
"Note: build fails if Qt
5
sets incompatible -std=ARG flag"
)
message
(
STATUS
"Note: build fails if Qt
6
sets incompatible -std=ARG flag"
)
else
()
set_property
(
TARGET qt_group_chat PROPERTY CXX_STANDARD 17
)
endif
()
...
...
examples/qtsupport/chatwidget.cpp
View file @
5b3704c6
...
...
@@ -5,8 +5,8 @@
#include "caf/detail/scope_guard.hpp"
CAF_PUSH_WARNINGS
#include <QMessageBox>
#include <QInputDialog>
#include <QMessageBox>
CAF_POP_WARNINGS
#include "chatwidget.hpp"
...
...
@@ -67,15 +67,13 @@ void ChatWidget::init(actor_system& system) {
}
void
ChatWidget
::
sendChatMessage
()
{
auto
cleanup
=
detail
::
make_scope_guard
([
=
]
{
input
()
->
setText
(
QString
());
});
auto
cleanup
=
detail
::
make_scope_guard
([
=
]
{
input
()
->
setText
(
QString
());
});
QString
line
=
input
()
->
text
();
if
(
line
.
isEmpty
())
{
// Ignore empty lines.
}
else
if
(
line
.
startsWith
(
'/'
))
{
vector
<
string
>
words
;
auto
utf8
=
line
.
midRef
(
1
).
toUtf8
();
auto
utf8
=
QStringView
{
line
}.
mid
(
1
).
toUtf8
();
auto
sv
=
caf
::
string_view
{
utf8
.
constData
(),
static_cast
<
size_t
>
(
utf8
.
size
())};
split
(
words
,
sv
,
is_any_of
(
" "
));
...
...
@@ -115,8 +113,7 @@ void ChatWidget::joinGroup() {
"Please set a name first."
);
return
;
}
auto
gname
=
QInputDialog
::
getText
(
this
,
"Join Group"
,
auto
gname
=
QInputDialog
::
getText
(
this
,
"Join Group"
,
"Please enter a group as <module>:<id>"
,
QLineEdit
::
Normal
,
"remote:chatroom@localhost:4242"
);
...
...
@@ -126,9 +123,9 @@ void ChatWidget::joinGroup() {
return
;
}
string
mod
=
gname
.
left
(
pos
).
toUtf8
().
constData
();
string
gid
=
gname
.
midRef
(
pos
+
1
).
toUtf8
().
constData
();
string
gid
=
QStringView
{
gname
}.
mid
(
pos
+
1
).
toUtf8
().
constData
();
auto
x
=
system
().
groups
().
get
(
mod
,
gid
);
if
(
!
x
)
if
(
!
x
)
QMessageBox
::
critical
(
this
,
"Error"
,
to_string
(
x
.
error
()).
c_str
());
else
self
()
->
send
(
self
(),
join_atom_v
,
std
::
move
(
*
x
));
...
...
@@ -137,6 +134,6 @@ void ChatWidget::joinGroup() {
void
ChatWidget
::
changeName
()
{
auto
name
=
QInputDialog
::
getText
(
this
,
"Change Name"
,
"Please enter a new name"
);
if
(
!
name
.
isEmpty
())
if
(
!
name
.
isEmpty
())
send_as
(
as_actor
(),
as_actor
(),
set_name_atom_v
,
name
.
toUtf8
().
constData
());
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment