##// END OF EJS Templates
Variable update signal forwards variable ID...
Variable update signal forwards variable ID Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r32:6b6270b07547
r32:6b6270b07547
Show More
VariableModel2.h
68 lines | 2.5 KiB | text/x-c | CLexer
Quick variable model copied from existing one...
r21 #ifndef SCIQLOP_VARIABLEMODEL2_H
#define SCIQLOP_VARIABLEMODEL2_H
#include "CoreGlobal.h"
#include <Data/DateTimeRange.h>
#include <QAbstractTableModel>
#include <QLoggingCategory>
#include <Common/MetaTypes.h>
#include <Common/spimpl.h>
class IDataSeries;
class Variable;
class VariableController2;
(•̀ᴗ•́)و ̑̑ Some cleaning, remover previous implementation of VariableController...
r26 enum VariableRoles { ProgressRole = Qt::UserRole };
Quick variable model copied from existing one...
r21 /**
* @brief The VariableModel class aims to hold the variables that have been created in SciQlop
*/
class SCIQLOP_CORE_EXPORT VariableModel2 : public QAbstractTableModel {
Q_OBJECT
Removed bad dependency between VC and VariableModel, moved mime stuff...
r27 // read only mirror of VariableController2 content
std::vector<std::shared_ptr<Variable>> _variables;
Quick variable model copied from existing one...
r21 public:
Removed bad dependency between VC and VariableModel, moved mime stuff...
r27 explicit VariableModel2(QObject *parent = nullptr);
Quick variable model copied from existing one...
r21
// /////////////////////////// //
// 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;
virtual Qt::ItemFlags flags(const QModelIndex &index) const override;
// ///////////////// //
// Drag&Drop methods //
// ///////////////// //
virtual Qt::DropActions supportedDropActions() const override;
virtual Qt::DropActions supportedDragActions() const override;
virtual QStringList mimeTypes() const override;
virtual QMimeData *mimeData(const QModelIndexList &indexes) const override;
virtual bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column,
const QModelIndex &parent) const override;
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column,
const QModelIndex &parent) override;
Fixed tests due to async var creation, plus minor stuff...
r30 const std::vector<std::shared_ptr<Variable>>& variables() const
{return _variables;}
Quick variable model copied from existing one...
r21
signals:
Removed bad dependency between VC and VariableModel, moved mime stuff...
r27 void createVariable(const QVariantHash &productData);
void asyncChangeRange(const std::shared_ptr<Variable>& variable, const DateTimeRange& r);
public slots:
Quick variable model copied from existing one...
r21 /// Slot called when data of a variable has been updated
Variable update signal forwards variable ID...
r32 void variableUpdated(QUuid id) noexcept;
Removed bad dependency between VC and VariableModel, moved mime stuff...
r27 void variableAdded(const std::shared_ptr<Variable>&);
void variableDeleted(const std::shared_ptr<Variable>&);
Quick variable model copied from existing one...
r21 };
#endif // SCIQLOP_VARIABLEMODEL2_H