QJsonModel/README.md

57 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2017-01-06 18:58:46 +00:00
# QJsonModel
QJsonModel is a JSON tree model class for Qt6/C++17 based on QAbstractItemModel.
2015-01-23 20:59:46 +00:00
QJsonModel was originally written by Sacha Shutz (https://github.com/dridk).
2015-01-23 21:04:42 +00:00
This fork is also released under the MIT License.
2015-01-23 21:04:42 +00:00
2015-01-23 20:59:46 +00:00
![QJsonModel](https://gitea.beniquez.me/sdaveb/QJsonModel/raw/branch/master/screen.png)
2018-05-06 07:21:02 +00:00
## Build Instructions
2018-05-06 07:21:02 +00:00
### Build Tools
- CMake (version 3.21 or higher)
- C++17-compatible compiler
2018-05-06 07:21:02 +00:00
### Building the Project
1. Clone the repository:
```
git clone <URL>
```
2. Navigate to the project directory:
```
cd elemental-game
```
3. Configure your build system:
```bash
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
2018-05-06 07:21:02 +00:00
You can add this library to your CMake projects using FetchContent()
or CPM_AddPackage().
2018-05-06 07:21:02 +00:00
Here's how to do it with CPM_AddPackage:
```
COMING SOON
```
### Usage - C++
####
```cpp
QJsonModel * model = new QJsonModel;
QTreeView * view = new QTreeView;
view->setModel(model);
model->load("example.json")
```