Commit ed4b15cc authored by EXT Arnaud Clère's avatar EXT Arnaud Clère

WIP

parent 6d7655c0
......@@ -292,7 +292,7 @@ protected:
virtual bool _bind(const QVariant& r) { QVariant copy(r); return _bind(std::move(copy)); }
virtual void resetItemBind() = 0;
virtual IBind* itemBind() = 0;
virtual IBind* itemBind() = 0;
QByteArray io;
private:
......@@ -329,7 +329,7 @@ private:
: 0;
}
inline bool write(QVariant v) { m->setData(current(), v); return true; }
inline QVariant read() { return m->data(current()); }
inline QVariant read() { return m-> data(current()); } // TODO Handle Undefined ?
QAbstractItemModel* m;
bool rowFirst;
......@@ -356,10 +356,10 @@ public:
QModelWriter(QAbstractItemModel* m, bool rowFirst=true) : QModelBind(m, rowFirst) { resetItemBind(); }
virtual BindMode mode() const noexcept { return BindMode::Write; }
virtual bool _isOk() noexcept { return true; } //!< Write status ignored by default (no need to test intermediate status to choose between _sequence(), etc.
virtual bool _isOk() noexcept { return true; } //!< Write status ignored by default (no need to test intermediate status to choose between _sequence(), etc.
protected:
void resetItemBind() { w = std::move(TItemWriter(&io)); }
IBind* itemBind() { return static_cast<IBind*>(&w); }
IBind* itemBind() { return static_cast<IBind*>(&w) ; }
TItemWriter w;
};
......@@ -374,10 +374,10 @@ public:
QModelReader(QAbstractItemModel* m, bool rowFirst=true) : QModelBind(m, rowFirst) { resetItemBind(); }
virtual BindMode mode() const noexcept { return BindMode::Read; }
virtual bool _isOk() noexcept { return true; } //!< Read status ignored by default (QAbstractItemModel is not sequential)
virtual bool _isOk() noexcept { return true; } //!< Read status ignored by default (QAbstractItemModel is not sequential)
protected:
void resetItemBind() { r = std::move(TItemReader(&io)); }
IBind* itemBind() { return static_cast<IBind*>(&r); }
IBind* itemBind() { return static_cast<IBind*>(&r) ; }
TItemReader r;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment