mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 13:35: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:
@@ -51,6 +51,37 @@ namespace BlackGui
|
||||
//! \copydoc BlackGui::Views::CViewBase::ps_toggleHighlightDbData
|
||||
virtual void ps_toggleHighlightDbData() override;
|
||||
};
|
||||
|
||||
//! Base class for views with DB objects
|
||||
template <class ModelClass, class ContainerType, class ObjectType, class KeyType> class COrderableViewWithDbObjects :
|
||||
public CViewWithDbObjects<ModelClass, ContainerType, ObjectType, KeyType>
|
||||
{
|
||||
protected:
|
||||
//! Constructor
|
||||
explicit COrderableViewWithDbObjects(QWidget *parent = nullptr);
|
||||
|
||||
//! \copydoc BlackGui::Views::CViewBaseNonTemplate::customMenu
|
||||
virtual void customMenu(QMenu &menu) const override;
|
||||
|
||||
//! Move selected items
|
||||
void moveSelectedItems(int order);
|
||||
|
||||
protected slots:
|
||||
//! Order to top
|
||||
void ps_orderToTop();
|
||||
|
||||
//! Order to bottom
|
||||
void ps_orderToBottom();
|
||||
|
||||
//! Order to line edit
|
||||
void ps_orderToLineEdit();
|
||||
|
||||
//! Current order set as order
|
||||
void ps_freezeCurrentOrder();
|
||||
|
||||
private:
|
||||
QList<QAction *> m_menuActions;
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user