Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

C++ implementation of the x0 JavaScript framework using nlohmann::json for configuration management and Qt for graphical rendering.

Architecture

Maps 1:1 to JavaScript classes in /www/:

JavaScript C++ Purpose
sysBaseDOMElement.js x0BaseElement Qt widget wrapper
sysBaseObject.js x0BaseObject Hierarchical object model
sysFactory.js x0Factory Singleton factory + screen management
sysScreen.js x0Screen View container
sysReactor.js x0Reactor Event dispatch
sysObjDiv.js x0ObjDiv Container (QFrame)
sysObjButton.js x0ObjButton Button (QPushButton)

Files Added

  • cpp/CMakeLists.txt - Build config with Qt5/Qt6 support, auto-fetches nlohmann::json
  • cpp/include/*.h - Core headers
  • cpp/src/*.cpp - Implementations
  • cpp/test/test_examples.cpp - Test validating all /example configurations
  • cpp/README.md - Usage and extension guide

Usage

#include "x0Factory.h"

x0Factory& factory = x0Factory::instance();
factory.setDataSkeleton(skeletonJson);
factory.setDataObject(objectsJson);
factory.init();

// Access objects
x0BaseObject* btn = factory.getObjectById("MyButton");

Same JSON config format as JavaScript version:

{
    "ActionButton": {
        "Type": "Button",
        "Attributes": {
            "Style": "btn btn-primary",
            "TextID": "BTN.SUBMIT",
            "OnClick": "/api/submit"
        }
    }
}

Building

cd cpp && mkdir build && cd build
cmake .. && make

Testing

A test (cpp/test/test_examples.cpp) validates that the C++ framework correctly parses all 15 example configurations from /example:

Total examples tested: 15
Passed: 15
Failed: 0

Validated examples: add_object_table_column, basic_menu_screen, basic_tabcontainer, bootstrap_rowspan, copy_paste, enhanced_form, list_detail_switch_screen, list_dyn_radio, list_objectdata_grid, multi_tabcontainer, net_messages, object_instances, open_close_container, screen_overlay, tree_simple

Original prompt

According to the /www/ JavaScript version of the framework (base code), add a c++ variant of the code using nlohmann::json for object relations / configuration management and qt as screen rendering / graphical realtime output.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@clauspruefer clauspruefer added the experimental Experimental label Jan 5, 2026
Copilot AI and others added 4 commits January 5, 2026 16:03
Co-authored-by: clauspruefer <17313789+clauspruefer@users.noreply.github.com>
…andling

Co-authored-by: clauspruefer <17313789+clauspruefer@users.noreply.github.com>
Co-authored-by: clauspruefer <17313789+clauspruefer@users.noreply.github.com>
Co-authored-by: clauspruefer <17313789+clauspruefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add C++ variant with nlohmann::json and Qt rendering Add C++ variant of x0 framework with Qt and nlohmann::json Jan 5, 2026
Copy link
Member

@clauspruefer clauspruefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Take all examples found in /example to verify that this PR / code works correctly.

Co-authored-by: clauspruefer <17313789+clauspruefer@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 14, 2026

@copilot Take all examples found in /example to verify that this PR / code works correctly.

Added a test (cpp/test/test_examples.cpp) that validates all 15 examples from /example directory. The test parses and validates all skeleton.json, object.json, and menu.json files to ensure the C++ framework's JSON handling works correctly with the existing configurations.

Test results (commit 8725a0a):

Total examples tested: 15
Passed: 15
Failed: 0

All examples validated successfully:

  • add_object_table_column
  • basic_menu_screen
  • basic_tabcontainer
  • bootstrap_rowspan
  • copy_paste
  • enhanced_form
  • list_detail_switch_screen
  • list_dyn_radio
  • list_objectdata_grid
  • multi_tabcontainer
  • net_messages
  • object_instances
  • open_close_container
  • screen_overlay
  • tree_simple

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Co-authored-by: clauspruefer <17313789+clauspruefer@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experimental Experimental

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants