[dummyqml] Stub of a QML module

This commit is contained in:
Adriaan de Groot 2020-01-10 12:38:46 +01:00
parent 4924839217
commit 1cc40bda83
5 changed files with 103 additions and 0 deletions

View File

@ -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
)

View File

@ -0,0 +1,35 @@
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2020, Adriaan de Groot <groot@kde.org>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#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 >(); )

View File

@ -0,0 +1,40 @@
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2020, Adriaan de Groot <groot@kde.org>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#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

View File

@ -0,0 +1,12 @@
import QtQuick 2.3
Rectangle {
width: 200
height: 100
color: "red"
Text {
anchors.centerIn: parent
text: "Hello, World!"
}
}

View File

@ -0,0 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file alias="dummyqml.qml">dummyqml.qml</file>
</qresource>
</RCC>