Skip to content

Commit 2726159

Browse files
committed
Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
1 parent 364fbca commit 2726159

27 files changed

+304
-357
lines changed

CMakeLists.txt

+17-2
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,31 @@ set(GZ_TOOLS_VER 2)
8181

8282
#--------------------------------------
8383
# Find QT
84-
gz_find_package (Qt5
84+
gz_find_package (Qt6
8585
COMPONENTS
8686
Core
8787
Quick
8888
QuickControls2
8989
Widgets
9090
REQUIRED
91-
PKGCONFIG "Qt5Core Qt5Quick Qt5QuickControls2 Qt5Widgets"
91+
PKGCONFIG "Qt6Core Qt6Quick Qt6QuickControls2 Qt6Widgets"
9292
)
9393

94+
if (BUILD_TESTING)
95+
gz_find_package (Qt6
96+
COMPONENTS
97+
Test
98+
REQUIRED
99+
PKGCONFIG "Qt6Test"
100+
)
101+
endif()
102+
103+
if(POLICY CMP0100)
104+
cmake_policy(SET CMP0100 NEW)
105+
endif()
106+
107+
qt_standard_project_setup()
108+
94109
set(GZ_GUI_PLUGIN_RELATIVE_INSTALL_DIR
95110
${GZ_LIB_INSTALL_DIR}/gz-${GZ_DESIGNATION}-${PROJECT_VERSION_MAJOR}/plugins
96111
)

examples/config/scene3d.config

-43
Original file line numberDiff line numberDiff line change
@@ -72,46 +72,3 @@
7272
<property key="showTitleBar" type="bool">false</property>
7373
</gz-gui>
7474
</plugin>
75-
<plugin filename="WorldControl">
76-
<gz-gui>
77-
<title>Controls</title>
78-
<property type="bool" key="showTitleBar">false</property>
79-
<property type="bool" key="resizable">false</property>
80-
<property type="double" key="height">72</property>
81-
<property type="double" key="width">121</property>
82-
<property type="double" key="z">1</property>
83-
84-
<property type="string" key="state">floating</property>
85-
<anchors target="View 1">
86-
<line own="left" target="left"/>
87-
<line own="bottom" target="bottom"/>
88-
</anchors>
89-
</gz-gui>
90-
<play_pause>true</play_pause>
91-
<step>true</step>
92-
<start_paused>false</start_paused>
93-
<service>/world_control</service>
94-
<stats_topic>/world_stats</stats_topic>
95-
</plugin>
96-
97-
<plugin filename="WorldStats">
98-
<gz-gui>
99-
<title>Stats</title>
100-
<property type="bool" key="showTitleBar">false</property>
101-
<property type="bool" key="resizable">false</property>
102-
<property type="double" key="height">110</property>
103-
<property type="double" key="width">290</property>
104-
<property type="double" key="z">1</property>
105-
106-
<property type="string" key="state">floating</property>
107-
<anchors target="View 1">
108-
<line own="right" target="right"/>
109-
<line own="bottom" target="bottom"/>
110-
</anchors>
111-
</gz-gui>
112-
<sim_time>true</sim_time>
113-
<real_time>true</real_time>
114-
<real_time_factor>true</real_time_factor>
115-
<iterations>true</iterations>
116-
<topic>/world_stats</topic>
117-
</plugin>

include/gz/gui/CMakeLists.txt

+7-25
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,9 @@
1-
include_directories(
2-
${Qt5Core_INCLUDE_DIRS}
3-
${tinyxml_INCLUDE_DIRS}
4-
${Qt5Qml_INCLUDE_DIRS}
5-
${Qt5Quick_INCLUDE_DIRS}
6-
${Qt5QuickControls2_INCLUDE_DIRS}
7-
${Qt5Widgets_INCLUDE_DIRS}
8-
)
9-
101
if(POLICY CMP0100)
112
cmake_policy(SET CMP0100 NEW)
123
endif()
134

145
set (CMAKE_AUTOMOC ON)
156

16-
add_definitions(
17-
${Qt5Core_DEFINITIONS}
18-
${Qt5Qml_DEFINITIONS}
19-
${Qt5Quick_DEFINITIONS}
20-
${Qt5QuickControls2_DEFINITIONS}
21-
${Qt5Widgets_DEFINITIONS}
22-
)
23-
247
set (qt_headers
258
Application.hh
269
Dialog.hh
@@ -42,8 +25,8 @@ set (headers
4225

4326
set (resources resources.qrc)
4427

45-
QT5_WRAP_CPP(headers_MOC ${qt_headers})
46-
QT5_ADD_RESOURCES(resources_RCC ${resources})
28+
QT_WRAP_CPP(headers_MOC ${qt_headers})
29+
QT_ADD_RESOURCES(resources_RCC ${resources})
4730

4831
gz_create_core_library(SOURCES
4932
${sources}
@@ -67,13 +50,12 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
6750
gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER}
6851
gz-plugin${GZ_PLUGIN_VER}::loader
6952
gz-transport${GZ_TRANSPORT_VER}::gz-transport${GZ_TRANSPORT_VER}
70-
${Qt5Core_LIBRARIES}
71-
${Qt5Qml_LIBRARIES}
72-
${Qt5Quick_LIBRARIES}
73-
${Qt5QuickControls2_LIBRARIES}
74-
${Qt5Widgets_LIBRARIES}
53+
Qt::Core
54+
Qt::Qml
55+
Qt::Quick
56+
Qt::QuickControls2
57+
Qt::Widgets
7558
TINYXML2::TINYXML2
7659
)
7760

7861
gz_install_all_headers()
79-

include/gz/gui/qml/GzCard.qml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*
1616
*/
1717
import QtQuick 2.9
18-
import QtQuick.Controls 1.4 as QQC1
1918
import QtQuick.Controls 2.2
2019
import QtQuick.Controls.Material 2.1
2120
import QtQuick.Layouts 1.3

include/gz/gui/qml/GzCardSettings.qml

+12-11
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
* limitations under the License.
1515
*
1616
*/
17-
import QtQuick 2.9
18-
import QtQuick.Controls 2.2
19-
import QtQuick.Layouts 1.3
20-
import QtQuick.Window 2.2
21-
import QtQuick.Dialogs 1.0
17+
import QtQuick
18+
import QtQuick.Controls
19+
import QtQuick.Layouts
20+
import QtQuick.Window
21+
import QtQuick.Dialogs
2222
import "qrc:/qml"
2323

2424
Dialog {
@@ -135,7 +135,7 @@ Dialog {
135135

136136
GzSpinBox {
137137
visible: !cardPane.anchored
138-
maximumValue: cardPane.parent ? cardPane.parent.width - cardPane.width : minSize
138+
to: cardPane.parent ? cardPane.parent.width - cardPane.width : from
139139
onVisibleChanged: value = cardPane.x
140140
onValueChanged: {
141141
cardPane.x = value;
@@ -147,7 +147,7 @@ Dialog {
147147
}
148148
GzSpinBox {
149149
visible: !cardPane.anchored
150-
maximumValue: cardPane.parent ? cardPane.parent.height - cardPane.height : minSize
150+
to: cardPane.parent ? cardPane.parent.height - cardPane.height : from
151151
onVisibleChanged: value = cardPane.y
152152
onValueChanged: {
153153
cardPane.y = value;
@@ -159,7 +159,7 @@ Dialog {
159159
}
160160
GzSpinBox {
161161
visible: !cardPane.anchored
162-
maximumValue: 10000
162+
to: 10000
163163
onVisibleChanged: value = cardPane.z
164164
onValueChanged: {
165165
cardPane.z = value;
@@ -177,7 +177,7 @@ Dialog {
177177
text: ""
178178
}
179179
GzSpinBox {
180-
maximumValue: cardPane.parent ? cardPane.parent.width : minSize
180+
to: cardPane.parent ? cardPane.parent.width : from
181181
onVisibleChanged: {
182182
if (cardPane)
183183
value = cardPane.width
@@ -190,7 +190,8 @@ Dialog {
190190
text: "Width"
191191
}
192192
GzSpinBox {
193-
maximumValue: cardPane.parent ? cardPane.parent.height : minSize
193+
to: cardPane.parent ? cardPane.parent.height : from
194+
194195
onVisibleChanged: {
195196
if (cardPane)
196197
value = cardPane.height
@@ -208,7 +209,7 @@ Dialog {
208209
ColorDialog {
209210
id: colorDialog
210211
title: "Please choose a color"
211-
showAlphaChannel : true
212+
options: [ColorDialog.ShowAlphaChannel]
212213
onAccepted: {
213214
content.color = colorDialog.color
214215
bgColor.color = colorDialog.color

include/gz/gui/qml/GzSnackBar.qml

+1-8
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
*
1616
*/
1717

18-
import QtGraphicalEffects 1.0
1918
import QtQuick 2.9
2019
import QtQuick.Controls 2.2
2120
import QtQuick.Controls.Material 2.2
22-
import QtQuick.Dialogs 1.0
21+
import QtQuick.Dialogs
2322
import QtQuick.Layouts 1.3
2423
import QtQuick.Window 2.2
2524

@@ -70,12 +69,6 @@ Popup {
7069
background: Rectangle {
7170
color: Material.background
7271
layer.enabled: true
73-
layer.effect: DropShadow {
74-
color: "#aa000000"
75-
samples: 9
76-
spread: 0
77-
radius: 8.0
78-
}
7972
}
8073

8174
// this function is called when notify() or notifyWithDuration() are called

include/gz/gui/qml/GzSpinBox.qml

+6-9
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@
1414
* limitations under the License.
1515
*
1616
*/
17-
import QtQuick 2.9
18-
import QtQuick.Controls 1.4
19-
import QtQuick.Controls.Styles 1.4
17+
import QtQuick
18+
import QtQuick.Controls
2019

2120
SpinBox {
22-
style: SpinBoxStyle{
23-
background: Rectangle {
24-
implicitWidth: 70
25-
implicitHeight: 40
26-
border.color: "gray"
27-
}
21+
background: Rectangle {
22+
implicitWidth: 70
23+
implicitHeight: 40
24+
border.color: "gray"
2825
}
2926
}

include/gz/gui/qml/GzSplit.qml

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
*
1616
*/
1717
import QtQuick 2.9
18-
import QtQuick.Controls 1.1
19-
import QtQuick.Controls 2.2
18+
import QtQuick.Controls
2019
import QtQuick.Controls.Material 2.1
2120
import QtQuick.Layouts 1.3
2221

@@ -382,4 +381,3 @@ SplitView {
382381
}
383382
}
384383
}
385-

include/gz/gui/qml/Main.qml

+1-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import QtQuick 2.9
1818
import QtQuick.Controls 2.2
1919
import QtQuick.Controls.Material 2.1
20-
import QtQuick.Dialogs 1.0
20+
import QtQuick.Dialogs
2121
import QtQuick.Layouts 1.3
2222
import ExitAction 1.0
2323
import "qrc:/qml"
@@ -295,10 +295,7 @@ ApplicationWindow
295295
FileDialog {
296296
id: loadFileDialog
297297
title: "Load configuration"
298-
folder: shortcuts.home
299298
nameFilters: [ "Config files (*.config)" ]
300-
selectMultiple: false
301-
selectExisting: true
302299
onAccepted: {
303300
MainWindow.OnLoadConfig(fileUrl)
304301
}
@@ -310,10 +307,7 @@ ApplicationWindow
310307
FileDialog {
311308
id: saveFileDialog
312309
title: "Save configuration"
313-
folder: shortcuts.home
314310
nameFilters: [ "Config files (*.config)" ]
315-
selectMultiple: false
316-
selectExisting: false
317311
onAccepted: {
318312
var selected = fileUrl.toString();
319313

include/gz/gui/qml/StyleDialog.qml

+1-22
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import QtQuick 2.9
1818
import QtQuick.Controls 2.2
1919
import QtQuick.Controls.Material 2.1
20-
import QtQuick.Dialogs 1.0
20+
import QtQuick.Dialogs
2121

2222
/**
2323
* Style dialog
@@ -309,9 +309,6 @@ Dialog {
309309
text: modelData
310310
width: parent.width
311311
}
312-
onCurrentTextChanged: {
313-
updateTheme();
314-
}
315312
}
316313

317314
Label {
@@ -322,15 +319,6 @@ Dialog {
322319
id: materialPrimaryDialog
323320
title: "Primary color"
324321
// options: ColorDialog.NoButtons
325-
onCurrentColorChanged: {
326-
327-
// Avoiding pure black because for some reason it is set to that as the
328-
// dialog opens
329-
if (currentColor == "#000000")
330-
return;
331-
332-
updatePrimary(colorToHex(currentColor))
333-
}
334322
}
335323

336324
Row {
@@ -368,15 +356,6 @@ Dialog {
368356
id: materialAccentDialog
369357
title: "Accent color"
370358
// options: ColorDialog.NoButtons
371-
onCurrentColorChanged: {
372-
373-
// Avoiding pure black because for some reason it is set to that as the
374-
// dialog opens
375-
if (currentColor == "#000000")
376-
return;
377-
378-
updateAccent(colorToHex(currentColor))
379-
}
380359
}
381360

382361
Row {

0 commit comments

Comments
 (0)