commit 8069dfcdc2463c0c45cea019aa4802a7376addae Author: chris bell Date: Tue Jul 7 12:44:31 2026 -0500 Init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..77b3b7d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build/ +result diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..36f54e7 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.16) +project(QT LANGUAGES CXX) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick QuickControls2) + +qt_policy(SET QTP0001 NEW) +qt_policy(SET QTP0004 NEW) + +qt_add_executable(qtapp src/main.cpp) + +qt_add_qml_module(qtapp + URI App + VERSION 1.0 + QML_FILES + src/Main.qml + SOURCES +) + +target_include_directories(qtapp PRIVATE src) + +target_link_libraries(qtapp PRIVATE + Qt6::Core + Qt6::Gui + Qt6::Qml + Qt6::Quick + Qt6::QuickControls2 +) + +install(TARGETS qtapp DESTINATION ${CMAKE_INSTALL_BINDIR}) + diff --git a/Launcher.cfg b/Launcher.cfg new file mode 100644 index 0000000..7a68820 --- /dev/null +++ b/Launcher.cfg @@ -0,0 +1,5 @@ +{ + "Port": 4444, + "Build": "Default", + "CachingDirectory": "./Resources" +} \ No newline at end of file diff --git a/Launcher.log b/Launcher.log new file mode 100644 index 0000000..000008e --- /dev/null +++ b/Launcher.log @@ -0,0 +1,64 @@ +[6/7/2026 21:00:33] [DEBUG] Launcher was invoked as: 'BeamMP-Launcher --no-launch' +[6/7/2026 21:00:33] [INFO] BeamMP Launcher v2.8.0 +[6/7/2026 21:00:39] [INFO] Launcher version is up to date. Latest version: 2.8.0 +[6/7/2026 21:00:39] [INFO] IMPORTANT: You MUST keep this window open to play BeamMP! +[6/7/2026 21:00:39] [DEBUG] HTTP Proxy listening on port 55275 +[6/7/2026 21:00:39] [INFO] Game Version : 0.38.6.0 +[6/7/2026 21:00:39] [INFO] Game user path: /home/chris/.local/share/BeamNG/BeamNG.drive/current/ +[6/7/2026 21:00:42] [DEBUG] Core Network on start! port: 4444 +[6/7/2026 21:00:44] [INFO] Game Connected! +[6/7/2026 21:00:57] [INFO] Attempting to authenticate... +[6/7/2026 21:00:58] [INFO] Authentication successful! +[6/7/2026 21:00:58] [DEBUG] Authentication result: Welcome guest9658030 +[6/7/2026 21:01:15] [INFO] Connecting to server +[6/7/2026 21:01:15] [DEBUG] MAIN LOOP OF GAME SERVER +[6/7/2026 21:01:16] [ERROR] Client: connect failed! Error code: 111 +[6/7/2026 21:01:17] [DEBUG] Terminating TCP Socket: 24 +[6/7/2026 21:01:17] [WARN] Failed to close socket! +[6/7/2026 21:01:17] [DEBUG] Terminating GTCP Socket: 22 +[6/7/2026 21:01:17] [DEBUG] (Proxy) accept failed with error: 22 +[6/7/2026 21:01:17] [DEBUG] Waiting for client thread +[6/7/2026 21:01:17] [DEBUG] Client thread done +[6/7/2026 21:01:17] [DEBUG] END OF GAME SERVER +[6/7/2026 21:01:46] [DEBUG] MAIN LOOP OF GAME SERVER +[6/7/2026 21:01:46] [INFO] Connecting to server +[6/7/2026 21:01:46] [INFO] Connected! +[6/7/2026 21:02:26] [DEBUG] (TCP) Connection closing... CheckBytes(16) +[6/7/2026 21:02:26] [INFO] Terminated! +[6/7/2026 21:02:26] [DEBUG] Mod info: +[6/7/2026 21:02:26] [DEBUG] Failed to receive mod list: [json.exception.parse_error.101] parse error at line 1, column 1: attempting to parse an empty input; check that your input string or stream contains the expected JSON +[6/7/2026 21:02:26] [DEBUG] Failed to receive new mod list format! This server may be outdated, but everything should still work as expected. +[6/7/2026 21:02:26] [ERROR] (Game) send failed with error: 9 +[6/7/2026 21:02:29] [DEBUG] Terminating TCP Socket: 24 +[6/7/2026 21:02:29] [WARN] Failed to close socket! +[6/7/2026 21:02:29] [DEBUG] Terminating GTCP Socket: 22 +[6/7/2026 21:02:29] [DEBUG] (Proxy) accept failed with error: 22 +[6/7/2026 21:02:29] [DEBUG] Waiting for client thread +[6/7/2026 21:02:29] [DEBUG] Client thread done +[6/7/2026 21:02:29] [DEBUG] END OF GAME SERVER +[6/7/2026 21:02:33] [INFO] Connecting to server +[6/7/2026 21:02:33] [DEBUG] MAIN LOOP OF GAME SERVER +[6/7/2026 21:02:33] [ERROR] Client: connect failed! Error code: 111 +[6/7/2026 21:02:35] [DEBUG] Terminating TCP Socket: 24 +[6/7/2026 21:02:35] [WARN] Failed to close socket! +[6/7/2026 21:02:35] [DEBUG] Terminating GTCP Socket: 22 +[6/7/2026 21:02:35] [DEBUG] (Proxy) accept failed with error: 22 +[6/7/2026 21:02:35] [DEBUG] Waiting for client thread +[6/7/2026 21:02:35] [DEBUG] Client thread done +[6/7/2026 21:02:35] [DEBUG] END OF GAME SERVER +[6/7/2026 21:02:41] [INFO] Connecting to server +[6/7/2026 21:02:41] [DEBUG] MAIN LOOP OF GAME SERVER +[6/7/2026 21:02:41] [INFO] Connected! +[6/7/2026 21:03:21] [DEBUG] (TCP) Connection closing... CheckBytes(16) +[6/7/2026 21:03:21] [INFO] Terminated! +[6/7/2026 21:03:21] [DEBUG] Mod info: +[6/7/2026 21:03:21] [DEBUG] Failed to receive mod list: [json.exception.parse_error.101] parse error at line 1, column 1: attempting to parse an empty input; check that your input string or stream contains the expected JSON +[6/7/2026 21:03:21] [DEBUG] Failed to receive new mod list format! This server may be outdated, but everything should still work as expected. +[6/7/2026 21:03:21] [ERROR] (Game) send failed with error: 9 +[6/7/2026 21:03:25] [DEBUG] Terminating TCP Socket: 24 +[6/7/2026 21:03:25] [WARN] Failed to close socket! +[6/7/2026 21:03:25] [DEBUG] Terminating GTCP Socket: 22 +[6/7/2026 21:03:25] [DEBUG] (Proxy) accept failed with error: 22 +[6/7/2026 21:03:25] [DEBUG] Waiting for client thread +[6/7/2026 21:03:25] [DEBUG] Client thread done +[6/7/2026 21:03:25] [DEBUG] END OF GAME SERVER diff --git a/README.md b/README.md new file mode 100644 index 0000000..75199e8 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Simple QT/Qml + Nix dev env + + +- Run `cmake -B build` and `cmake --build build` +- Run `nix build -L` to build +- Add this to helix: +```ini +[language-server.qmlls] +command = "qmlls" +args = ["-E", "-b", "build"] +``` diff --git a/compile_commands.json b/compile_commands.json new file mode 120000 index 0000000..25eb4b2 --- /dev/null +++ b/compile_commands.json @@ -0,0 +1 @@ +build/compile_commands.json \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..b84cc16 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1782723713, + "narHash": "sha256-oPXCU/SSUokcGaJREHibG1CBX3+s/W7orDWQOZDsEeQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b5aa0fbd538984f6e3d201be0005b4463d8b09f8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5c1c2fc --- /dev/null +++ b/flake.nix @@ -0,0 +1,49 @@ + +{ + description = "QT Flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = {self, nixpkgs}: { + defaultPackage.x86_64-linux = let + pkgs = import nixpkgs { system = "x86_64-linux"; }; + in + pkgs.stdenv.mkDerivation { + name = "QT"; + src = builtins.path { path = ./.; filter = path: type: baseNameOf path != "build"; }; + nativeBuildInputs = with pkgs; [ + cmake + qt6.wrapQtAppsHook + ]; + buildInputs = with pkgs; [ + qt6.qtbase + qt6.qtdeclarative + qt6.qtwayland + ]; + }; + + + devShell.x86_64-linux = let + pkgs = import nixpkgs { system = "x86_64-linux"; }; + in + pkgs.mkShell { + buildInputs = with pkgs; [ + cmake + gcc + clang-tools + qt6.qtbase + qt6.qtdeclarative + qt6.qtlanguageserver + qt6.qttools + qt6.qtwayland + # qtcreator + ]; + + shellHook = '' + export QML_IMPORT_PATH="${pkgs.qt6.qtdeclarative}/lib/qml" + ''; + }; + }; +} diff --git a/src/Main.qml b/src/Main.qml new file mode 100644 index 0000000..87014fb --- /dev/null +++ b/src/Main.qml @@ -0,0 +1,16 @@ +import App +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +ApplicationWindow { + id: root + width: 1000; height: 650 + visible: true + title: "Application" + + Label { + text: "Application" + anchors.centerIn: parent + } +} diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..b0deec9 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,20 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + QCoreApplication::setOrganizationName("hexstudios"); + QCoreApplication::setApplicationName("dndtool"); + + QQmlApplicationEngine engine; + QObject::connect( + &engine, &QQmlApplicationEngine::objectCreationFailed, + &app, []() { QCoreApplication::exit(-1); }, + Qt::QueuedConnection); + + engine.loadFromModule("App", "Main"); + + return app.exec(); +}