refs #618, allow to filter my include/exclude

This commit is contained in:
Klaus Basan
2016-03-21 04:14:30 +01:00
parent ec8f9b70b6
commit 7d785b4e3b
7 changed files with 158 additions and 88 deletions

View File

@@ -49,10 +49,14 @@ namespace BlackMisc
//! Mode
enum ModelMode
{
Include,
Exclude
Undefined = 0,
Include = 1 << 0,
Exclude = 1 << 1
};
//! Supposed to be used only in filter operations
Q_DECLARE_FLAGS(ModelModeFilter, ModelMode)
//! Indexes
enum ColumnIndex
{
@@ -201,6 +205,9 @@ namespace BlackMisc
//! Model mode
ModelMode getModelMode() const { return m_modelMode; }
//! Matches given mode?
bool matchesMode(BlackMisc::Simulation::CAircraftModel::ModelModeFilter mode) const;
//! Model mode as string
const QString &getModelModeAsString() const { return modelModeToString(getModelMode()); }
@@ -309,8 +316,11 @@ BLACK_DECLARE_TUPLE_CONVERSION(
attr(o.m_modelType),
attr(o.m_modelMode)
))
Q_DECLARE_METATYPE(BlackMisc::Simulation::CAircraftModel)
Q_DECLARE_METATYPE(BlackMisc::Simulation::CAircraftModel::ModelType)
Q_DECLARE_METATYPE(BlackMisc::Simulation::CAircraftModel::ModelMode)
Q_DECLARE_METATYPE(BlackMisc::Simulation::CAircraftModel::ModelModeFilter)
Q_DECLARE_OPERATORS_FOR_FLAGS(BlackMisc::Simulation::CAircraftModel::ModelModeFilter)
#endif // guard