##// END OF EJS Templates
Adds actions for items in the DataSourceWidget...
Adds actions for items in the DataSourceWidget For each item will be associated actions (generated from the model of the item) that will be displayed in the menu when right clicking on the item in the tree

File last commit:

r112:60eef9a674fc
r142:11579fae1cc2
Show More
VariableModel.cpp
24 lines | 742 B | text/x-c | CppLexer
Alexandre Leroux
Creates the variable model...
r112 #include <Variable/VariableModel.h>
#include <Variable/Variable.h>
Q_LOGGING_CATEGORY(LOG_VariableModel, "VariableModel")
struct VariableModel::VariableModelPrivate {
/// Variables created in SciQlop
std::vector<std::unique_ptr<Variable> > m_Variables;
};
VariableModel::VariableModel() : impl{spimpl::make_unique_impl<VariableModelPrivate>()}
{
}
Variable *VariableModel::createVariable(const QString &name) noexcept
{
/// @todo For the moment, the other data of the variable is initialized with default values
auto variable
= std::make_unique<Variable>(name, QStringLiteral("unit"), QStringLiteral("mission"));
impl->m_Variables.push_back(std::move(variable));
return impl->m_Variables.back().get();
}