| 24 | #include <QJsonArray> |
| 25 | |
| 26 | Project::Project(const QList<SolverConfiguration*>& configs, QObject* parent) : QObject(parent), solverConfigs(configs) |
| 27 | { |
| 28 | itemModel = new QStandardItemModel(this); |
| 29 | itemModel->setColumnCount(1); |
| 30 | |
| 31 | connect(itemModel, &QStandardItemModel::itemChanged, this, &Project::on_itemChanged); |
| 32 | |
| 33 | rootItem = new QStandardItem(QIcon(":/images/mznicon.png"), "Untitled Project"); |
| 34 | rootItem->setData(NodeType::ProjectFile, Role::Type); |
| 35 | rootItem->setData("Untitled Project", Role::OriginalLabel); |
| 36 | rootItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable); |
| 37 | |
| 38 | auto font = rootItem->font(); |
| 39 | font.setBold(true); |
| 40 | |
| 41 | modelsItem = new QStandardItem("Models"); |
| 42 | modelsItem->setData(NodeType::Group, Role::Type); |
| 43 | modelsItem->setFlags(Qt::NoItemFlags); |
| 44 | modelsItem->setFont(font); |
| 45 | |
| 46 | dataItem = new QStandardItem("Data (right click to run)"); |
| 47 | dataItem->setData(NodeType::Group, Role::Type); |
| 48 | dataItem->setFlags(Qt::NoItemFlags); |
| 49 | dataItem->setFont(font); |
| 50 | |
| 51 | checkersItem = new QStandardItem("Checkers (right click to run)"); |
| 52 | checkersItem->setData(NodeType::Group, Role::Type); |
| 53 | checkersItem->setFlags(Qt::NoItemFlags); |
| 54 | checkersItem->setFont(font); |
| 55 | |
| 56 | configsItem = new QStandardItem("Solver configurations"); |
| 57 | configsItem->setData(NodeType::Group, Role::Type); |
| 58 | configsItem->setFlags(Qt::NoItemFlags); |
| 59 | configsItem->setFont(font); |
| 60 | |
| 61 | otherItem = new QStandardItem("Other files"); |
| 62 | otherItem->setData(NodeType::Group, Role::Type); |
| 63 | otherItem->setFlags(Qt::NoItemFlags); |
| 64 | otherItem->setFont(font); |
| 65 | |
| 66 | rootItem->appendRow(modelsItem); |
| 67 | rootItem->appendRow(dataItem); |
| 68 | rootItem->appendRow(checkersItem); |
| 69 | rootItem->appendRow(configsItem); |
| 70 | rootItem->appendRow(otherItem); |
| 71 | itemModel->appendRow(rootItem); |
| 72 | } |
| 73 | |
| 74 | QStringList Project::loadProject(const QString& file, ConfigWindow* configWindow) |
| 75 | { |
nothing calls this directly
no outgoing calls
no test coverage detected