diff --git a/.gitignore b/.gitignore index 3850c73..112bf24 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,7 @@ target result .direnv + +# C++ +build +/build-* diff --git a/meson.build b/meson.build index 957fb89..7db2bfc 100644 --- a/meson.build +++ b/meson.build @@ -3,5 +3,8 @@ project( 'cpp' ) +qt6 = import('qt6') +qt6_dep = dependency('qt6', modules: ['Core', 'Gui']) + subdir('native') diff --git a/native/QTprojeckt/NativGuiAlisa/CMakeLists.txt b/native/QTprojeckt/NativGuiAlisa/CMakeLists.txt deleted file mode 100644 index 36488d1..0000000 --- a/native/QTprojeckt/NativGuiAlisa/CMakeLists.txt +++ /dev/null @@ -1,56 +0,0 @@ -cmake_minimum_required(VERSION 3.21.1) - -option(LINK_INSIGHT "Link Qt Insight Tracker library" ON) -option(BUILD_QDS_COMPONENTS "Build design studio components" ON) - -project(NativGuiAlisaApp LANGUAGES CXX) - -set(CMAKE_AUTOMOC ON) - -find_package(Qt6 6.2 REQUIRED COMPONENTS Core Gui Qml Quick) - -if (Qt6_VERSION VERSION_GREATER_EQUAL 6.3) - qt_standard_project_setup() -endif() - -qt_add_executable(NativGuiAlisaApp src/main.cpp) - -qt_add_resources(NativGuiAlisaApp "configuration" - PREFIX "/" - FILES - qtquickcontrols2.conf -) - -target_link_libraries(NativGuiAlisaApp PRIVATE - Qt6::Core - Qt6::Gui - Qt6::Qml - Qt6::Quick -) - -set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml) -set(QML_IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY} - CACHE STRING "Import paths for Qt Creator's code model" - FORCE -) - -if (BUILD_QDS_COMPONENTS) - include(${CMAKE_CURRENT_SOURCE_DIR}/qmlcomponents) -endif() - -include(${CMAKE_CURRENT_SOURCE_DIR}/qmlmodules) - -if (LINK_INSIGHT) - include(${CMAKE_CURRENT_SOURCE_DIR}/insight) -endif () - -include(GNUInstallDirs) -install(TARGETS NativGuiAlisaApp - BUNDLE DESTINATION . - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - -# make IDEs aware of the QML import path -set(QML_IMPORT_PATH ${PROJECT_BINARY_DIR}/qml CACHE PATH - "Path to the custom QML components defined by the project") diff --git a/native/QTprojeckt/NativGuiAlisa/CMakeLists.txt.user b/native/QTprojeckt/NativGuiAlisa/CMakeLists.txt.user deleted file mode 100644 index e49b302..0000000 --- a/native/QTprojeckt/NativGuiAlisa/CMakeLists.txt.user +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - EnvironmentId - {bc574a5d-0084-4a4c-aafc-6d183d99e456} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - 0 - false - true - false - 2 - true - true - 0 - 8 - true - false - 1 - true - true - true - *.md, *.MD, Makefile - false - true - true - - - - ProjectExplorer.Project.Target.0 - - Desktop - Desktop - Desktop - {1b914a2b-b5d2-4819-b494-223a423bf752} - 0 - 0 - 0 - - Debug - 2 - false - - -DCMAKE_GENERATOR:STRING=Ninja --DCMAKE_BUILD_TYPE:STRING=Debug --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake --DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} - 0 - E:\Programming\alisa\Alisa\native\QTprojeckt\NativGuiAlisa\build\Desktop-Debug - - - - - all - - false - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - - clean - - false - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Debug - CMakeProjectManager.CMakeBuildConfiguration - - - Release - 2 - false - - -DCMAKE_GENERATOR:STRING=Ninja --DCMAKE_BUILD_TYPE:STRING=Release --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake --DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} - E:\Programming\alisa\Alisa\native\QTprojeckt\NativGuiAlisa\build\Desktop-Release - - - - - all - - false - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - - clean - - false - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Release - CMakeProjectManager.CMakeBuildConfiguration - - - RelWithDebInfo - 2 - false - - -DCMAKE_GENERATOR:STRING=Ninja --DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake --DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} - E:\Programming\alisa\Alisa\native\QTprojeckt\NativGuiAlisa\build\Desktop-RelWithDebInfo - - - - - all - - false - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - - clean - - false - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Release with Debug Information - CMakeProjectManager.CMakeBuildConfiguration - - - RelWithDebInfo - 2 - false - - -DCMAKE_GENERATOR:STRING=Ninja --DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake --DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} - 0 - E:\Programming\alisa\Alisa\native\QTprojeckt\NativGuiAlisa\build\Desktop-Profile - - - - - all - - false - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - - clean - - false - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Profile - CMakeProjectManager.CMakeBuildConfiguration - - - MinSizeRel - 2 - false - - -DCMAKE_GENERATOR:STRING=Ninja --DCMAKE_BUILD_TYPE:STRING=MinSizeRel --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake --DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} --DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} - E:\Programming\alisa\Alisa\native\QTprojeckt\NativGuiAlisa\build\Desktop-MinSizeRel - - - - - all - - false - - true - CMakeProjectManager.MakeStep - - 1 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - - - clean - - false - - true - CMakeProjectManager.MakeStep - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - false - - Minimum Size Release - CMakeProjectManager.CMakeBuildConfiguration - - 5 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - - false - ProjectExplorer.DefaultDeployConfiguration - - 1 - - true - true - 0 - true - - 2 - - false - -e cpu-cycles --call-graph "dwarf,4096" -F 250 - - ProjectExplorer.CustomExecutableRunConfiguration - - false - true - true - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/native/QTprojeckt/NativGuiAlisa/NativGuiAlisa.qmlproject b/native/QTprojeckt/NativGuiAlisa/NativGuiAlisa.qmlproject deleted file mode 100644 index 9162983..0000000 --- a/native/QTprojeckt/NativGuiAlisa/NativGuiAlisa.qmlproject +++ /dev/null @@ -1,123 +0,0 @@ -import QmlProject - -Project { - mainFile: "content/App.qml" - mainUiFile: "content/Screen01.ui.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "content" - } - - QmlFiles { - directory: "imports" - } - - JavaScriptFiles { - directory: "content" - } - - JavaScriptFiles { - directory: "imports" - } - - ImageFiles { - directory: "content" - } - - ImageFiles { - directory: "asset_imports" - } - - Files { - filter: "*.conf" - files: ["qtquickcontrols2.conf"] - } - - Files { - filter: "qmldir" - directory: "." - } - - Files { - filter: "*.ttf;*.otf" - } - - Files { - filter: "*.wav;*.mp3" - } - - Files { - filter: "*.mp4" - } - - Files { - filter: "*.glsl;*.glslv;*.glslf;*.vsh;*.fsh;*.vert;*.frag" - } - - Files { - filter: "*.qsb" - } - - Files { - filter: "*.json" - } - - Files { - filter: "*.mesh" - directory: "asset_imports" - } - - Files { - filter: "*.qad" - directory: "asset_imports" - } - - Files { - filter: "*.qml" - directory: "asset_imports" - } - - Environment { - QT_QUICK_CONTROLS_CONF: "qtquickcontrols2.conf" - QT_AUTO_SCREEN_SCALE_FACTOR: "1" - QML_COMPAT_RESOLVE_URLS_ON_ASSIGNMENT: "1" - QT_LOGGING_RULES: "qt.qml.connections=false" - QT_ENABLE_HIGHDPI_SCALING: "0" - /* Useful for debugging - QSG_VISUALIZE=batches - QSG_VISUALIZE=clip - QSG_VISUALIZE=changes - QSG_VISUALIZE=overdraw - */ - } - - qt6Project: true - - /* List of plugin directories passed to QML runtime */ - importPaths: [ "imports", "asset_imports" ] - - /* Required for deployment */ - targetDirectory: "/opt/NativGuiAlisa" - - qdsVersion: "4.3" - - quickVersion: "6.2" - - /* If any modules the project imports require widgets (e.g. QtCharts), widgetApp must be true */ - widgetApp: true - - /* args: Specifies command line arguments for qsb tool to generate shaders. - files: Specifies target files for qsb tool. If path is included, it must be relative to this file. - Wildcard '*' can be used in the file name part of the path. - e.g. files: [ "content/shaders/*.vert", "*.frag" ] */ - ShaderTool { - args: "-s --glsl \"100 es,120,150\" --hlsl 50 --msl 12" - files: [ "content/shaders/*" ] - } - - multilanguageSupport: true - supportedLanguages: ["en"] - primaryLanguage: "en" - -} diff --git a/native/QTprojeckt/NativGuiAlisa/NativGuiAlisa.qmlproject.qtds b/native/QTprojeckt/NativGuiAlisa/NativGuiAlisa.qmlproject.qtds deleted file mode 100644 index ff2343e..0000000 --- a/native/QTprojeckt/NativGuiAlisa/NativGuiAlisa.qmlproject.qtds +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - EnvironmentId - {e57dfb78-a8dc-42e2-a4cd-6398ab5441f9} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - 0 - false - true - false - 2 - true - true - 0 - 8 - true - false - 1 - true - true - true - *.md, *.MD, Makefile - false - true - true - - - - ProjectExplorer.Project.Target.0 - - Desktop - Desktop Qt 6.7.1 - Desktop Qt 6.7.1 - {63f87550-2541-4163-9631-08b7fea781da} - -1 - 0 - 0 - 0 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - - false - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - 0 - - false - QML Runtime - QmlProjectManager.QmlRunConfiguration.Qml - - false - en - CurrentFile - true - true - true - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/native/QTprojeckt/NativGuiAlisa/asset_imports/asset_imports.txt b/native/QTprojeckt/NativGuiAlisa/asset_imports/asset_imports.txt deleted file mode 100644 index 84c843f..0000000 --- a/native/QTprojeckt/NativGuiAlisa/asset_imports/asset_imports.txt +++ /dev/null @@ -1 +0,0 @@ -Imported 3D assets and components imported from bundles will be created in this folder. diff --git a/native/QTprojeckt/NativGuiAlisa/content/App.qml b/native/QTprojeckt/NativGuiAlisa/content/App.qml deleted file mode 100644 index 8ffc4dc..0000000 --- a/native/QTprojeckt/NativGuiAlisa/content/App.qml +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only - -import QtQuick 6.2 -import NativGuiAlisa - -Window { - width: mainScreen.width - height: mainScreen.height - - visible: true - title: "NativGuiAlisa" - - Screen01 { - id: mainScreen - } - -} - diff --git a/native/QTprojeckt/NativGuiAlisa/content/CMakeLists.txt b/native/QTprojeckt/NativGuiAlisa/content/CMakeLists.txt deleted file mode 100644 index 9f2a563..0000000 --- a/native/QTprojeckt/NativGuiAlisa/content/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -### This file is automatically generated by Qt Design Studio. -### Do not change - -qt_add_library(content STATIC) -qt6_add_qml_module(content - URI "content" - VERSION 1.0 - RESOURCE_PREFIX "/qt/qml" - QML_FILES - App.qml - Screen01.ui.qml - RESOURCES - fonts/fonts.txt -) diff --git a/native/QTprojeckt/NativGuiAlisa/content/Screen01.ui.qml b/native/QTprojeckt/NativGuiAlisa/content/Screen01.ui.qml deleted file mode 100644 index fa58a78..0000000 --- a/native/QTprojeckt/NativGuiAlisa/content/Screen01.ui.qml +++ /dev/null @@ -1,71 +0,0 @@ -/* -This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only. -It is supposed to be strictly declarative and only uses a subset of QML. If you edit -this file manually, you might introduce QML code that is not supported by Qt Design Studio. -Check out https://doc.qt.io/qtcreator/creator-quick-ui-forms.html for details on .ui.qml files. -*/ - -import QtQuick 6.2 -import QtQuick.Controls 6.2 -import NativGuiAlisa - -Rectangle { - id: rectangle - width: Constants.width - height: Constants.height - - color: Constants.backgroundColor - - Button { - id: button - text: qsTr("Press me") - anchors.verticalCenter: parent.verticalCenter - checkable: true - anchors.horizontalCenter: parent.horizontalCenter - - Connections { - target: button - onClicked: animation.start() - } - } - - Text { - id: label - text: qsTr("Hello NativGuiAlisa") - anchors.top: button.bottom - font.family: Constants.font.family - anchors.topMargin: 45 - anchors.horizontalCenter: parent.horizontalCenter - - SequentialAnimation { - id: animation - - ColorAnimation { - id: colorAnimation1 - target: rectangle - property: "color" - to: "#2294c6" - from: Constants.backgroundColor - } - - ColorAnimation { - id: colorAnimation2 - target: rectangle - property: "color" - to: Constants.backgroundColor - from: "#2294c6" - } - } - } - states: [ - State { - name: "clicked" - when: button.checked - - PropertyChanges { - target: label - text: qsTr("Button Checked") - } - } - ] -} diff --git a/native/QTprojeckt/NativGuiAlisa/content/Screen01.ui.qml.autosave b/native/QTprojeckt/NativGuiAlisa/content/Screen01.ui.qml.autosave deleted file mode 100644 index aa00896..0000000 --- a/native/QTprojeckt/NativGuiAlisa/content/Screen01.ui.qml.autosave +++ /dev/null @@ -1,88 +0,0 @@ -/* -This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only. -It is supposed to be strictly declarative and only uses a subset of QML. If you edit -this file manually, you might introduce QML code that is not supported by Qt Design Studio. -Check out https://doc.qt.io/qtcreator/creator-quick-ui-forms.html for details on .ui.qml files. -*/ - -import QtQuick 6.2 -import QtQuick.Controls 6.2 -import NativGuiAlisa - -Rectangle { - id: rectangle - width: Constants.width - height: Constants.height - - color: Constants.backgroundColor - - Button { - id: button - text: qsTr("Press me") - anchors.verticalCenter: parent.verticalCenter - anchors.verticalCenterOffset: 12 - anchors.horizontalCenterOffset: 1 - checkable: true - anchors.horizontalCenter: parent.horizontalCenter - - Connections { - target: button - onClicked: animation.start() - } - } - - Text { - id: label - text: qsTr("Hello NativGuiAlisa") - anchors.top: button.bottom - font.family: Constants.font.family - anchors.topMargin: 45 - anchors.horizontalCenter: parent.horizontalCenter - - SequentialAnimation { - id: animation - - ColorAnimation { - id: colorAnimation1 - target: rectangle - property: "color" - to: "#2294c6" - from: Constants.backgroundColor - } - - ColorAnimation { - id: colorAnimation2 - target: rectangle - property: "color" - to: Constants.backgroundColor - from: "#2294c6" - } - } - } - - DelayButton { - id: delayButton - x: 912 - y: 422 - text: qsTr("Delay Button") - } - - Pane { - id: pane - x: 113 - y: 52 - width: 1693 - height: 56 - } - states: [ - State { - name: "clicked" - when: button.checked - - PropertyChanges { - target: label - text: qsTr("Button Checked") - } - } - ] -} diff --git a/native/QTprojeckt/NativGuiAlisa/content/fonts/fonts.txt b/native/QTprojeckt/NativGuiAlisa/content/fonts/fonts.txt deleted file mode 100644 index ab96122..0000000 --- a/native/QTprojeckt/NativGuiAlisa/content/fonts/fonts.txt +++ /dev/null @@ -1 +0,0 @@ -Fonts in this folder are loaded automatically. diff --git a/native/QTprojeckt/NativGuiAlisa/imports/CMakeLists.txt b/native/QTprojeckt/NativGuiAlisa/imports/CMakeLists.txt deleted file mode 100644 index 12db0c6..0000000 --- a/native/QTprojeckt/NativGuiAlisa/imports/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -### This file is automatically generated by Qt Design Studio. -### Do not change - -add_subdirectory(NativGuiAlisa) diff --git a/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/CMakeLists.txt b/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/CMakeLists.txt deleted file mode 100644 index 46f5831..0000000 --- a/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -### This file is automatically generated by Qt Design Studio. -### Do not change - -qt_add_library(NativGuiAlisa STATIC) -set_source_files_properties(Constants.qml - PROPERTIES - QT_QML_SINGLETON_TYPE true - ) - -qt6_add_qml_module(NativGuiAlisa - URI "NativGuiAlisa" - VERSION 1.0 - RESOURCE_PREFIX "/qt/qml" - QML_FILES - Constants.qml - DirectoryFontLoader.qml - EventListModel.qml - EventListSimulator.qml -) diff --git a/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/Constants.qml b/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/Constants.qml deleted file mode 100644 index 8710bcb..0000000 --- a/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/Constants.qml +++ /dev/null @@ -1,27 +0,0 @@ -pragma Singleton -import QtQuick 6.2 -import QtQuick.Studio.Application - -QtObject { - readonly property int width: 1920 - readonly property int height: 1080 - - property string relativeFontDirectory: "fonts" - - /* Edit this comment to add your custom font */ - readonly property font font: Qt.font({ - family: Qt.application.font.family, - pixelSize: Qt.application.font.pixelSize - }) - readonly property font largeFont: Qt.font({ - family: Qt.application.font.family, - pixelSize: Qt.application.font.pixelSize * 1.6 - }) - - readonly property color backgroundColor: "#EAEAEA" - - - property StudioApplication application: StudioApplication { - fontPath: Qt.resolvedUrl("../../content/" + relativeFontDirectory) - } -} diff --git a/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/DirectoryFontLoader.qml b/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/DirectoryFontLoader.qml deleted file mode 100644 index aa22eac..0000000 --- a/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/DirectoryFontLoader.qml +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2019 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only - -import QtQuick 6.2 -import Qt.labs.folderlistmodel 6.2 - -QtObject { - id: loader - - property url fontDirectory: Qt.resolvedUrl("../../content/" + relativeFontDirectory) - property string relativeFontDirectory: "fonts" - - function loadFont(url) { - var fontLoader = Qt.createQmlObject('import QtQuick 2.15; FontLoader { source: "' + url + '"; }', - loader, - "dynamicFontLoader"); - } - - property FolderListModel folderModel: FolderListModel { - id: folderModel - folder: loader.fontDirectory - nameFilters: [ "*.ttf", "*.otf" ] - showDirs: false - - onStatusChanged: { - if (folderModel.status == FolderListModel.Ready) { - var i - for (i = 0; i < count; i++) { - loadFont(folderModel.get(i, "fileURL")) - } - } - } - } -} diff --git a/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/EventListModel.qml b/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/EventListModel.qml deleted file mode 100644 index bd5e5c3..0000000 --- a/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/EventListModel.qml +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only - -import QtQuick 6.2 - -ListModel { - id: eventListModel - - ListElement { - eventId: "enterPressed" - eventDescription: "Emitted when pressing the enter button" - shortcut: "Return" - parameters: "Enter" - } -} diff --git a/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/EventListSimulator.qml b/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/EventListSimulator.qml deleted file mode 100644 index b7724cb..0000000 --- a/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/EventListSimulator.qml +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only - -import QtQuick 6.2 -import QtQuick.Studio.EventSimulator 1.0 -import QtQuick.Studio.EventSystem 1.0 - -QtObject { - id: simulator - property bool active: true - - property Timer __timer: Timer { - id: timer - interval: 100 - onTriggered: { - EventSimulator.show() - } - } - - Component.onCompleted: { - EventSystem.init(Qt.resolvedUrl("EventListModel.qml")) - if (simulator.active) - timer.start() - } -} diff --git a/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/designer/plugin.metainfo b/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/designer/plugin.metainfo deleted file mode 100644 index cbd30d3..0000000 --- a/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/designer/plugin.metainfo +++ /dev/null @@ -1,13 +0,0 @@ -MetaInfo { - Type { - name: "NativGuiAlisa.EventListSimulator" - icon: ":/qtquickplugin/images/item-icon16.png" - - Hints { - visibleInNavigator: true - canBeDroppedInNavigator: true - canBeDroppedInFormEditor: false - canBeDroppedInView3D: false - } - } -} diff --git a/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/qmldir b/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/qmldir deleted file mode 100644 index 70885de..0000000 --- a/native/QTprojeckt/NativGuiAlisa/imports/NativGuiAlisa/qmldir +++ /dev/null @@ -1,5 +0,0 @@ -Module NativGuiAlisa -singleton Constants 1.0 Constants.qml -EventListSimulator 1.0 EventListSimulator.qml -EventListModel 1.0 EventListModel.qml -DirectoryFontLoader 1.0 DirectoryFontLoader.qml diff --git a/native/QTprojeckt/NativGuiAlisa/insight b/native/QTprojeckt/NativGuiAlisa/insight deleted file mode 100644 index 8245e31..0000000 --- a/native/QTprojeckt/NativGuiAlisa/insight +++ /dev/null @@ -1,19 +0,0 @@ -### This file is automatically generated by Qt Design Studio. -### Do not change - -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/qtinsight.conf) - if (QT_VERSION GREATER_EQUAL 6.5.0) - find_package(Qt6 REQUIRED COMPONENTS InsightTracker) - - qt_add_resources(${CMAKE_PROJECT_NAME} "configuration" - PREFIX "/" - FILES - qtinsight.conf - ) - target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE - Qt6::InsightTracker - ) - else() - message(WARNING "You need Qt 6.5.0 or newer to build the application.") - endif() -endif() diff --git a/native/QTprojeckt/NativGuiAlisa/main.qml b/native/QTprojeckt/NativGuiAlisa/main.qml deleted file mode 100644 index 2c4f857..0000000 --- a/native/QTprojeckt/NativGuiAlisa/main.qml +++ /dev/null @@ -1,8 +0,0 @@ -/* This file is generated and only relevant for integrating the project into a Qt 6 and cmake based -C++ project. */ - -import QtQuick -import content - -App { -} diff --git a/native/QTprojeckt/NativGuiAlisa/qmlcomponents b/native/QTprojeckt/NativGuiAlisa/qmlcomponents deleted file mode 100644 index 2e940be..0000000 --- a/native/QTprojeckt/NativGuiAlisa/qmlcomponents +++ /dev/null @@ -1,34 +0,0 @@ -### This file is automatically generated by Qt Design Studio. -### Do not change - -message("Building designer components.") - -set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml") - -include(FetchContent) -FetchContent_Declare( - ds - GIT_TAG qds-4.4 - GIT_REPOSITORY https://code.qt.io/qt-labs/qtquickdesigner-components.git -) - -FetchContent_GetProperties(ds) -FetchContent_Populate(ds) - -target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE - QuickStudioComponentsplugin - QuickStudioEffectsplugin - QuickStudioApplicationplugin - FlowViewplugin - QuickStudioLogicHelperplugin - QuickStudioMultiTextplugin - QuickStudioEventSimulatorplugin - QuickStudioEventSystemplugin - QuickStudioUtilsplugin -) - -add_subdirectory(${ds_SOURCE_DIR} ${ds_BINARY_DIR}) - -target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE - BULD_QDS_COMPONENTS=true -) diff --git a/native/QTprojeckt/NativGuiAlisa/qmlmodules b/native/QTprojeckt/NativGuiAlisa/qmlmodules deleted file mode 100644 index 5bf4317..0000000 --- a/native/QTprojeckt/NativGuiAlisa/qmlmodules +++ /dev/null @@ -1,18 +0,0 @@ -### This file is automatically generated by Qt Design Studio. -### Do not change - -qt6_add_qml_module(${CMAKE_PROJECT_NAME} - URI "Main" - VERSION 1.0 - RESOURCE_PREFIX "/qt/qml" - NO_PLUGIN - QML_FILES main.qml -) - -add_subdirectory(content) -add_subdirectory(imports) - -target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE - contentplugin - NativGuiAlisaplugin -) diff --git a/native/QTprojeckt/NativGuiAlisa/qtquickcontrols2.conf b/native/QTprojeckt/NativGuiAlisa/qtquickcontrols2.conf deleted file mode 100644 index 6f0d6fe..0000000 --- a/native/QTprojeckt/NativGuiAlisa/qtquickcontrols2.conf +++ /dev/null @@ -1,13 +0,0 @@ -; This file can be edited to change the style of the application -; Read "Qt Quick Controls 2 Configuration File" for details: -; http://doc.qt.io/qt-5/qtquickcontrols2-configuration.html - -[Controls] -Style=Material - -[Material] -Theme=Light -;Accent=BlueGrey -;Primary=BlueGray -;Foreground=Brown -;Background=Grey diff --git a/native/QTprojeckt/NativGuiAlisa/src/app_environment.h b/native/QTprojeckt/NativGuiAlisa/src/app_environment.h deleted file mode 100644 index 6b42bff..0000000 --- a/native/QTprojeckt/NativGuiAlisa/src/app_environment.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * This file is automatically generated by Qt Design Studio. - * Do not change. -*/ - -#include - -void set_qt_environment() -{ - qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1"); - qputenv("QT_ENABLE_HIGHDPI_SCALING", "0"); - qputenv("QT_LOGGING_RULES", "qt.qml.connections=false"); - qputenv("QT_QUICK_CONTROLS_CONF", ":/qtquickcontrols2.conf"); - qputenv("QML_COMPAT_RESOLVE_URLS_ON_ASSIGNMENT", "1"); -} diff --git a/native/QTprojeckt/NativGuiAlisa/src/import_qml_components_plugins.h b/native/QTprojeckt/NativGuiAlisa/src/import_qml_components_plugins.h deleted file mode 100644 index 25d0a98..0000000 --- a/native/QTprojeckt/NativGuiAlisa/src/import_qml_components_plugins.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * This file is automatically generated by Qt Design Studio. - * Do not change. -*/ - -#include "qqmlextensionplugin.h" - -#ifdef BULD_QDS_COMPONENTS - -Q_IMPORT_QML_PLUGIN(QtQuick_Studio_ComponentsPlugin) -Q_IMPORT_QML_PLUGIN(QtQuick_Studio_EffectsPlugin) -Q_IMPORT_QML_PLUGIN(QtQuick_Studio_ApplicationPlugin) -Q_IMPORT_QML_PLUGIN(FlowViewPlugin) -Q_IMPORT_QML_PLUGIN(QtQuick_Studio_LogicHelperPlugin) -Q_IMPORT_QML_PLUGIN(QtQuick_Studio_MultiTextPlugin) -Q_IMPORT_QML_PLUGIN(QtQuick_Studio_EventSimulatorPlugin) -Q_IMPORT_QML_PLUGIN(QtQuick_Studio_EventSystemPlugin) - -#endif diff --git a/native/QTprojeckt/NativGuiAlisa/src/import_qml_plugins.h b/native/QTprojeckt/NativGuiAlisa/src/import_qml_plugins.h deleted file mode 100644 index 5602249..0000000 --- a/native/QTprojeckt/NativGuiAlisa/src/import_qml_plugins.h +++ /dev/null @@ -1,9 +0,0 @@ -/* - * This file is automatically generated by Qt Design Studio. - * Do not change. -*/ - -#include - -Q_IMPORT_QML_PLUGIN(contentPlugin) -Q_IMPORT_QML_PLUGIN(NativGuiAlisaPlugin) diff --git a/native/QTprojeckt/NativGuiAlisa/src/main.cpp b/native/QTprojeckt/NativGuiAlisa/src/main.cpp deleted file mode 100644 index 2091020..0000000 --- a/native/QTprojeckt/NativGuiAlisa/src/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2021 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only - -#include -#include - -#include "app_environment.h" -#include "import_qml_components_plugins.h" -#include "import_qml_plugins.h" - -int main(int argc, char *argv[]) -{ - set_qt_environment(); - - QGuiApplication app(argc, argv); - - QQmlApplicationEngine engine; - const QUrl url(u"qrc:/qt/qml/Main/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.addImportPath(QCoreApplication::applicationDirPath() + "/qml"); - engine.addImportPath(":/"); - - engine.load(url); - - if (engine.rootObjects().isEmpty()) { - return -1; - } - - return app.exec(); -} diff --git a/native/qt6-app/Assets/Audio/test.mp4 b/native/qt6-app/Assets/Audio/test.mp4 new file mode 100644 index 0000000..57a209a Binary files /dev/null and b/native/qt6-app/Assets/Audio/test.mp4 differ diff --git a/native/qt6-app/Assets/Icons/Jukebox.ico b/native/qt6-app/Assets/Icons/Jukebox.ico new file mode 100644 index 0000000..2cd345f Binary files /dev/null and b/native/qt6-app/Assets/Icons/Jukebox.ico differ diff --git a/native/qt6-app/Assets/Icons/Jukebox.png b/native/qt6-app/Assets/Icons/Jukebox.png new file mode 100644 index 0000000..a0fb3b0 Binary files /dev/null and b/native/qt6-app/Assets/Icons/Jukebox.png differ diff --git a/native/qt6-app/Assets/Icons/Next.png b/native/qt6-app/Assets/Icons/Next.png new file mode 100644 index 0000000..2ac54aa Binary files /dev/null and b/native/qt6-app/Assets/Icons/Next.png differ diff --git a/native/qt6-app/Assets/Icons/Pause.png b/native/qt6-app/Assets/Icons/Pause.png new file mode 100644 index 0000000..441b23d Binary files /dev/null and b/native/qt6-app/Assets/Icons/Pause.png differ diff --git a/native/qt6-app/Assets/Icons/Play.png b/native/qt6-app/Assets/Icons/Play.png new file mode 100644 index 0000000..31a2c3b Binary files /dev/null and b/native/qt6-app/Assets/Icons/Play.png differ diff --git a/native/qt6-app/Assets/Icons/Previous.png b/native/qt6-app/Assets/Icons/Previous.png new file mode 100644 index 0000000..2f0c702 Binary files /dev/null and b/native/qt6-app/Assets/Icons/Previous.png differ diff --git a/native/qt6-app/Assets/Images/Boygenius_-_the_record.jpg b/native/qt6-app/Assets/Images/Boygenius_-_the_record.jpg new file mode 100644 index 0000000..1309325 Binary files /dev/null and b/native/qt6-app/Assets/Images/Boygenius_-_the_record.jpg differ diff --git a/native/qt6-app/Assets/Images/Caroline_Polachek_-_Desire,_I_Want_to_Turn_Into_You.png b/native/qt6-app/Assets/Images/Caroline_Polachek_-_Desire,_I_Want_to_Turn_Into_You.png new file mode 100644 index 0000000..8265000 Binary files /dev/null and b/native/qt6-app/Assets/Images/Caroline_Polachek_-_Desire,_I_Want_to_Turn_Into_You.png differ diff --git a/native/qt6-app/Assets/Images/Kali-Uchis-Red-Moon-in-Venus.webp b/native/qt6-app/Assets/Images/Kali-Uchis-Red-Moon-in-Venus.webp new file mode 100644 index 0000000..600a219 Binary files /dev/null and b/native/qt6-app/Assets/Images/Kali-Uchis-Red-Moon-in-Venus.webp differ diff --git a/native/qt6-app/Assets/Images/Yeule_-_Softscars.png b/native/qt6-app/Assets/Images/Yeule_-_Softscars.png new file mode 100644 index 0000000..ebd9426 Binary files /dev/null and b/native/qt6-app/Assets/Images/Yeule_-_Softscars.png differ diff --git a/native/qt6-app/Assets/Videos/Free_Test_Data_5MB_AVI.avi b/native/qt6-app/Assets/Videos/Free_Test_Data_5MB_AVI.avi new file mode 100644 index 0000000..fa7d286 Binary files /dev/null and b/native/qt6-app/Assets/Videos/Free_Test_Data_5MB_AVI.avi differ diff --git a/native/qt6-app/AudioInfoBox.qml b/native/qt6-app/AudioInfoBox.qml new file mode 100644 index 0000000..5d520a2 --- /dev/null +++ b/native/qt6-app/AudioInfoBox.qml @@ -0,0 +1,92 @@ +import QtQuick +import QtMultimedia + +Item { + id: root + + required property int songIndex + property alias title: titleText.text + property alias authorName: authorText.text + property alias imageSource: albumImage.source + property alias videoSource: albumVideo.source + property alias video: albumVideo + + visible: playerController.currentSongIndex === root.songIndex + + Image { + id: albumImage + + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + } + + width: 150 + height: 150 + } + + Video { + id: albumVideo + + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + } + + width: 400 + height: 400 + + loops: MediaPlayer.Infinite + volume: 0 + } + + Text { + id: titleText + + anchors { + bottom: parent.verticalCenter + left: playerController.currentSongIndex === 3 ? albumVideo.right : albumImage.right + margins: 20 + right: parent.right + } + + color: "white" + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + + font { + pixelSize: 20 + bold: true + } + + text: qsTr("text") + } + + Text { + id: authorText + + anchors { + top: parent.verticalCenter + left: titleText.left + topMargin: 5 + right: parent.right + } + + color: "gray" + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + + font { + pixelSize: 16 + } + + text: qsTr("text") + } + + onVisibleChanged: { + if (visible) { + albumVideo.play() + } else { + albumVideo.seek(0) + albumVideo.stop() + } + } +} diff --git a/native/qt6-app/CMakeLists.txt b/native/qt6-app/CMakeLists.txt new file mode 100644 index 0000000..0d05501 --- /dev/null +++ b/native/qt6-app/CMakeLists.txt @@ -0,0 +1,58 @@ +cmake_minimum_required(VERSION 3.16) + +project(Qt6-Quick-Example VERSION 0.1 LANGUAGES CXX) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(Qt6 6.2 REQUIRED COMPONENTS Quick Multimedia) + + +qt_add_executable(appQt6-Quick-Example + main.cpp +) + +qt_add_qml_module(appQt6-Quick-Example + URI Qt6-Quick-Example + VERSION 1.0 + QML_FILES Main.qml + QML_FILES AudioInfoBox.qml + QML_FILES ImageButton.qml + + RESOURCES + Assets/Images/Boygenius_-_the_record.jpg + Assets/Images/Caroline_Polachek_-_Desire,_I_Want_to_Turn_Into_You.png + Assets/Images/Yeule_-_Softscars.png + + Assets/Icons/Next.png + Assets/Icons/Pause.png + Assets/Icons/Play.png + Assets/Icons/Previous.png + Assets/Icons/Jukebox.ico + + Assets/Videos/Free_Test_Data_5MB_AVI.avi + + Assets/Audio/test.mp4 +) + +# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. +# If you are developing for iOS or macOS you should consider setting an +# explicit, fixed bundle identifier manually though. +set_target_properties(appQt6-Quick-Example PROPERTIES +# MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appQt6-Quick-Example + MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} + MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} + MACOSX_BUNDLE TRUE + WIN32_EXECUTABLE TRUE +) + +target_link_libraries(appQt6-Quick-Example + PRIVATE Qt6::Quick Qt6::Multimedia +) + +include(GNUInstallDirs) +install(TARGETS appQt6-Quick-Example + BUNDLE DESTINATION . + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) diff --git a/native/qt6-app/ImageButton.qml b/native/qt6-app/ImageButton.qml new file mode 100644 index 0000000..f041ed3 --- /dev/null +++ b/native/qt6-app/ImageButton.qml @@ -0,0 +1,23 @@ +import QtQuick + +Image { + id: root + + signal clicked() + + width: buttonMouseArea.containsPress ? 49.5 : 50 + height: buttonMouseArea.containsPress ? 49.5 : 50 + opacity: buttonMouseArea.containsMouse ? 0.75 : 1 + mipmap: true + + MouseArea { + id: buttonMouseArea + + anchors.fill: parent + hoverEnabled: true + + onClicked: { + root.clicked() + } + } +} diff --git a/native/qt6-app/Main.qml b/native/qt6-app/Main.qml new file mode 100644 index 0000000..6c32632 --- /dev/null +++ b/native/qt6-app/Main.qml @@ -0,0 +1,182 @@ +import QtQuick +import QtQuick.Window +import QtQuick.Layouts + +Window { + id: root + width: 640 + height: 480 + visible: true + + title: qsTr("Jukebox") + + Rectangle { + id: topbar + + anchors { + top: parent.top + left: parent.left + right: parent.right + } + + height: 50 + color: "#5F8575" + } + + Rectangle { + id: mainSection + + anchors { + top: topbar.bottom + bottom: bottomBar.top + left: parent.left + right: parent.right + } + + color: "#1e1e1e" + + AudioInfoBox { + id: firstSong + + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + right: parent.right + margins: 20 + } + + songIndex: 0 + title: "The Record" + authorName: "Boygenius" + imageSource: "Assets/Images/Boygenius_-_the_record.jpg" + } + + AudioInfoBox { + id: secondSong + + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + right: parent.right + margins: 20 + } + + songIndex: 1 + title: "Desire, I Want to Turn Into You" + authorName: "Caroline Polachek" + imageSource: "Assets/Images/Caroline_Polachek_-_Desire,_I_Want_to_Turn_Into_You.png" + } + + AudioInfoBox { + id: thirdSong + + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + right: parent.right + margins: 20 + } + + songIndex: 2 + title: "Softscars" + authorName: "Yeule" + imageSource: "Assets/Images/Yeule_-_Softscars.png" + } + + AudioInfoBox { + id: fourthSong + + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + right: parent.right + margins: 20 + } + + songIndex: 3 + title: "Free Test Data" + authorName: "5MB AVI" + videoSource: "qrc:/Qt6-Quick-Example/Assets/Videos/Free_Test_Data_5MB_AVI.avi" + } + } + + Rectangle { + id: bottomBar + + anchors { + bottom: parent.bottom + left: parent.left + right: parent.right + } + + height: 100 + color: "#333333" + + + ImageButton { + id: previousButton + + anchors { + verticalCenter: parent.verticalCenter + horizontalCenter: parent.horizontalCenter + horizontalCenterOffset: -70 + } + + source: "Assets/Icons/Previous.png" + + onClicked: playerController.switchToPreviousSong() + } + + ImageButton { + id: playPauseButton + + anchors.centerIn: parent + + source: playerController.playing ? "Assets/Icons/Pause.png" : "Assets/Icons/Play.png" + + onClicked: playerController.playPause() + } + + ImageButton { + id: nextButton + + anchors { + verticalCenter: parent.verticalCenter + horizontalCenter: parent.horizontalCenter + horizontalCenterOffset: 70 + } + + source: "Assets/Icons/Next.png" + + onClicked: playerController.switchToNextSong() + } + } + + QtObject { + id: playerController + + property int currentSongIndex: 0 + property int songCount: 4 + property bool playing: true + + function playPause() { + playing = !playing + if (playing) { + fourthSong.video.play() + } else { + fourthSong.video.pause() + } + } + + function switchToNextSong() { + currentSongIndex = (currentSongIndex + 1) % songCount + console.log(currentSongIndex) + } + + function switchToPreviousSong() { + if (currentSongIndex == 0) currentSongIndex = songCount; + currentSongIndex = (currentSongIndex - 1) % songCount + console.log(currentSongIndex) + } + } +} diff --git a/native/qt6-app/TextButton.qml b/native/qt6-app/TextButton.qml new file mode 100644 index 0000000..e6fa230 --- /dev/null +++ b/native/qt6-app/TextButton.qml @@ -0,0 +1,44 @@ +import QtQuick + +Item { + id: root + + property color color: "gray" + property alias text: buttonText.text + + signal clicked() + + Rectangle { + id: background + anchors.fill: parent + color: getModifiedColor(buttonMouseArea, root.color) + } + + Text { + id: buttonText + + anchors.centerIn: parent + } + + MouseArea { + id: buttonMouseArea + + anchors.fill: parent + hoverEnabled: true + + onClicked: { + root.clicked() + } + } + + function getModifiedColor(item, color) + { + if (item.containsPress) { + return Qt.darker(color) + } else if (item.containsMouse) { + return Qt.lighter(color) + } else { + return color + } + } +} diff --git a/native/qt6-app/main.cpp b/native/qt6-app/main.cpp new file mode 100644 index 0000000..fd719b3 --- /dev/null +++ b/native/qt6-app/main.cpp @@ -0,0 +1,22 @@ +#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/native/qt6-app/pre_build.bat b/native/qt6-app/pre_build.bat new file mode 100644 index 0000000..9971816 --- /dev/null +++ b/native/qt6-app/pre_build.bat @@ -0,0 +1,8 @@ +@ECHO OFF + +set path=%path%;C:\Qt\Tools\mingw1120_64\bin +C:\Qt\6.6.0\mingw_64\bin\windeployqt6.exe D:\GitHub\Qt-Apps\Qt-Quick\build-Qt6-Quick-Example-Desktop_Qt_6_6_0_MinGW_64_bit-Release + +echo "Finished pre-build" +popd +exit /b 0 \ No newline at end of file diff --git a/nix/native.nix b/nix/native.nix index 76878d9..cd8b8b7 100644 --- a/nix/native.nix +++ b/nix/native.nix @@ -1,17 +1,19 @@ { lib, stdenv, - meson, - ninja, + cmake, + kdePackages, }: stdenv.mkDerivation { pname = "native"; version = "0.1"; - src = ../.; + src = ../native/Qt-Apps/Qt-Quick/Qt6-Quick-Example; - nativeBuildInputs = [ meson ninja ]; + buildInputs = [ kdePackages.qtbase kdePackages.qtdeclarative kdePackages.qtmultimedia ]; + + nativeBuildInputs = [ cmake kdePackages.wrapQtAppsHook ]; meta = { maintainers = with lib.maintainers; [ jopejoe1 ];