refs #641, support for IOrderable in specialized views/models

* menu to order objects per drag and drop
* changed model/views to specialized model/views
This commit is contained in:
Klaus Basan
2016-04-23 02:42:36 +02:00
parent bb6eea6c72
commit 7d43af343e
18 changed files with 435 additions and 161 deletions

View File

@@ -58,6 +58,25 @@ namespace BlackGui
QColor m_highlightColor = Qt::green;
};
//! List model for DB objects
template <typename ObjectType, typename ContainerType, typename KeyType, bool UseCompare = false> class COrderableListModelDbObjects :
public CListModelDbObjects<ObjectType, ContainerType, KeyType, UseCompare>
{
public:
//! Destructor
virtual ~COrderableListModelDbObjects() {}
//! \name specialized BlackGui::Models::CListModelDbObjects functions for ordering
//! @{
virtual int update(const ContainerType &container, bool sort) override;
virtual void moveItems(const ContainerType &items, int position) override;
//! @}
protected:
//! Constructor
COrderableListModelDbObjects(const QString &translationContext, QObject *parent = nullptr);
};
} // namespace
} // namespace
#endif // guard