refs #641, improvements/fixes of orderable lists / models / views

* set sort order automatically to IndexOrder when changing order of items
* call onChanged when model is changed and then update view (needed when model is changed directly, not via view)
* support for digest signal so redundant updates can be avoided
* renamed rowCountChanged (signal) to modelDataChanged - detecting row count changes only was useless
* updated Doxygen / fixed typos
This commit is contained in:
Klaus Basan
2016-05-05 12:24:22 +02:00
parent 2da14e3b62
commit 1a62de8dc3
21 changed files with 175 additions and 62 deletions

View File

@@ -228,8 +228,8 @@ namespace BlackGui
//! Asynchronous update finished
void asyncUpdateFinished();
//! Number of elements changed
void rowCountChanged(int count, bool withFilter);
//! Model data changed
void modelDataChanged(int count, bool withFilter);
//! Model bas been changed (means data in view have been changed)
void modelChanged();
@@ -270,6 +270,9 @@ namespace BlackGui
//! \param processEvents force event processing to display indicator by updating GUI
void showLoadIndicator(int containerSizeDependent = -1, bool processEvents = true);
//! Underlying model changed
void onModelChanged();
//! Hide loading indicator
void hideLoadIndicator();
@@ -324,6 +327,9 @@ namespace BlackGui
//! Init menu actions
BlackGui::Menus::CMenuActions initMenuActions(MenuFlag menu);
//! Set the sort indicator to the current sort column
virtual void updateSortIndicator() = 0;
QString m_saveFileName; //!< save file name (JSON)
ResizeMode m_resizeMode = PresizeSubset; //!< mode
RowsResizeMode m_rowResizeMode = Interactive; //!< row resize mode for row height
@@ -533,7 +539,7 @@ namespace BlackGui
//! Add the object and container type as accepted drop types CDropBase::addAcceptedMetaTypeId
void addContainerTypesAsDropTypes(bool objectType = true, bool containerType = true);
//! Init so items can be ordered
//! Init so items can be ordered, includes enabling drag and drop
void initAsOrderable();
//! Drop actions
@@ -556,6 +562,7 @@ namespace BlackGui
virtual bool reachedResizeThreshold(int containrerSize = -1) const override;
virtual void performModeBasedResizeToContent() override;
virtual int performUpdateContainer(const BlackMisc::CVariant &variant, bool sort, bool resize) override;
virtual void updateSortIndicator() override;
//! @}
//! Modify JSON data loaded in BlackGui::Views::CViewBaseNonTemplate::ps_loadJson