Add basic code
This commit is contained in:
parent
6103876e04
commit
400f7a6c23
5 changed files with 101 additions and 0 deletions
28
CMakeLists.txt
Normal file
28
CMakeLists.txt
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
project(leek)
|
||||
|
||||
find_package(ECM 6.0.0 REQUIRED NO_MODULE)
|
||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
|
||||
|
||||
include(KDEInstallDirs)
|
||||
include(KDECMakeSettings)
|
||||
include(KDECompilerSettings NO_POLICY_SCOPE)
|
||||
include(ECMFindQmlModule)
|
||||
include(ECMQmlModule)
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core Quick Gui QuickControls2 Widgets)
|
||||
|
||||
find_package(KF6 REQUIRED COMPONENTS Kirigami I18n CoreAddons QQC2DesktopStyle
|
||||
IconThemes)
|
||||
|
||||
# Don't mark this as required, since qml module finding is broken on NixOS
|
||||
ecm_find_qmlmodule(org.kde.kirigami)
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
install(PROGRAMS xyz.toast003.leek.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
||||
|
||||
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES
|
||||
FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||
13
src/CMakeLists.txt
Normal file
13
src/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
add_executable(leek)
|
||||
|
||||
ecm_add_qml_module(leek URI xyz.toast003.leek)
|
||||
|
||||
target_sources(leek PRIVATE main.cpp)
|
||||
|
||||
ecm_target_qml_sources(leek SOURCES Main.qml)
|
||||
|
||||
target_link_libraries(leek PRIVATE Qt6::Quick Qt6::Qml Qt6::Gui
|
||||
Qt6::QuickControls2 Qt6::Widgets)
|
||||
target_link_libraries(leek PRIVATE KF6::I18n KF6::CoreAddons KF6::IconThemes)
|
||||
|
||||
install(TARGETS leek ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
17
src/Main.qml
Normal file
17
src/Main.qml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls as Controls
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
Kirigami.ApplicationWindow {
|
||||
id: root
|
||||
title: "Leek"
|
||||
|
||||
pageStack.initialPage: Kirigami.Page {
|
||||
Controls.Label {
|
||||
anchors.centerIn: parent
|
||||
text: "Hello world"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
35
src/main.cpp
Normal file
35
src/main.cpp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#include <KIconTheme>
|
||||
#include <KLocalizedContext>
|
||||
#include <KLocalizedString>
|
||||
#include <QApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQuickStyle>
|
||||
#include <QUrl>
|
||||
#include <QtQml>
|
||||
#include <qapplication.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
KIconTheme::initTheme();
|
||||
QApplication app(argc, argv);
|
||||
KLocalizedString::setApplicationDomain("leek");
|
||||
QApplication::setOrganizationName(QStringLiteral("Toast"));
|
||||
QApplication::setOrganizationDomain(QStringLiteral("toast003.xyz"));
|
||||
QApplication::setApplicationName(QStringLiteral("Leek"));
|
||||
QApplication::setDesktopFileName(QStringLiteral("xyz.toast003.leek"));
|
||||
|
||||
QApplication::setStyle(QStringLiteral("breeze"));
|
||||
if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) {
|
||||
QQuickStyle::setStyle(QStringLiteral("org.kde.desktop"));
|
||||
}
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
|
||||
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
|
||||
engine.loadFromModule("xyz.toast003.leek", "Main");
|
||||
|
||||
if (engine.rootObjects().isEmpty()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
8
xyz.toast003.leek.desktop
Normal file
8
xyz.toast003.leek.desktop
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[Desktop Entry]
|
||||
Name=Leek
|
||||
Type=Application
|
||||
Exec=leek
|
||||
Categories=Game;Utility;KDE;Qt
|
||||
Keywords=diva;mod,manager;hatsune;miku
|
||||
Icon=steam_icon_1761390
|
||||
Comment=Project Diva Mega Mix+ mod manager built with KDE technologies
|
||||
Loading…
Add table
Add a link
Reference in a new issue