From 7272b66f2f04c005e27da836e6d40bae8da5e081 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Mon, 8 Jul 2024 20:07:09 +0200 Subject: [PATCH] native: flaten file structure --- native/.gitignore | 2 -- native/{qt6-app => }/Assets/Audio/test.mp4 | Bin native/{qt6-app => }/Assets/Icons/Jukebox.ico | Bin native/{qt6-app => }/Assets/Icons/Jukebox.png | Bin native/{qt6-app => }/Assets/Icons/Next.png | Bin native/{qt6-app => }/Assets/Icons/Pause.png | Bin native/{qt6-app => }/Assets/Icons/Play.png | Bin .../{qt6-app => }/Assets/Icons/Previous.png | Bin .../Assets/Images/Boygenius_-_the_record.jpg | Bin ...chek_-_Desire,_I_Want_to_Turn_Into_You.png | Bin .../Images/Kali-Uchis-Red-Moon-in-Venus.webp | Bin .../Assets/Images/Yeule_-_Softscars.png | Bin .../Assets/Videos/Free_Test_Data_5MB_AVI.avi | Bin native/{qt6-app => }/AudioInfoBox.qml | 0 native/{qt6-app => }/CMakeLists.txt | 0 native/{qt6-app => }/ImageButton.qml | 0 native/{qt6-app => }/Main.qml | 0 native/{qt6-app => }/TextButton.qml | 0 native/main.cpp | 24 +++++++++++++++--- native/meson.build | 5 ---- native/{qt6-app => }/pre_build.bat | 0 native/qt6-app/main.cpp | 22 ---------------- nix/native.nix | 2 +- 23 files changed, 21 insertions(+), 34 deletions(-) delete mode 100644 native/.gitignore rename native/{qt6-app => }/Assets/Audio/test.mp4 (100%) rename native/{qt6-app => }/Assets/Icons/Jukebox.ico (100%) rename native/{qt6-app => }/Assets/Icons/Jukebox.png (100%) rename native/{qt6-app => }/Assets/Icons/Next.png (100%) rename native/{qt6-app => }/Assets/Icons/Pause.png (100%) rename native/{qt6-app => }/Assets/Icons/Play.png (100%) rename native/{qt6-app => }/Assets/Icons/Previous.png (100%) rename native/{qt6-app => }/Assets/Images/Boygenius_-_the_record.jpg (100%) rename native/{qt6-app => }/Assets/Images/Caroline_Polachek_-_Desire,_I_Want_to_Turn_Into_You.png (100%) rename native/{qt6-app => }/Assets/Images/Kali-Uchis-Red-Moon-in-Venus.webp (100%) rename native/{qt6-app => }/Assets/Images/Yeule_-_Softscars.png (100%) rename native/{qt6-app => }/Assets/Videos/Free_Test_Data_5MB_AVI.avi (100%) rename native/{qt6-app => }/AudioInfoBox.qml (100%) rename native/{qt6-app => }/CMakeLists.txt (100%) rename native/{qt6-app => }/ImageButton.qml (100%) rename native/{qt6-app => }/Main.qml (100%) rename native/{qt6-app => }/TextButton.qml (100%) delete mode 100644 native/meson.build rename native/{qt6-app => }/pre_build.bat (100%) delete mode 100644 native/qt6-app/main.cpp diff --git a/native/.gitignore b/native/.gitignore deleted file mode 100644 index 63d0f15..0000000 --- a/native/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -**/build -*.autosave \ No newline at end of file diff --git a/native/qt6-app/Assets/Audio/test.mp4 b/native/Assets/Audio/test.mp4 similarity index 100% rename from native/qt6-app/Assets/Audio/test.mp4 rename to native/Assets/Audio/test.mp4 diff --git a/native/qt6-app/Assets/Icons/Jukebox.ico b/native/Assets/Icons/Jukebox.ico similarity index 100% rename from native/qt6-app/Assets/Icons/Jukebox.ico rename to native/Assets/Icons/Jukebox.ico diff --git a/native/qt6-app/Assets/Icons/Jukebox.png b/native/Assets/Icons/Jukebox.png similarity index 100% rename from native/qt6-app/Assets/Icons/Jukebox.png rename to native/Assets/Icons/Jukebox.png diff --git a/native/qt6-app/Assets/Icons/Next.png b/native/Assets/Icons/Next.png similarity index 100% rename from native/qt6-app/Assets/Icons/Next.png rename to native/Assets/Icons/Next.png diff --git a/native/qt6-app/Assets/Icons/Pause.png b/native/Assets/Icons/Pause.png similarity index 100% rename from native/qt6-app/Assets/Icons/Pause.png rename to native/Assets/Icons/Pause.png diff --git a/native/qt6-app/Assets/Icons/Play.png b/native/Assets/Icons/Play.png similarity index 100% rename from native/qt6-app/Assets/Icons/Play.png rename to native/Assets/Icons/Play.png diff --git a/native/qt6-app/Assets/Icons/Previous.png b/native/Assets/Icons/Previous.png similarity index 100% rename from native/qt6-app/Assets/Icons/Previous.png rename to native/Assets/Icons/Previous.png diff --git a/native/qt6-app/Assets/Images/Boygenius_-_the_record.jpg b/native/Assets/Images/Boygenius_-_the_record.jpg similarity index 100% rename from native/qt6-app/Assets/Images/Boygenius_-_the_record.jpg rename to native/Assets/Images/Boygenius_-_the_record.jpg diff --git a/native/qt6-app/Assets/Images/Caroline_Polachek_-_Desire,_I_Want_to_Turn_Into_You.png b/native/Assets/Images/Caroline_Polachek_-_Desire,_I_Want_to_Turn_Into_You.png similarity index 100% rename from native/qt6-app/Assets/Images/Caroline_Polachek_-_Desire,_I_Want_to_Turn_Into_You.png rename to native/Assets/Images/Caroline_Polachek_-_Desire,_I_Want_to_Turn_Into_You.png diff --git a/native/qt6-app/Assets/Images/Kali-Uchis-Red-Moon-in-Venus.webp b/native/Assets/Images/Kali-Uchis-Red-Moon-in-Venus.webp similarity index 100% rename from native/qt6-app/Assets/Images/Kali-Uchis-Red-Moon-in-Venus.webp rename to native/Assets/Images/Kali-Uchis-Red-Moon-in-Venus.webp diff --git a/native/qt6-app/Assets/Images/Yeule_-_Softscars.png b/native/Assets/Images/Yeule_-_Softscars.png similarity index 100% rename from native/qt6-app/Assets/Images/Yeule_-_Softscars.png rename to native/Assets/Images/Yeule_-_Softscars.png diff --git a/native/qt6-app/Assets/Videos/Free_Test_Data_5MB_AVI.avi b/native/Assets/Videos/Free_Test_Data_5MB_AVI.avi similarity index 100% rename from native/qt6-app/Assets/Videos/Free_Test_Data_5MB_AVI.avi rename to native/Assets/Videos/Free_Test_Data_5MB_AVI.avi diff --git a/native/qt6-app/AudioInfoBox.qml b/native/AudioInfoBox.qml similarity index 100% rename from native/qt6-app/AudioInfoBox.qml rename to native/AudioInfoBox.qml diff --git a/native/qt6-app/CMakeLists.txt b/native/CMakeLists.txt similarity index 100% rename from native/qt6-app/CMakeLists.txt rename to native/CMakeLists.txt diff --git a/native/qt6-app/ImageButton.qml b/native/ImageButton.qml similarity index 100% rename from native/qt6-app/ImageButton.qml rename to native/ImageButton.qml diff --git a/native/qt6-app/Main.qml b/native/Main.qml similarity index 100% rename from native/qt6-app/Main.qml rename to native/Main.qml diff --git a/native/qt6-app/TextButton.qml b/native/TextButton.qml similarity index 100% rename from native/qt6-app/TextButton.qml rename to native/TextButton.qml diff --git a/native/main.cpp b/native/main.cpp index 7867d62..fd719b3 100644 --- a/native/main.cpp +++ b/native/main.cpp @@ -1,6 +1,22 @@ -#include +#include +#include +#include -int main() { - std::cout << "Hello World!"; - return 0; + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + + app.setWindowIcon(QIcon(":/Qt6-Quick-Example/Assets/Icons/Jukebox.ico")); + + QQmlApplicationEngine engine; + const QUrl url(u"qrc:/Qt6-Quick-Example/Main.qml"_qs); + QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, + &app, [url](QObject *obj, const QUrl &objUrl) { + if (!obj && url == objUrl) + QCoreApplication::exit(-1); + }, Qt::QueuedConnection); + engine.load(url); + + return app.exec(); } diff --git a/native/meson.build b/native/meson.build deleted file mode 100644 index 9364a6b..0000000 --- a/native/meson.build +++ /dev/null @@ -1,5 +0,0 @@ -executable( - 'license-tool', - 'main.cpp', - install: true, -) diff --git a/native/qt6-app/pre_build.bat b/native/pre_build.bat similarity index 100% rename from native/qt6-app/pre_build.bat rename to native/pre_build.bat diff --git a/native/qt6-app/main.cpp b/native/qt6-app/main.cpp deleted file mode 100644 index fd719b3..0000000 --- a/native/qt6-app/main.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include -#include - - -int main(int argc, char *argv[]) -{ - QGuiApplication app(argc, argv); - - app.setWindowIcon(QIcon(":/Qt6-Quick-Example/Assets/Icons/Jukebox.ico")); - - QQmlApplicationEngine engine; - const QUrl url(u"qrc:/Qt6-Quick-Example/Main.qml"_qs); - QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, - &app, [url](QObject *obj, const QUrl &objUrl) { - if (!obj && url == objUrl) - QCoreApplication::exit(-1); - }, Qt::QueuedConnection); - engine.load(url); - - return app.exec(); -} diff --git a/nix/native.nix b/nix/native.nix index cd8b8b7..8067dd1 100644 --- a/nix/native.nix +++ b/nix/native.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation { pname = "native"; version = "0.1"; - src = ../native/Qt-Apps/Qt-Quick/Qt6-Quick-Example; + src = ../native; buildInputs = [ kdePackages.qtbase kdePackages.qtdeclarative kdePackages.qtmultimedia ];