mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user