From 0c3e79e1480589d507bdcfbc7b7dd009ce6c939e Mon Sep 17 00:00:00 2001 From: Kevin Whitaker Date: Tue, 5 Nov 2019 14:42:54 -0500 Subject: [PATCH] Initial import --- .idea/$PRODUCT_WORKSPACE_FILE$ | 53 ++++++++++++++++++++ .idea/.gitignore | 2 + .idea/inspectionProfiles/Project_Default.xml | 15 ++++++ .idea/misc.xml | 9 ++++ .idea/modules.xml | 8 +++ .idea/vcs.xml | 6 +++ CMakeLists.txt | 46 +++++++++++++++++ README.md | 7 +++ org.kde.qiflora.appdata.xml | 18 +++++++ org.kde.qiflora.desktop | 10 ++++ org.kde.qiflora.json | 28 +++++++++++ src/CMakeLists.txt | 8 +++ src/contents/ui/main.qml | 30 +++++++++++ src/main.cpp | 23 +++++++++ src/resources.qrc | 5 ++ 15 files changed, 268 insertions(+) create mode 100644 .idea/$PRODUCT_WORKSPACE_FILE$ create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 CMakeLists.txt create mode 100644 README.md create mode 100644 org.kde.qiflora.appdata.xml create mode 100644 org.kde.qiflora.desktop create mode 100644 org.kde.qiflora.json create mode 100644 src/CMakeLists.txt create mode 100644 src/contents/ui/main.qml create mode 100644 src/main.cpp create mode 100644 src/resources.qrc diff --git a/.idea/$PRODUCT_WORKSPACE_FILE$ b/.idea/$PRODUCT_WORKSPACE_FILE$ new file mode 100644 index 0000000..227aaf3 --- /dev/null +++ b/.idea/$PRODUCT_WORKSPACE_FILE$ @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + 1.8 + + + + + + + + Android API 26 Platform + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..5c98b42 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..f299c1d --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,15 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..6d26c1e --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..2f1f8c0 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..e815982 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,46 @@ +project(qiflora) + +cmake_minimum_required(VERSION 2.8.12) +set(KF5_MIN_VERSION "5.18.0") +set(QT_MIN_VERSION "5.5.0") + +################# Disallow in-source build ################# + +if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") + message(FATAL_ERROR "This application requires an out of source build. Please create a separate build directory.") +endif() + +include(FeatureSummary) + +################# set KDE specific information ################# + +find_package(ECM 0.0.8 REQUIRED NO_MODULE) + +# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) + +include(ECMSetupVersion) +include(ECMGenerateHeaders) +include(KDEInstallDirs) +include(KDECMakeSettings) +include(ECMPoQmTools) +include(KDECompilerSettings NO_POLICY_SCOPE) + +################# Find dependencies ################# + +find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Svg QuickControls2) +find_package(KF5Kirigami2 ${KF5_MIN_VERSION}) + +################# Enable C++11 features for clang and gcc ################# + +if(UNIX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++0x") +endif() + +################# build and install ################# +add_subdirectory(src) + +install(PROGRAMS org.kde.qiflora.desktop DESTINATION ${KDE_INSTALL_APPDIR}) +install(FILES org.kde.qiflora.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) + +feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/README.md b/README.md new file mode 100644 index 0000000..f665ee3 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Kirigami application template + +This repository can be used as a template to develop Plasma Mobile applications. +It already includes templates for the qml ui, a c++ part, app metadata and flatpak packaging. + +# Usage +See [docs.plasma-mobile.org](https://docs.plasma-mobile.org/AppDevelopment.html). diff --git a/org.kde.qiflora.appdata.xml b/org.kde.qiflora.appdata.xml new file mode 100644 index 0000000..d0625b7 --- /dev/null +++ b/org.kde.qiflora.appdata.xml @@ -0,0 +1,18 @@ + + + org.kde.qiflora + Kirigami Example Application + A short summary describing what this software is about + A permissive license for this metadata, e.g. "FSFAP" + The license of this software as SPDX string, e.g. "GPL-3+" + The software vendor name, e.g. "ACME Corporation" + +

Multiple paragraphs of long description, describing this software component.

+

You can also use ordered and unordered lists:

+
    +
  • Feature 1
  • +
  • Feature 2
  • +
+

Keep in mind to XML-escape characters, and that this is not HTML markup.

+
+
diff --git a/org.kde.qiflora.desktop b/org.kde.qiflora.desktop new file mode 100644 index 0000000..238f89c --- /dev/null +++ b/org.kde.qiflora.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=qiflora +Comment=My first Plasma Mobile App +Version=1.0 +Exec=qiflora +MimeType=application/x-qiflora; +Icon=applications-development +Type=Application +Terminal=false +Categories=Qt;KDE; diff --git a/org.kde.qiflora.json b/org.kde.qiflora.json new file mode 100644 index 0000000..b2ff33c --- /dev/null +++ b/org.kde.qiflora.json @@ -0,0 +1,28 @@ +{ + "id": "org.kde.qiflora", + "runtime": "org.kde.Platform", + "runtime-version": "5.12", + "sdk": "org.kde.Sdk", + "command": "qiflora", + "tags": ["nightly"], + "desktop-file-name-suffix": " (Nightly)", + "finish-args": [ + "--share=ipc", + "--share=network", + "--socket=x11", + "--socket=wayland", + "--device=dri", + "--filesystem=home", + "--talk-name=org.freedesktop.Notifications" + ], + "separate-locales": false, + + "modules": [ + { + "name": "qiflora", + "buildsystem": "cmake-ninja", + "builddir": true, + "sources": [ { "type": "dir", "path": ".", "skip": [".git"] } ] + } + ] +} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..88331dc --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,8 @@ +set(qiflora_SRCS + main.cpp + ) + +qt5_add_resources(RESOURCES resources.qrc) +add_executable(qiflora ${qiflora_SRCS} ${RESOURCES}) +target_link_libraries(qiflora Qt5::Core Qt5::Qml Qt5::Quick Qt5::Svg) +install(TARGETS qiflora ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/src/contents/ui/main.qml b/src/contents/ui/main.qml new file mode 100644 index 0000000..122617d --- /dev/null +++ b/src/contents/ui/main.qml @@ -0,0 +1,30 @@ +import QtQuick 2.1 +import org.kde.kirigami 2.4 as Kirigami +import QtQuick.Controls 2.0 as Controls + +Kirigami.ApplicationWindow { + id: root + + title: "Hello" + + pageStack.initialPage: mainPageComponent + + Component { + id: mainPageComponent + + Kirigami.Page { + title: "Hello" + + Rectangle { + color: "black" + anchors.fill: parent + + Controls.Label { + text: qsTr("Hello Kirigami") + color: "white" + anchors.centerIn: parent + } + } + } + } +} diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..6b7ac04 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,23 @@ +#include +#include +#include +#include + +Q_DECL_EXPORT int main(int argc, char *argv[]) +{ + QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QApplication app(argc, argv); + QCoreApplication::setOrganizationName("KDE"); + QCoreApplication::setOrganizationDomain("kde.org"); + QCoreApplication::setApplicationName("qiflora"); + + QQmlApplicationEngine engine; + + engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); + + if (engine.rootObjects().isEmpty()) { + return -1; + } + + return app.exec(); +} diff --git a/src/resources.qrc b/src/resources.qrc new file mode 100644 index 0000000..b2b45f8 --- /dev/null +++ b/src/resources.qrc @@ -0,0 +1,5 @@ + + + contents/ui/main.qml + + -- GitLab