refs #535, updated viewbase and formatters

* Fixed wrong masking
* changed signal for model
* update selected models
* directly set object in model
This commit is contained in:
Klaus Basan
2015-12-13 19:31:52 +01:00
parent 431117e83b
commit ecb4694c7f
5 changed files with 119 additions and 8 deletions

View File

@@ -96,6 +96,10 @@ namespace BlackGui
//! Model about to be destroyed?
bool isModelDestroyed();
//! Send signal that data have been changed.
//! \note Meant for scenarios where the container is directly updated and a subsequent signal is required
void sendDataChanged(int startRowIndex, int endRowIndex);
signals:
//! Asynchronous update finished
void asyncUpdateFinished();
@@ -103,6 +107,9 @@ namespace BlackGui
//! Number of elements changed
void rowCountChanged(int count, bool withFilter);
//! Model has been changed
void changed();
//! Template free information, that object changed
void objectChanged(const BlackMisc::CVariant &object, const BlackMisc::CPropertyIndex &changedIndex);
@@ -147,6 +154,10 @@ namespace BlackGui
//! \sa CListModelBaseNonTemplate::flags
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
//! Simple set of data in container, using class is responsible for firing signals etc.
//! \sa sendDataChanged
bool setInContainer(const QModelIndex &index, const ObjectType &obj);
//! \copydoc QStandardItemModel::rowCount()
virtual int rowCount(const QModelIndex &parentIndex = QModelIndex()) const override;