|
Schim
|
A model that manages open projects. More...
#include <projectmanager.h>
Public Member Functions | |
| QModelIndex | getIndex (Entity *entity) const |
Get the model index of the project or sheet that entity points to. | |
| bool | isEmpty () const |
| Return true if no projects are open, false otherwise. | |
| void | setActiveProject (Project *project) |
| Set the active project. This will notify all views that the new active project and the previous active project have changed. | |
| void | addProject (Project *project) |
| Add a project to the manager. More... | |
| void | addSheet (Sheet *sheet, int index=-1, Project *project=nullptr) |
Add a new sheet to project and register it in the manager. More... | |
| void | removeProject (Project *project) |
Remove project from the manager and destroy it. More... | |
| void | removeSheet (Sheet *sheet) |
Remove sheet from the manager and from its project. More... | |
| QVariant | data (const QModelIndex &index, int role) const override |
| Get the model data. | |
A model that manages open projects.
The model is a tree with a depth of 2. The top level contains a list of open projects and the lower level contains all the sheets that exist in a given project. One project can be set as the active project. Only sheets in the active project can be opened for editing.
| void ProjectManager::addProject | ( | Project * | project | ) |
Add a project to the manager.
The project manager takes ownership of project. Any views will be notified that a model row was inserted.
project matches the file name of another open project, nothing will be done. Add a new sheet to project and register it in the manager.
The project takes ownership of the sheet. Any views will be notified that a model row was inserted.
| index | The index of sheet in the project. |
| project | The proj |
| void ProjectManager::removeProject | ( | Project * | project | ) |
Remove project from the manager and destroy it.
Any views will be notified that a model row was removed. If project was the active project, it will be deactivated.
| void ProjectManager::removeSheet | ( | Sheet * | sheet | ) |
Remove sheet from the manager and from its project.
Any views will be notified that a model row was removed.
1.8.13