##// END OF EJS Templates
Variable deletion (6)...
Variable deletion (6) Creates the signal that prevents other controllers that a variable will be deleted from the VariableController

File last commit:

r306:ec40cfe998fe
r309:9e8c979f3e91
Show More
VariableModel.h
55 lines | 1.7 KiB | text/x-c | CLexer
Alexandre Leroux
Creates the variable model...
r107 #ifndef SCIQLOP_VARIABLEMODEL_H
#define SCIQLOP_VARIABLEMODEL_H
A variable is now created with its dateTime too....
r212
#include <Data/SqpDateTime.h>
Alexandre Leroux
Creates the variable model...
r107
Alexandre Leroux
Adapts VariableModel to be a QabstractTableModel...
r140 #include <QAbstractTableModel>
Alexandre Leroux
Creates the variable model...
r107 #include <QLoggingCategory>
A variable is now created with its dateTime too....
r212 #include <Common/spimpl.h>
Alexandre Leroux
Creates the variable model...
r107 Q_DECLARE_LOGGING_CATEGORY(LOG_VariableModel)
Alexandre Leroux
Updates VariableModel::createVariable() method...
r153 class IDataSeries;
Alexandre Leroux
Creates the variable model...
r107 class Variable;
/**
* @brief The VariableModel class aims to hold the variables that have been created in SciQlop
*/
Alexandre Leroux
Adapts VariableModel to be a QabstractTableModel...
r140 class VariableModel : public QAbstractTableModel {
Alexandre Leroux
Creates the variable model...
r107 public:
Alexandre Leroux
Adapts VariableModel to be a QabstractTableModel...
r140 explicit VariableModel(QObject *parent = nullptr);
Alexandre Leroux
Creates the variable model...
r107
/**
* Creates a new variable in the model
* @param name the name of the new variable
A variable is now created with its dateTime too....
r212 * @param dateTime the dateTime of the new variable
Alexandre Leroux
Updates VariableModel::createVariable() method...
r153 * @return the pointer to the new variable
Alexandre Leroux
Creates the variable model...
r107 */
It's now possible to create the variable and ask data to be retreived...
r294 std::shared_ptr<Variable> createVariable(const QString &name,
const SqpDateTime &dateTime) noexcept;
Alexandre Leroux
Creates the variable model...
r107
Alexandre Leroux
Variable deletion (3)...
r306 /**
* Deletes a variable from the model, if it exists
* @param variable the variable to delete
*/
void deleteVariable(std::shared_ptr<Variable> variable) noexcept;
Alexandre Leroux
Retrieves the current selected variable when clicking on the variable widget
r229 std::shared_ptr<Variable> variable(int index) const;
Alexandre Leroux
Adapts VariableModel to be a QabstractTableModel...
r140 // /////////////////////////// //
// QAbstractTableModel methods //
// /////////////////////////// //
virtual int columnCount(const QModelIndex &parent = QModelIndex{}) const override;
virtual int rowCount(const QModelIndex &parent = QModelIndex{}) const override;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
Alexandre Leroux
Creates the variable model...
r107 private:
class VariableModelPrivate;
spimpl::unique_impl_ptr<VariableModelPrivate> impl;
};
#endif // SCIQLOP_VARIABLEMODEL_H