This commit is contained in:
2026-07-07 12:44:31 -05:00
commit 8069dfcdc2
10 changed files with 229 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
build/
result

34
CMakeLists.txt Normal file
View File

@@ -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})

5
Launcher.cfg Normal file
View File

@@ -0,0 +1,5 @@
{
"Port": 4444,
"Build": "Default",
"CachingDirectory": "./Resources"
}

64
Launcher.log Normal file
View File

@@ -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

11
README.md Normal file
View File

@@ -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"]
```

1
compile_commands.json Symbolic link
View File

@@ -0,0 +1 @@
build/compile_commands.json

27
flake.lock generated Normal file
View File

@@ -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
}

49
flake.nix Normal file
View File

@@ -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"
'';
};
};
}

16
src/Main.qml Normal file
View File

@@ -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
}
}

20
src/main.cpp Normal file
View File

@@ -0,0 +1,20 @@
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <qcoreapplication.h>
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();
}