From 1cc40bda83dc1245db97a6b1d54111b7faf15b28 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 10 Jan 2020 12:38:46 +0100 Subject: [PATCH] [dummyqml] Stub of a QML module --- src/modules/dummyqml/CMakeLists.txt | 11 +++++++ src/modules/dummyqml/DummyQmlViewStep.cpp | 35 ++++++++++++++++++++ src/modules/dummyqml/DummyQmlViewStep.h | 40 +++++++++++++++++++++++ src/modules/dummyqml/dummyqml.qml | 12 +++++++ src/modules/dummyqml/dummyqml.qrc | 5 +++ 5 files changed, 103 insertions(+) create mode 100644 src/modules/dummyqml/CMakeLists.txt create mode 100644 src/modules/dummyqml/DummyQmlViewStep.cpp create mode 100644 src/modules/dummyqml/DummyQmlViewStep.h create mode 100644 src/modules/dummyqml/dummyqml.qml create mode 100644 src/modules/dummyqml/dummyqml.qrc diff --git a/src/modules/dummyqml/CMakeLists.txt b/src/modules/dummyqml/CMakeLists.txt new file mode 100644 index 000000000..9a7532e9e --- /dev/null +++ b/src/modules/dummyqml/CMakeLists.txt @@ -0,0 +1,11 @@ +calamares_add_plugin( dummyqml + TYPE viewmodule + EXPORT_MACRO PLUGINDLLEXPORT_PRO + SOURCES + DummyQmlViewStep.cpp + RESOURCES + dummyqml.qrc + LINK_PRIVATE_LIBRARIES + calamaresui + SHARED_LIB +) diff --git a/src/modules/dummyqml/DummyQmlViewStep.cpp b/src/modules/dummyqml/DummyQmlViewStep.cpp new file mode 100644 index 000000000..985d2985a --- /dev/null +++ b/src/modules/dummyqml/DummyQmlViewStep.cpp @@ -0,0 +1,35 @@ +/* === This file is part of Calamares - === + * + * Copyright 2020, Adriaan de Groot + * + * Calamares is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Calamares is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Calamares. If not, see . + */ + +#include "DummyQmlViewStep.h" + +DummyQmlViewStep::DummyQmlViewStep( QObject* parent ) + : Calamares::QmlViewStep( "dummyqml", parent ) +{ +} + +DummyQmlViewStep::~DummyQmlViewStep() {} + +QString +DummyQmlViewStep::prettyName() const +{ + return tr( "Example QML page" ); +} + + +CALAMARES_PLUGIN_FACTORY_DEFINITION( DummyQmlViewStepFactory, registerPlugin< DummyQmlViewStep >(); ) diff --git a/src/modules/dummyqml/DummyQmlViewStep.h b/src/modules/dummyqml/DummyQmlViewStep.h new file mode 100644 index 000000000..ffc358fe7 --- /dev/null +++ b/src/modules/dummyqml/DummyQmlViewStep.h @@ -0,0 +1,40 @@ +/* === This file is part of Calamares - === + * + * Copyright 2020, Adriaan de Groot + * + * Calamares is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Calamares is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Calamares. If not, see . + */ + +#ifndef DUMMYQMLVIEWSTEP_H +#define DUMMYQMLVIEWSTEP_H + +#include "utils/PluginFactory.h" +#include "viewpages/QmlViewStep.h" + +class DummyQmlViewStep : public Calamares::QmlViewStep +{ + Q_OBJECT + +public: + DummyQmlViewStep( QObject* parent = nullptr ); + virtual ~DummyQmlViewStep() override; + + virtual QString prettyName() const override; + +private: +}; + +CALAMARES_PLUGIN_FACTORY_DECLARATION( DummyQmlViewStepFactory ) + +#endif diff --git a/src/modules/dummyqml/dummyqml.qml b/src/modules/dummyqml/dummyqml.qml new file mode 100644 index 000000000..6cab24bec --- /dev/null +++ b/src/modules/dummyqml/dummyqml.qml @@ -0,0 +1,12 @@ +import QtQuick 2.3 + +Rectangle { + width: 200 + height: 100 + color: "red" + + Text { + anchors.centerIn: parent + text: "Hello, World!" + } +} diff --git a/src/modules/dummyqml/dummyqml.qrc b/src/modules/dummyqml/dummyqml.qrc new file mode 100644 index 000000000..85b1da5ca --- /dev/null +++ b/src/modules/dummyqml/dummyqml.qrc @@ -0,0 +1,5 @@ + + + dummyqml.qml + +