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

@@ -25,7 +25,7 @@ namespace BlackGui
{
//! Aircraft model list model
class BLACKGUI_EXPORT CAircraftModelListModel :
public CListModelDbObjects<BlackMisc::Simulation::CAircraftModel, BlackMisc::Simulation::CAircraftModelList, int, true>
public COrderableListModelDbObjects<BlackMisc::Simulation::CAircraftModel, BlackMisc::Simulation::CAircraftModelList, int, true>
{
public:
//! How to display
@@ -34,6 +34,7 @@ namespace BlackGui
{
NotSet,
OwnSimulatorModel, //!< models existing for my simulator
OwnModelSet, //!< own model set
OwnSimulatorModelMapping, //!< models of my simulator, but in mapping mode
Database, //!< Database entry
VPilotRuleModel, //!< vPilot rule turned into model
@@ -73,11 +74,14 @@ namespace BlackGui
//! \copydoc QAbstractItemModel::data
virtual QVariant data(const QModelIndex &index, int role) const override;
//! \copydoc BlackGui::Models::CListModelBaseNonTemplate::isOrderable
virtual bool isOrderable() const override { return true; }
private:
AircraftModelMode m_mode = NotSet; //!< current mode
bool m_highlightModelStrings = false; //!< highlight in in model strings
QStringList m_highlightStrings; //!< model strings to highlight
QBrush m_highlightColor{Qt::yellow}; //!< how to highlight
AircraftModelMode m_mode = NotSet; //!< current mode
bool m_highlightModelStrings = false; //!< highlight in in model strings
QStringList m_highlightStrings; //!< model strings to highlight
QBrush m_highlightColor{Qt::yellow}; //!< how to highlight
};
} // ns
} // ns