Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt6 WIP #596

Draft
wants to merge 39 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4f98aa3
Change main gui classes to implptr
mjcarroll Oct 5, 2023
ed63b7b
Switch gz-gui plugins to use implptr
mjcarroll Oct 5, 2023
2052269
First pass at level1 clazy checks for qt
mjcarroll Nov 7, 2023
5e9bc27
Merge branch 'main' into mjcarroll/clazy
mjcarroll Nov 10, 2023
364fbca
Lint
mjcarroll Nov 10, 2023
273fac0
Make use of auto* more consistent
mjcarroll Nov 13, 2023
44bd786
Make cmake qt-version agnostic
mjcarroll Nov 13, 2023
bc58d59
lambda capture
mjcarroll Nov 13, 2023
451450a
Merge branch 'mjcarroll/clazy' into mjcarroll/qt5qt6
mjcarroll Nov 13, 2023
6c35be0
Remove qt5 from examples
mjcarroll Nov 13, 2023
126b690
Remove Qt < 5.15 logic
mjcarroll Nov 13, 2023
ffa6430
Additional qt5 cmake functions
mjcarroll Nov 13, 2023
d7c9adf
@wip
mjcarroll Oct 25, 2023
aefb832
@wip
mjcarroll Nov 13, 2023
6ebe89c
Fix conversions test
mjcarroll Nov 13, 2023
fa6e270
Make using deprecated APIs an error
mjcarroll Nov 13, 2023
9f6c81c
Fix vulkan call and qregexp
mjcarroll Nov 13, 2023
8eba03e
Fix test logic
mjcarroll Nov 13, 2023
22cb41a
Qt5.15 compatible graphics updates
mjcarroll Nov 13, 2023
4c7d46d
Fix extra header
mjcarroll Nov 13, 2023
7584829
Lint
mjcarroll Nov 13, 2023
06c80fd
Merge branch 'main' into mjcarroll/qt5qt6
mjcarroll Nov 20, 2023
5ee29c6
Fix preprocessor
mjcarroll Nov 27, 2023
b255e56
Fix indent
mjcarroll Nov 27, 2023
dffd3a0
Fix regex use
mjcarroll Nov 27, 2023
a5ed392
Merge branch 'mjcarroll/qt5qt6' into mjcarroll/qt6
mjcarroll Nov 28, 2023
d6516d9
Fixing QML files
mjcarroll Nov 28, 2023
47c92c2
Align all plugins
mjcarroll Nov 28, 2023
861f355
Updating plugins
mjcarroll Dec 7, 2023
2ec0c07
Fix installation
mjcarroll Jan 29, 2024
0214391
Merge branch 'main' into mjcarroll/qt6
mjcarroll Feb 5, 2024
bcf1e09
Updates
caguero Jul 10, 2024
e2f1eae
Merge branch 'main' into mjcarroll/qt6
caguero Jul 12, 2024
8db1277
OpenGL
caguero Jul 15, 2024
1f28e07
Plugin updates.
caguero Jul 19, 2024
7cf5f94
GzSpinBox update
caguero Aug 5, 2024
96d791a
Fix a few issues with spinbox
azeey Aug 8, 2024
872ea46
WIP: GzSplit
azeey Aug 9, 2024
9f743eb
Tweak
caguero Aug 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ set(GZ_TOOLS_VER 2)

