##// END OF EJS Templates
Creates constructor for ScalarSeries that directly takes vectors...
Creates constructor for ScalarSeries that directly takes vectors It is used in Amda result parser to avoid an extra loop

File last commit:

r368:fc12ad933c3b
r392:cae900f78dff
Show More
VariableModel.h
63 lines | 2.0 KiB | text/x-c | CLexer
Alexandre Leroux
Creates the variable model...
r112 #ifndef SCIQLOP_VARIABLEMODEL_H
#define SCIQLOP_VARIABLEMODEL_H
A variable is now created with its dateTime too....
r228
#include <Data/SqpDateTime.h>
Alexandre Leroux
Creates the variable model...
r112
Alexandre Leroux
Adapts VariableModel to be a QabstractTableModel...
r149 #include <QAbstractTableModel>
Alexandre Leroux
Creates the variable model...
r112 #include <QLoggingCategory>
Alexandre Leroux
Fixes refresh problem in Variable widget
r368 #include <Common/MetaTypes.h>
A variable is now created with its dateTime too....
r228 #include <Common/spimpl.h>
Alexandre Leroux
Creates the variable model...
r112 Q_DECLARE_LOGGING_CATEGORY(LOG_VariableModel)
Alexandre Leroux
Updates VariableModel::createVariable() method...
r165 class IDataSeries;
Alexandre Leroux
Creates the variable model...
r112 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...
r149 class VariableModel : public QAbstractTableModel {
Alexandre Leroux
Creates the variable model...
r112 public:
Alexandre Leroux
Adapts VariableModel to be a QabstractTableModel...
r149 explicit VariableModel(QObject *parent = nullptr);
Alexandre Leroux
Creates the variable model...
r112
/**
* Creates a new variable in the model
* @param name the name of the new variable
A variable is now created with its dateTime too....
r228 * @param dateTime the dateTime of the new variable
Alexandre Leroux
Updates VariableModel::createVariable() method...
r165 * @return the pointer to the new variable
Alexandre Leroux
Creates the variable model...
r112 */
It's now possible to create the variable and ask data to be retreived...
r319 std::shared_ptr<Variable> createVariable(const QString &name,
const SqpDateTime &dateTime) noexcept;
Alexandre Leroux
Creates the variable model...
r112
Alexandre Leroux
Variable deletion (3)...
r332 /**
* 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
r246 std::shared_ptr<Variable> variable(int index) const;
Alexandre Leroux
Adapts VariableModel to be a QabstractTableModel...
r149 // /////////////////////////// //
// 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...
r112 private:
class VariableModelPrivate;
spimpl::unique_impl_ptr<VariableModelPrivate> impl;
Alexandre Leroux
Fixes refresh problem in Variable widget
r368
private slots:
/// Slot called when data of a variable has been updated
void onVariableUpdated() noexcept;
Alexandre Leroux
Creates the variable model...
r112 };
Alexandre Leroux
Fixes refresh problem in Variable widget
r368 // Registers QVector<int> metatype so it can be used in VariableModel::dataChanged() signal
SCIQLOP_REGISTER_META_TYPE(QVECTOR_INT_REGISTRY, QVector<int>)
Alexandre Leroux
Creates the variable model...
r112 #endif // SCIQLOP_VARIABLEMODEL_H