##// END OF EJS Templates
TS fix...
TS fix Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r67:a8a4e48c21af
r86:70d6748a0662
Show More
VariableModel2.h
79 lines | 2.6 KiB | text/x-c | CLexer
Quick variable model copied from existing one...
r21 #ifndef SCIQLOP_VARIABLEMODEL2_H
#define SCIQLOP_VARIABLEMODEL2_H
#include "CoreGlobal.h"
Switched to new TS impl, but quite broken!...
r67 #include <Common/MetaTypes.h>
#include <Common/spimpl.h>
Quick variable model copied from existing one...
r21 #include <Data/DateTimeRange.h>
#include <QAbstractTableModel>
#include <QLoggingCategory>
Switched to new TS impl, but quite broken!...
r67 #include <QUuid>
Quick variable model copied from existing one...
r21
class IDataSeries;
Switched to new TS impl, but quite broken!...
r67 class Variable2;
Quick variable model copied from existing one...
r21 class VariableController2;
Switched to new TS impl, but quite broken!...
r67 enum VariableRoles
{
ProgressRole = Qt::UserRole
};
(•̀ᴗ•́)و ̑̑ Some cleaning, remover previous implementation of VariableController...
r26
Quick variable model copied from existing one...
r21 /**
Switched to new TS impl, but quite broken!...
r67 * @brief The VariableModel class aims to hold the variables that have been
* created in SciQlop
Quick variable model copied from existing one...
r21 */
Switched to new TS impl, but quite broken!...
r67 class SCIQLOP_CORE_EXPORT VariableModel2 : public QAbstractTableModel
{
Q_OBJECT
// read only mirror of VariableController2 content
std::vector<std::shared_ptr<Variable2>> _variables;
Quick variable model copied from existing one...
r21 public:
Switched to new TS impl, but quite broken!...
r67 explicit VariableModel2(QObject* parent = nullptr);
Quick variable model copied from existing one...
r21
Switched to new TS impl, but quite broken!...
r67 // /////////////////////////// //
// QAbstractTableModel methods //
// /////////////////////////// //
Quick variable model copied from existing one...
r21
Switched to new TS impl, but quite broken!...
r67 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;
Quick variable model copied from existing one...
r21
Switched to new TS impl, but quite broken!...
r67 // ///////////////// //
// Drag&Drop methods //
// ///////////////// //
Quick variable model copied from existing one...
r21
Switched to new TS impl, but quite broken!...
r67 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;
const std::vector<std::shared_ptr<Variable2>>& variables() const
{
return _variables;
}
Quick variable model copied from existing one...
r21
signals:
Switched to new TS impl, but quite broken!...
r67 void createVariable(const QVariantHash& productData);
void asyncChangeRange(const std::shared_ptr<Variable2>& variable,
const DateTimeRange& r);
Removed bad dependency between VC and VariableModel, moved mime stuff...
r27 public slots:
Switched to new TS impl, but quite broken!...
r67 /// Slot called when data of a variable has been updated
void variableUpdated(QUuid id) noexcept;
void variableAdded(const std::shared_ptr<Variable2>&);
void variableDeleted(const std::shared_ptr<Variable2>&);
Quick variable model copied from existing one...
r21 };
#endif // SCIQLOP_VARIABLEMODEL2_H