summaryrefslogtreecommitdiffstats
path: root/examples/dbus/remotecontrolledcar/controller
diff options
context:
space:
mode:
Diffstat (limited to 'examples/dbus/remotecontrolledcar/controller')
-rw-r--r--examples/dbus/remotecontrolledcar/controller/.prev_CMakeLists.txt38
-rw-r--r--examples/dbus/remotecontrolledcar/controller/CMakeLists.txt75
-rw-r--r--examples/dbus/remotecontrolledcar/controller/car.xml11
-rw-r--r--examples/dbus/remotecontrolledcar/controller/connected.svg4
-rw-r--r--examples/dbus/remotecontrolledcar/controller/connecting.svg4
-rw-r--r--examples/dbus/remotecontrolledcar/controller/controller.cpp126
-rw-r--r--examples/dbus/remotecontrolledcar/controller/controller.h73
-rw-r--r--examples/dbus/remotecontrolledcar/controller/controller.pro7
-rw-r--r--examples/dbus/remotecontrolledcar/controller/controller.ui64
-rw-r--r--examples/dbus/remotecontrolledcar/controller/down.svg3
-rw-r--r--examples/dbus/remotecontrolledcar/controller/icons.qrc10
-rw-r--r--examples/dbus/remotecontrolledcar/controller/left.svg3
-rw-r--r--examples/dbus/remotecontrolledcar/controller/main.cpp53
-rw-r--r--examples/dbus/remotecontrolledcar/controller/right.svg3
-rw-r--r--examples/dbus/remotecontrolledcar/controller/up.svg3
15 files changed, 139 insertions, 338 deletions
diff --git a/examples/dbus/remotecontrolledcar/controller/.prev_CMakeLists.txt b/examples/dbus/remotecontrolledcar/controller/.prev_CMakeLists.txt
deleted file mode 100644
index dab43f8076..0000000000
--- a/examples/dbus/remotecontrolledcar/controller/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-# Generated from controller.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(controller LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/dbus/remotecontrolledcar/controller")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS DBus)
-find_package(Qt6 COMPONENTS Widgets)
-
-add_qt_gui_executable(controller
- controller.cpp controller.h controller.ui
- main.cpp
-)
-target_link_libraries(controller PUBLIC
- Qt::Core
- Qt::DBus
- Qt::Gui
- Qt::Widgets
-)
-
-install(TARGETS controller
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt
index cca625fdea..a0c1aea7c5 100644
--- a/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt
+++ b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt
@@ -1,46 +1,53 @@
-# Generated from controller.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(controller LANGUAGES CXX)
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
set(CMAKE_INCLUDE_CURRENT_DIR ON)
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/dbus/remotecontrolledcar/controller")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS DBus)
-find_package(Qt6 COMPONENTS Widgets)
-
-# special case begin
set(controller_SRCS)
-qt6_add_dbus_interface(controller_SRCS
- car.xml
+qt_add_dbus_interface(controller_SRCS
+ ../common/car.xml
car_interface
)
-# special case end
-add_qt_gui_executable(controller
- controller.cpp controller.h controller.ui
+
+qt_add_executable(controller
+ controller.cpp controller.h
main.cpp
- ${controller_SRCS} # special case
+ ${controller_SRCS}
)
-target_link_libraries(controller PUBLIC
- Qt::Core
- Qt::DBus
- Qt::Gui
- Qt::Widgets
+
+qt_add_resources(controller
+ PREFIX
+ "/"
+ FILES
+ down.svg
+ left.svg
+ right.svg
+ up.svg
+ connected.svg
+ connecting.svg
+)
+
+set_target_properties(controller PROPERTIES
+ WIN32_EXECUTABLE TRUE
+ MACOSX_BUNDLE TRUE
+)
+
+target_link_libraries(controller PRIVATE
+ Qt6::Core
+ Qt6::DBus
+ Qt6::Gui
+ Qt6::Widgets
)
install(TARGETS controller
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION .
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+)
+
+qt_generate_deploy_app_script(
+ TARGET controller
+ OUTPUT_SCRIPT deploy_script
+ NO_UNSUPPORTED_PLATFORM_ERROR
)
+install(SCRIPT ${deploy_script})
diff --git a/examples/dbus/remotecontrolledcar/controller/car.xml b/examples/dbus/remotecontrolledcar/controller/car.xml
deleted file mode 100644
index 6d8c9d19f2..0000000000
--- a/examples/dbus/remotecontrolledcar/controller/car.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
-<node name="/com/trollech/examples/car">
- <interface name="org.example.Examples.CarInterface">
- <method name="accelerate"/>
- <method name="decelerate"/>
- <method name="turnLeft"/>
- <method name="turnRight"/>
- <signal name="crashed"/>
- </interface>
-</node> \ No newline at end of file
diff --git a/examples/dbus/remotecontrolledcar/controller/connected.svg b/examples/dbus/remotecontrolledcar/controller/connected.svg
new file mode 100644
index 0000000000..a3616b769e
--- /dev/null
+++ b/examples/dbus/remotecontrolledcar/controller/connected.svg
@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M19 11C19 11.5523 19.4477 12 20 12C20.5523 12 21 11.5523 21 11V10.8478C21 8.11075 19.7088 5.53404 17.5163 3.89561C17.0739 3.56501 16.4472 3.65565 16.1166 4.09805C15.786 4.54046 15.8767 5.1671 16.3191 5.4977C18.0064 6.75857 19 8.74149 19 10.8478V11ZM4 12C4.55228 12 5 11.5523 5 11V10.8478C5 8.74149 5.99363 6.75857 7.68091 5.4977C8.12331 5.1671 8.21395 4.54046 7.88335 4.09805C7.55275 3.65565 6.92611 3.56501 6.4837 3.89561C4.29117 5.53404 3 8.11075 3 10.8478V11C3 11.5523 3.44772 12 4 12ZM7.10555 19.5528C7.35253 19.0588 7.95321 18.8586 8.44719 19.1055C10.6837 20.2238 13.3162 20.2238 15.5528 19.1056C16.0467 18.8586 16.6474 19.0588 16.8944 19.5528C17.1414 20.0468 16.9412 20.6474 16.4472 20.8944C13.6476 22.2942 10.3523 22.2942 7.55276 20.8944C7.05878 20.6474 6.85856 20.0467 7.10555 19.5528Z" fill="black"/>
+<path id="Layer02" fill-rule="evenodd" clip-rule="evenodd" d="M13 5C13 5.55228 12.5523 6 12 6C11.4477 6 11 5.55228 11 5C11 4.44772 11.4477 4 12 4C12.5523 4 13 4.44772 13 5ZM15 5C15 6.65685 13.6569 8 12 8C10.3431 8 9 6.65685 9 5C9 3.34315 10.3431 2 12 2C13.6569 2 15 3.34315 15 5ZM5 17C5.55228 17 6 16.5523 6 16C6 15.4477 5.55228 15 5 15C4.44772 15 4 15.4477 4 16C4 16.5523 4.44772 17 5 17ZM5 19C6.65685 19 8 17.6569 8 16C8 14.3431 6.65685 13 5 13C3.34315 13 2 14.3431 2 16C2 17.6569 3.34315 19 5 19ZM19 17C19.5523 17 20 16.5523 20 16C20 15.4477 19.5523 15 19 15C18.4477 15 18 15.4477 18 16C18 16.5523 18.4477 17 19 17ZM19 19C20.6569 19 22 17.6569 22 16C22 14.3431 20.6569 13 19 13C17.3431 13 16 14.3431 16 16C16 17.6569 17.3431 19 19 19Z" fill="black"/>
+</svg>
diff --git a/examples/dbus/remotecontrolledcar/controller/connecting.svg b/examples/dbus/remotecontrolledcar/controller/connecting.svg
new file mode 100644
index 0000000000..4097d0b276
--- /dev/null
+++ b/examples/dbus/remotecontrolledcar/controller/connecting.svg
@@ -0,0 +1,4 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path id="Layer01" d="M14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12Z" fill="#0D0D0D"/>
+<path id="Layer02" fill-rule="evenodd" clip-rule="evenodd" d="M3 12C3 14.2728 3.94193 16.5032 5.71196 18.2978C6.09978 18.691 6.09543 19.3241 5.70223 19.712C5.30902 20.0998 4.67587 20.0954 4.28805 19.7022C2.18112 17.5661 1 14.8427 1 12C1 9.15729 2.18112 6.43389 4.28805 4.29777C4.67587 3.90457 5.30902 3.90022 5.70223 4.28804C6.09543 4.67587 6.09978 5.30902 5.71195 5.70223C3.94193 7.49678 3 9.72715 3 12ZM8.80201 14.404C8.27734 13.6971 7.99902 12.8569 7.99902 12C7.99902 11.1431 8.27734 10.3029 8.80201 9.596C9.13117 9.15252 9.0385 8.52617 8.59502 8.19701C8.15154 7.86785 7.5252 7.96052 7.19604 8.404C6.41969 9.44998 5.99902 10.7067 5.99902 12C5.99902 13.2933 6.41969 14.55 7.19604 15.596C7.5252 16.0395 8.15154 16.1321 8.59502 15.803C9.0385 15.4738 9.13117 14.8475 8.80201 14.404ZM15.197 14.404C15.7217 13.6971 16 12.8569 16 12C16 11.1431 15.7217 10.3029 15.197 9.596C14.8679 9.15252 14.9605 8.52617 15.404 8.19701C15.8475 7.86785 16.4738 7.96052 16.803 8.404C17.5793 9.44998 18 10.7067 18 12C18 13.2933 17.5793 14.55 16.803 15.596C16.4738 16.0395 15.8475 16.1321 15.404 15.803C14.9605 15.4738 14.8679 14.8475 15.197 14.404ZM18.2871 18.2978C20.0571 16.5032 20.999 14.2728 20.999 12C20.999 9.72715 20.0571 7.49678 18.2871 5.70223C17.8992 5.30902 17.9036 4.67587 18.2968 4.28804C18.69 3.90022 19.3232 3.90457 19.711 4.29777C21.8179 6.43389 22.999 9.15729 22.999 12C22.999 14.8427 21.8179 17.5661 19.711 19.7022C19.3231 20.0954 18.69 20.0998 18.2968 19.712C17.9036 19.3241 17.8992 18.691 18.2871 18.2978Z" fill="#0D0D0D"/>
+</svg>
diff --git a/examples/dbus/remotecontrolledcar/controller/controller.cpp b/examples/dbus/remotecontrolledcar/controller/controller.cpp
index cb2e7591d8..ccff2b1743 100644
--- a/examples/dbus/remotecontrolledcar/controller/controller.cpp
+++ b/examples/dbus/remotecontrolledcar/controller/controller.cpp
@@ -1,92 +1,58 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtWidgets>
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "controller.h"
-#include "car_interface.h"
+#include <QGridLayout>
+#include <QHBoxLayout>
+
+using org::example::Examples::CarInterface;
-Controller::Controller(QWidget *parent)
- : QWidget(parent)
+Controller::Controller(QWidget *parent) : QWidget(parent)
{
- ui.setupUi(this);
- car = new org::example::Examples::CarInterface("org.example.CarExample", "/Car",
- QDBusConnection::sessionBus(), this);
+ car = new CarInterface("org.example.CarExample", "/Car", QDBusConnection::sessionBus(), this);
+
+ accelerate = new QPushButton(QIcon(":up.svg"), "", this);
+ accelerate->setFixedSize(80, 64);
+ accelerate->setIconSize(QSize(44, 44));
+ decelerate = new QPushButton(QIcon(":down.svg"), "", this);
+ decelerate->setFixedSize(80, 64);
+ decelerate->setIconSize(QSize(44, 44));
+ left = new QPushButton(QIcon(":left.svg"), "", this);
+ left->setFixedSize(64, 80);
+ left->setIconSize(QSize(44, 44));
+ right = new QPushButton(QIcon(":right.svg"), "", this);
+ right->setFixedSize(64, 80);
+ right->setIconSize(QSize(44, 44));
+
+ status = new QLabel(this);
+ statusSymbol = new QLabel(this);
+ statusSymbol->setFixedHeight(24);
+
+ QGridLayout *layout = new QGridLayout(this);
+ layout->addWidget(accelerate, 1, 1);
+ layout->addWidget(left, 2, 0);
+ layout->addWidget(right, 2, 2);
+ layout->addWidget(decelerate, 3, 1);
+
+ QHBoxLayout *statusLayout = new QHBoxLayout();
+ statusLayout->addWidget(status);
+ statusLayout->addWidget(statusSymbol);
+ layout->addLayout(statusLayout, 0, 1, 1, 2, Qt::AlignTop | Qt::AlignRight);
+
+ connect(accelerate, &QPushButton::clicked, car, &CarInterface::accelerate);
+ connect(decelerate, &QPushButton::clicked, car, &CarInterface::decelerate);
+ connect(left, &QPushButton::clicked, car, &CarInterface::turnLeft);
+ connect(right, &QPushButton::clicked, car, &CarInterface::turnRight);
+
startTimer(1000);
}
void Controller::timerEvent(QTimerEvent *event)
{
Q_UNUSED(event);
- if (car->isValid())
- ui.label->setText("connected");
- else
- ui.label->setText("disconnected");
-}
-
-void Controller::on_accelerate_clicked()
-{
- car->accelerate();
-}
-void Controller::on_decelerate_clicked()
-{
- car->decelerate();
-}
-
-void Controller::on_left_clicked()
-{
- car->turnLeft();
-}
-
-void Controller::on_right_clicked()
-{
- car->turnRight();
+ static QPixmap connectedIcon = QPixmap::fromImage(QImage(":connected.svg"));
+ static QPixmap connectingIcon = QPixmap::fromImage(QImage(":connecting.svg"));
+ status->setText(car->isValid() ? tr("connected") : tr("searching..."));
+ statusSymbol->setPixmap(car->isValid() ? connectedIcon : connectingIcon);
}
diff --git a/examples/dbus/remotecontrolledcar/controller/controller.h b/examples/dbus/remotecontrolledcar/controller/controller.h
index 74776f2638..8df4ed2d1e 100644
--- a/examples/dbus/remotecontrolledcar/controller/controller.h
+++ b/examples/dbus/remotecontrolledcar/controller/controller.h
@@ -1,57 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef CONTROLLER_H
#define CONTROLLER_H
-#include "ui_controller.h"
+#include <QWidget>
+#include <QPushButton>
+#include <QLabel>
+
#include "car_interface.h"
class Controller : public QWidget
@@ -59,20 +15,19 @@ class Controller : public QWidget
Q_OBJECT
public:
- Controller(QWidget *parent = 0);
+ explicit Controller(QWidget *parent = nullptr);
protected:
- void timerEvent(QTimerEvent *event);
-
-private slots:
- void on_accelerate_clicked();
- void on_decelerate_clicked();
- void on_left_clicked();
- void on_right_clicked();
+ void timerEvent(QTimerEvent *event) override;
private:
- Ui::Controller ui;
org::example::Examples::CarInterface *car;
+ QPushButton *accelerate;
+ QPushButton *decelerate;
+ QPushButton *left;
+ QPushButton *right;
+ QLabel *statusSymbol;
+ QLabel *status;
};
#endif
diff --git a/examples/dbus/remotecontrolledcar/controller/controller.pro b/examples/dbus/remotecontrolledcar/controller/controller.pro
index cc3b92f1a4..ce16f21f36 100644
--- a/examples/dbus/remotecontrolledcar/controller/controller.pro
+++ b/examples/dbus/remotecontrolledcar/controller/controller.pro
@@ -1,9 +1,12 @@
QT += dbus widgets
-DBUS_INTERFACES += car.xml
-FORMS += controller.ui
+DBUS_INTERFACES += ../common/car.xml
HEADERS += controller.h
SOURCES += main.cpp controller.cpp
+RESOURCES += icons.qrc
+
+# Work-around CI issue. Not needed in user code.
+CONFIG += no_batch
# install
target.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar/controller
diff --git a/examples/dbus/remotecontrolledcar/controller/controller.ui b/examples/dbus/remotecontrolledcar/controller/controller.ui
deleted file mode 100644
index 379015bf30..0000000000
--- a/examples/dbus/remotecontrolledcar/controller/controller.ui
+++ /dev/null
@@ -1,64 +0,0 @@
-<ui version="4.0" >
- <class>Controller</class>
- <widget class="QWidget" name="Controller" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>255</width>
- <height>111</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>Controller</string>
- </property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="1" column="1" >
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string>Controller</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignCenter</set>
- </property>
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QPushButton" name="decelerate" >
- <property name="text" >
- <string>Decelerate</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QPushButton" name="accelerate" >
- <property name="text" >
- <string>Accelerate</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2" >
- <widget class="QPushButton" name="right" >
- <property name="text" >
- <string>Right</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0" >
- <widget class="QPushButton" name="left" >
- <property name="text" >
- <string>Left</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/examples/dbus/remotecontrolledcar/controller/down.svg b/examples/dbus/remotecontrolledcar/controller/down.svg
new file mode 100644
index 0000000000..f9a417b65e
--- /dev/null
+++ b/examples/dbus/remotecontrolledcar/controller/down.svg
@@ -0,0 +1,3 @@
+<svg width="55" height="55" viewBox="0 0 55 55" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M49.7455 16.7129C48.8505 15.8179 47.3995 15.8179 46.5046 16.7129L27.5 35.7174L8.49547 16.7129C7.60052 15.8179 6.14952 15.8179 5.25456 16.7129C4.35961 17.6078 4.35961 19.0588 5.25456 19.9538L25.8796 40.5788C26.7745 41.4737 28.2255 41.4737 29.1205 40.5788L49.7455 19.9538C50.6404 19.0588 50.6404 17.6078 49.7455 16.7129Z" fill="black"/>
+</svg>
diff --git a/examples/dbus/remotecontrolledcar/controller/icons.qrc b/examples/dbus/remotecontrolledcar/controller/icons.qrc
new file mode 100644
index 0000000000..0aad87cf32
--- /dev/null
+++ b/examples/dbus/remotecontrolledcar/controller/icons.qrc
@@ -0,0 +1,10 @@
+<RCC>
+ <qresource prefix="/">
+ <file>connected.svg</file>
+ <file>connecting.svg</file>
+ <file>down.svg</file>
+ <file>left.svg</file>
+ <file>right.svg</file>
+ <file>up.svg</file>
+ </qresource>
+</RCC>
diff --git a/examples/dbus/remotecontrolledcar/controller/left.svg b/examples/dbus/remotecontrolledcar/controller/left.svg
new file mode 100644
index 0000000000..12d6420f48
--- /dev/null
+++ b/examples/dbus/remotecontrolledcar/controller/left.svg
@@ -0,0 +1,3 @@
+<svg width="55" height="55" viewBox="0 0 55 55" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M38.2871 5.25453C39.1821 6.14948 39.1821 7.60048 38.2871 8.49543L19.2826 27.5L38.2871 46.5045C39.1821 47.3995 39.1821 48.8505 38.2871 49.7454C37.3922 50.6404 35.9412 50.6404 35.0462 49.7454L14.4212 29.1204C13.5263 28.2255 13.5263 26.7745 14.4212 25.8795L35.0462 5.25453C35.9412 4.35958 37.3922 4.35958 38.2871 5.25453Z" fill="black"/>
+</svg>
diff --git a/examples/dbus/remotecontrolledcar/controller/main.cpp b/examples/dbus/remotecontrolledcar/controller/main.cpp
index 88edd13c1b..7d91048729 100644
--- a/examples/dbus/remotecontrolledcar/controller/main.cpp
+++ b/examples/dbus/remotecontrolledcar/controller/main.cpp
@@ -1,55 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QtWidgets>
-#include <QtDBus>
+
#include "controller.h"
diff --git a/examples/dbus/remotecontrolledcar/controller/right.svg b/examples/dbus/remotecontrolledcar/controller/right.svg
new file mode 100644
index 0000000000..26a39a74ca
--- /dev/null
+++ b/examples/dbus/remotecontrolledcar/controller/right.svg
@@ -0,0 +1,3 @@
+<svg width="55" height="55" viewBox="0 0 55 55" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M16.7129 5.25453C15.8179 6.14948 15.8179 7.60048 16.7129 8.49543L35.7174 27.5L16.7129 46.5045C15.8179 47.3995 15.8179 48.8505 16.7129 49.7454C17.6078 50.6404 19.0588 50.6404 19.9538 49.7454L40.5788 29.1204C41.4737 28.2255 41.4737 26.7745 40.5788 25.8795L19.9538 5.25453C19.0588 4.35958 17.6078 4.35958 16.7129 5.25453Z" fill="black"/>
+</svg>
diff --git a/examples/dbus/remotecontrolledcar/controller/up.svg b/examples/dbus/remotecontrolledcar/controller/up.svg
new file mode 100644
index 0000000000..ea5f1bfcfb
--- /dev/null
+++ b/examples/dbus/remotecontrolledcar/controller/up.svg
@@ -0,0 +1,3 @@
+<svg width="55" height="55" viewBox="0 0 55 55" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M49.7455 38.2871C48.8505 39.1821 47.3995 39.1821 46.5046 38.2871L27.5 19.2826L8.49547 38.2871C7.60052 39.1821 6.14952 39.1821 5.25456 38.2871C4.35961 37.3922 4.35961 35.9412 5.25456 35.0462L25.8796 14.4212C26.7745 13.5263 28.2255 13.5263 29.1205 14.4212L49.7455 35.0462C50.6404 35.9412 50.6404 37.3922 49.7455 38.2871Z" fill="black"/>
+</svg>