#--------------------------------------
# Find QT
set(QT_MAJOR_VERSION 5)
set(QT_MINOR_VERSION 15)
set(QT_MAJOR_VERSION 6)
set(QT_MINOR_VERSION 4)
gz_find_package (Qt${QT_MAJOR_VERSION}
VERSION ${QT_MAJOR_VERSION}.${QT_MINOR_VERSION}
COMPONENTS
Expand All @@ -94,7 +94,16 @@ gz_find_package (Qt${QT_MAJOR_VERSION}
REQUIRED
PKGCONFIG_VER_COMPARISON >=
PKGCONFIG "Qt${QT_MAJOR_VERSION}Core Qt${QT_MAJOR_VERSION}Quick Qt${QT_MAJOR_VERSION}QuickControls2 Qt${QT_MAJOR_VERSION}Widgets")

add_compile_definitions(QT_DISABLE_DEPRECATED_UP_TO=0x050F00)
set(CMAKE_AUTOMOC TRUE)
set(CMAKE_AUTOUIC TRUE)
set(CMAKE_AUTORCC TRUE)
if(POLICY CMP0100)
cmake_policy(SET CMP0100 NEW)
endif()

qt_standard_project_setup()

set(GZ_GUI_PLUGIN_RELATIVE_INSTALL_DIR
${GZ_LIB_INSTALL_DIR}/gz-${GZ_DESIGNATION}-${PROJECT_VERSION_MAJOR}/plugins
Expand Down
43 changes: 0 additions & 43 deletions examples/config/scene3d.config
Original file line number Diff line number Diff line change
Expand Up @@ -72,46 +72,3 @@
<property key="showTitleBar" type="bool">false</property>
</gz-gui>
</plugin>
<plugin filename="WorldControl">
<gz-gui>
<title>Controls</title>
<property type="bool" key="showTitleBar">false</property>
<property type="bool" key="resizable">false</property>
<property type="double" key="height">72</property>
<property type="double" key="width">121</property>
<property type="double" key="z">1</property>

<property type="string" key="state">floating</property>
<anchors target="View 1">
<line own="left" target="left"/>
<line own="bottom" target="bottom"/>
</anchors>
</gz-gui>
<play_pause>true</play_pause>
<step>true</step>
<start_paused>false</start_paused>
<service>/world_control</service>
<stats_topic>/world_stats</stats_topic>
</plugin>

<plugin filename="WorldStats">
<gz-gui>
<title>Stats</title>
<property type="bool" key="showTitleBar">false</property>
<property type="bool" key="resizable">false</property>
<property type="double" key="height">110</property>
<property type="double" key="width">290</property>
<property type="double" key="z">1</property>

<property type="string" key="state">floating</property>
<anchors target="View 1">
<line own="right" target="right"/>
<line own="bottom" target="bottom"/>
</anchors>
</gz-gui>
<sim_time>true</sim_time>
<real_time>true</real_time>
<real_time_factor>true</real_time_factor>
<iterations>true</iterations>
<topic>/world_stats</topic>
</plugin>
4 changes: 2 additions & 2 deletions examples/plugin/custom_context_menu/CustomContext.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*
*/
import QtQuick 2.0
import QtQuick.Controls 2.0
import QtQuick
import QtQuick.Controls

Rectangle {
id: customContext
Expand Down
8 changes: 4 additions & 4 deletions examples/plugin/dialog_from_plugin/DialogFromPlugin.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*
*/
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Dialogs 1.0
import QtQuick.Window 2.2
import QtQuick
import QtQuick.Controls
import QtQuick.Dialogs
import QtQuick.Window

Rectangle {
id: customPlugin
Expand Down
6 changes: 3 additions & 3 deletions examples/plugin/gz_components/GzComponents.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*
*/
import QtQuick 2.9
import QtQuick.Controls 2.0
import gz.gui 1.0
import QtQuick
import QtQuick.Controls
import gz.gui

Column {
anchors.fill: parent
Expand Down
4 changes: 2 additions & 2 deletions examples/plugin/hello_plugin/HelloPlugin.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*
*/
import QtQuick 2.0
import QtQuick.Controls 2.0
import QtQuick
import QtQuick.Controls
Rectangle {
color: "transparent"
anchors.fill: parent
Expand Down
4 changes: 2 additions & 2 deletions examples/plugin/multiple_qml/MultipleQml.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*
*/
import QtQuick 2.0
import QtQuick.Controls 2.0
import QtQuick
import QtQuick.Controls
import "qrc:/MultipleQml_qml"

Column {
Expand Down
6 changes: 3 additions & 3 deletions examples/standalone/custom_drawer/CustomDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*
*/
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.1
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Material

/**
* Custom drawer
Expand Down
4 changes: 2 additions & 2 deletions examples/standalone/start_dialog/start_dialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*
*/
import QtQuick 2.0
import QtQuick.Controls 2.0
import QtQuick
import QtQuick.Controls
Rectangle {
color: "green"
anchors.fill: parent
Expand Down
106 changes: 91 additions & 15 deletions include/gz/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
if(POLICY CMP0100)
cmake_policy(SET CMP0100 NEW)
endif()

set (CMAKE_AUTOMOC ON)

set (qt_headers
Application.hh
Dialog.hh
Expand All @@ -20,19 +14,101 @@ set (headers
gz.hh
qt.h
SearchModel.hh
System.hh
)

set (resources resources.qrc)

qt_wrap_cpp(headers_MOC ${qt_headers})
qt_add_resources(resources_RCC ${resources})
set(qml_files
qml/Chart.qml
qml/GzCard.qml
qml/GzCardSettings.qml
qml/GzColor.qml
qml/GzHelpers.qml
qml/GzPlotIcon.qml
qml/GzPose.qml
qml/GzRulers.qml
qml/GzSnackBar.qml
qml/GzSortFilterModel.qml
qml/GzSpinBox.qml
qml/GzSplit.qml
qml/GzVector3.qml
qml/Main.qml
qml/PlottingInterface.qml
qml/PluginMenu.qml
qml/SideDrawer.qml
qml/StandaloneDialog.qml
qml/StyleDialog.qml
)

gz_create_core_library(SOURCES
${sources}
${headers_MOC}
${resources_RCC}
set(resources
qml/images/drawer.png
qml/images/export_icon.png
qml/images/gazebo_logo.png
qml/images/menu.png
qml/images/plottable_icon.svg
qml/images/search.svg
)

if (QT_MAJOR_VERSION EQUAL 6)
qt_add_qml_module(${PROJECT_LIBRARY_TARGET_NAME}
URI gz.gui
VERSION 9.0.0
SOURCES ${sources} ${qt_headers} ${headers}
QML_FILES ${qml_files}
RESOURCES ${resources}
)

include(GenerateExportHeader)
generate_export_header(${PROJECT_LIBRARY_TARGET_NAME}
BASE_NAME GZ_GUI
EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/include/gz/gui/detail/Export.hh
EXPORT_MACRO_NAME DETAIL_GZ_GUI_VISIBLE
NO_EXPORT_MACRO_NAME DETAIL_GZ_GUI_HIDDEN
DEPRECATED_MACRO_NAME GZ_DEPRECATED_ALL_VERSIONS)

set(include_dir "gz/gui")
set(export_base "GZ_GUI")
configure_file(
"${GZ_CMAKE_DIR}/Export.hh.in"
"${PROJECT_BINARY_DIR}/include/gz/gui/Export.hh")

install(
FILES "${PROJECT_BINARY_DIR}/include/gz/gui/Export.hh"
DESTINATION ${GZ_INCLUDE_INSTALL_DIR_FULL}/gz/gui/
COMPONENT headers)

install(
FILES "${PROJECT_BINARY_DIR}/include/gz/gui/detail/Export.hh"
DESTINATION ${GZ_INCLUDE_INSTALL_DIR_FULL}/gz/gui/detail/
COMPONENT headers)

target_include_directories(${PROJECT_LIBRARY_TARGET_NAME}
PUBLIC
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include/gz/gui9>
)

install(
TARGETS ${PROJECT_LIBRARY_TARGET_NAME}
EXPORT ${PROJECT_LIBRARY_TARGET_NAME}
LIBRARY DESTINATION ${GZ_LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${GZ_LIB_INSTALL_DIR}
RUNTIME DESTINATION ${GZ_BIN_INSTALL_DIR}
COMPONENT libraries)

_gz_create_cmake_package()
_gz_create_pkgconfig()

else()
set (resources resources.qrc)
qt_wrap_cpp(headers_MOC ${qt_headers})
qt_add_resources(resources_RCC ${resources})

gz_create_core_library(SOURCES
${sources}
${headers_MOC}
${resources_RCC}
)
endif()

gz_add_get_install_prefix_impl(GET_INSTALL_PREFIX_FUNCTION gz::gui::getInstallPrefix
GET_INSTALL_PREFIX_HEADER gz/gui/InstallationDirectories.hh
OVERRIDE_INSTALL_PREFIX_ENV_VARIABLE GZ_GUI_INSTALL_PREFIX)
Expand Down
2 changes: 1 addition & 1 deletion include/gz/gui/Plugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace gz::gui
Q_OBJECT

/// \brief Constructor
public: Plugin();
public: Plugin(QObject *_parent=nullptr);

/// \brief Destructor
public: virtual ~Plugin();
Expand Down
11 changes: 5 additions & 6 deletions include/gz/gui/qml/Chart.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
* limitations under the License.
*
*/
import QtQuick 2.9
import QtCharts 2.2
import QtQuick.Controls 2.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Material 2.1
import QtQuick.Layouts 1.3
import QtQuick
import QtCharts
import QtQuick.Controls
import QtQuick.Controls.Style
import QtQuick.Layouts

Rectangle {
id: main
Expand Down
Loading
Loading