Qt Json Tree Model
Go to file
2024-05-18 09:43:01 -04:00
CMake@dd329a0ff6 Update to CMakeTools with better package_library_headers function 2024-05-18 09:43:01 -04:00
include Give each class a separate header; hide QJsonItem behind include/details folder 2024-05-11 09:29:30 -04:00
.clang-format Add clang-format, clang-tidy; reindent files, increas readability 2024-05-03 22:20:24 -04:00
.clang-tidy Fix reversed return value logic in QJsonModel::load methods 2024-05-05 19:53:08 -04:00
.gitignore Convert to CMake project; add object,static,shared targets. 2024-05-02 19:16:43 -04:00
.gitmodules Replace CMake modules with those from a submodule repository 2024-05-16 21:13:06 -04:00
CMakeLists.txt Update to CMakeTools with better package_library_headers function 2024-05-18 09:43:01 -04:00
LICENSE change license to MIT 2017-01-04 01:13:57 +01:00
QJsonModel.cpp Give each class a separate header; hide QJsonItem behind include/details folder 2024-05-11 09:29:30 -04:00
QJsontreeItem.cpp Give each class a separate header; hide QJsonItem behind include/details folder 2024-05-11 09:29:30 -04:00
QJsonTreeItem.cpp Give each class a separate header; hide QJsonItem behind include/details folder 2024-05-03 23:09:57 -04:00
README.md Update screenshot reference in README.md and update build instructions 2024-05-02 19:50:52 -04:00
screen.png change license to MIT, make code simple, add C++11 feature 2017-01-06 19:53:45 +01:00

QJsonModel

QJsonModel is a JSON tree model class for Qt6/C++17 based on QAbstractItemModel.

QJsonModel was originally written by Sacha Shutz (https://github.com/dridk).

This fork is also released under the MIT License.

QJsonModel

Build Instructions

Build Tools

  • CMake (version 3.21 or higher)
  • C++17-compatible compiler

Building the Project

  1. Clone the repository:

    git clone <URL>
    
  2. Navigate to the project directory:

    cd  elemental-game
    
  3. Configure your build system:

    cmake -B debug -G Unix Makefiles
    # or
    cmake -B debug -G Ninja   # this is faster and more modern
    
  4. Invoke your build system

    cmake --build debug
    

Usage - CMake

You can add this library to your CMake projects using FetchContent() or CPM_AddPackage().

Here's how to do it with CPM_AddPackage:

COMING SOON

Usage - C++

QJsonModel * model = new QJsonModel;
QTreeView * view = new QTreeView;
view->setModel(model);
model->load("example.json")