Skip to content

Commit

Permalink
Update Readme to include KF6 Kirigami
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquetc committed Mar 10, 2024
1 parent 15d3783 commit ee334a8
Showing 1 changed file with 32 additions and 13 deletions.
45 changes: 32 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* [Using Qleany](#using-qleany)
+ [For QtWidgets GUI](#for-qtwidgets-gui)
+ [For QtQuick GUI](#for-qtquick-gui)
+ [For KF6 Kirigami GUI](#for-kf6-kirigami-gui)
+ [For multiple Uis](#for-multiple-uis)
+ [Integration with Qt Design Studio projects](#integration-with-qt-design-studio-projects)
+ [Other Fronts](#other-fronts)
Expand Down Expand Up @@ -103,7 +104,7 @@ Libraries and their respective functionalities are organized as follows:

- **Presenter**: Maintains Qt models and representations of unique entities (referred to as `Singles`), enhancing their integration and usage within the GUI.

- **UI**: The structure allows the simultaneous use of different fronts, each in its own binary. QML and QWidgets UIs can coexist without any conflict. Same for a CLI, an API ... All these fronts will use the same models and interactors. You can have a single main.cpp file for all fronts, or one for each front. It's up to you. Qleany will only generate one for each front.
- **UI**: The structure allows the simultaneous use of different fronts, each in its own binary. QML and QWidgets UIs can coexist without any conflict. Same for a CLI, an API ... All these fronts will use the same models and interactors. You can have a single main.cpp file for all fronts, or one for each front. It's up to you. Qleany will only generate one for each front.

Another related point:

Expand Down Expand Up @@ -190,6 +191,12 @@ If you already have a QtQuick GUI, you can craete a blank GUI in a sub-folder ne

A GUI made with QML will **not** use `interactor` and `presenter`. Wrappers around models, Q_SIGNALS, commands and queries all are generated in the QML `real_imports` folder in the QML folder to be made available from QML. Also, QML mocks are generated in `mock_imports`, to be filled by the developer. Refer to the example for guidance at `examples/front_ends/src/gui/qt_quick_application/main.cpp` and `examples/front_ends/src/gui/qt_quick__application/CMakelists.txt`

### For KF6 Kirigami GUI

A KF6 Kirigami GUI can be generated by Qleany, inspired from the Kirigami template from KDevelop. You only have to fill `front_ends` in the `qleany.yaml` file. Read "Front end Configuration" section below for more details.

Also, mocks are generated in `mock_imports`, to be fine-tuned by the developer. Use the `BUILD_WITH_MOCKS` cmake definition to include the mocks in the build.

### For multiple Uis

Multiple Uis is considered as a rare use case. This merge of multiple Uis is not perfect. In some cases, you may have to rename some files to avoid conflicts.
Expand Down Expand Up @@ -247,17 +254,17 @@ You can add custom commands and queries for each feature in the `application.fea
When you take into account the classes offered by the Qleany library, `persistence` iis actually composed by a `repository` part and a `database`part, respectively situated in the "Interface Adapters" layer and in the "Frameworks & Drivers" layer of the Clean Architecture circle diagram.

`database` classes are represented by `InterfaceDatabaseTableGroup` and `InterfaceDatabaseContext` interfaces. If the SQLite database management classes provided by Qleany are not enough for your needs, you can implement your own classes and swap the provided ones with yours.

### Quick rules and troubleshooting

- To allow smooth generation of a list model or single, allow generation of the entire CRUD of the targeted entity in its own feature. If the list is "in_relation_of" another entity, apply this rule to this other entity too.
- For read-only single and list models, only "get" and "get_all" CRUD functions are needed.
- In a feature, don't mix entities in DTO's entity_mappable_with and CRUD's entity_mappable_with.
- Respect the case for names. It's very often in pascal case. Ex: PascalCase. Only field names are in camel case ( camelCase ).
- Use "qleany check" deliberately

And lastly, if you think that there is a strange behavior, you only have to create an issue and join the qleany.yaml


### Quick rules and troubleshooting

- To allow smooth generation of a list model or single, allow generation of the entire CRUD of the targeted entity in its own feature. If the list is "in_relation_of" another entity, apply this rule to this other entity too.
- For read-only single and list models, only "get" and "get_all" CRUD functions are needed.
- In a feature, don't mix entities in DTO's entity_mappable_with and CRUD's entity_mappable_with.
- Respect the case for names. It's very often in pascal case. Ex: PascalCase. Only field names are in camel case ( camelCase ).
- Use "qleany check" deliberately

And lastly, if you think that there is a strange behavior, you only have to create an issue and join the qleany.yaml


## Qleany GUI

Expand Down Expand Up @@ -492,6 +499,8 @@ front_ends:
folder_path: path/to/qt_widgets_application_folder
qt_quick:
folder_path: path/to/qt_quick_application_folder
kf6_kirigami:
folder_path: path/to/kf6_kirigami_application_folder
qml_imports_integration:
folder_path: path/to/qml_imports_integration_folder
```
Expand All @@ -500,4 +509,14 @@ front_ends:

### Example Projects

Be careful while generating CMakeLists.txt files for example projects. Since the examples are built at the same time than the library, you will have to comment out the `find_package(qleany CONFIG REQUIRED)` in each CMakeLists.txt file of the examples.
Be careful while generating CMakeLists.txt files for example projects. Since the examples are built at the same time than the library, you will have to comment out the `find_package(qleany CONFIG REQUIRED)` in each CMakeLists.txt file of the examples.

### Qleany generator

#### Another way to install and run it

You can also install the Qleany generator using poetry. You can use the following commands to install and run the Qleany generator:
`poetry install` to install the dependencies.
`poetry run qleany` to run the Qleany GUI.

On VS Code, with the Python extension, you can right click on "tool/qleany/generator/qleany_generator_gui.py" and select "Run Python File in Terminal" to run the Qleany GUI.

0 comments on commit ee334a8

Please sign in to comment.