refs #641, improvements/fixes of orderable lists / models / views

* set sort order automatically to IndexOrder when changing order of items
* call onChanged when model is changed and then update view (needed when model is changed directly, not via view)
* support for digest signal so redundant updates can be avoided
* renamed rowCountChanged (signal) to modelDataChanged - detecting row count changes only was useless
* updated Doxygen / fixed typos
This commit is contained in:
Klaus Basan
2016-05-05 12:24:22 +02:00
parent 2da14e3b62
commit 1a62de8dc3
21 changed files with 175 additions and 62 deletions

View File

@@ -40,10 +40,10 @@ namespace BlackGui
this->ui->tvp_AircraftInRange->setAircraftMode(CSimulatedAircraftListModel::InfoMode); this->ui->tvp_AircraftInRange->setAircraftMode(CSimulatedAircraftListModel::InfoMode);
this->ui->tvp_AircraftInRange->configureMenu(true, false, false); this->ui->tvp_AircraftInRange->configureMenu(true, false, false);
connect(this->ui->tvp_AircraftInRange, &CSimulatedAircraftView::rowCountChanged, this, &CAircraftComponent::ps_onRowCountChanged); connect(this->ui->tvp_AircraftInRange, &CSimulatedAircraftView::modelDataChanged, this, &CAircraftComponent::ps_onRowCountChanged);
connect(this->ui->tvp_AircraftInRange, &CSimulatedAircraftView::requestTextMessageWidget, this, &CAircraftComponent::requestTextMessageWidget); connect(this->ui->tvp_AircraftInRange, &CSimulatedAircraftView::requestTextMessageWidget, this, &CAircraftComponent::requestTextMessageWidget);
connect(this->ui->tvp_AircraftInRange, &CSimulatedAircraftView::requestHighlightInSimulator, this, &CAircraftComponent::ps_onMenuHighlightInSimulator); connect(this->ui->tvp_AircraftInRange, &CSimulatedAircraftView::requestHighlightInSimulator, this, &CAircraftComponent::ps_onMenuHighlightInSimulator);
connect(this->ui->tvp_AirportsInRange, &CSimulatedAircraftView::rowCountChanged, this, &CAircraftComponent::ps_onRowCountChanged); connect(this->ui->tvp_AirportsInRange, &CSimulatedAircraftView::modelDataChanged, this, &CAircraftComponent::ps_onRowCountChanged);
connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CAircraftComponent::ps_connectionStatusChanged); connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CAircraftComponent::ps_connectionStatusChanged);
} }

View File

@@ -61,14 +61,14 @@ namespace BlackGui
connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::testRequestDummyAtcOnlineStations, this, &CAtcStationComponent::ps_testCreateDummyOnlineAtcStations); connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::testRequestDummyAtcOnlineStations, this, &CAtcStationComponent::ps_testCreateDummyOnlineAtcStations);
connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::requestUpdate, this, &CAtcStationComponent::ps_requestOnlineStationsUpdate); connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::requestUpdate, this, &CAtcStationComponent::ps_requestOnlineStationsUpdate);
connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::requestNewBackendData, this, &CAtcStationComponent::ps_requestOnlineStationsUpdate); connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::requestNewBackendData, this, &CAtcStationComponent::ps_requestOnlineStationsUpdate);
connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::rowCountChanged, this, &CAtcStationComponent::ps_onCountChanged); connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::modelDataChanged, this, &CAtcStationComponent::ps_onCountChanged);
connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::rowCountChanged, this, &CAtcStationComponent::ps_onCountChanged); connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::modelDataChanged, this, &CAtcStationComponent::ps_onCountChanged);
connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::requestComFrequency, this, &CAtcStationComponent::ps_setComFrequency); connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::requestComFrequency, this, &CAtcStationComponent::ps_setComFrequency);
connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::requestTextMessageWidget, this, &CAtcStationComponent::requestTextMessageWidget); connect(this->ui->tvp_AtcStationsOnline, &CAtcStationView::requestTextMessageWidget, this, &CAtcStationComponent::requestTextMessageWidget);
connect(this->ui->tvp_AtcStationsBooked, &CAtcStationView::requestUpdate, this, &CAtcStationComponent::ps_reloadAtcStationsBooked); connect(this->ui->tvp_AtcStationsBooked, &CAtcStationView::requestUpdate, this, &CAtcStationComponent::ps_reloadAtcStationsBooked);
connect(this->ui->tvp_AtcStationsBooked, &CAtcStationView::requestNewBackendData, this, &CAtcStationComponent::ps_reloadAtcStationsBooked); connect(this->ui->tvp_AtcStationsBooked, &CAtcStationView::requestNewBackendData, this, &CAtcStationComponent::ps_reloadAtcStationsBooked);
connect(this->ui->tvp_AtcStationsBooked, &CAtcStationView::rowCountChanged, this, &CAtcStationComponent::ps_onCountChanged); connect(this->ui->tvp_AtcStationsBooked, &CAtcStationView::modelDataChanged, this, &CAtcStationComponent::ps_onCountChanged);
connect(this->ui->pb_AtcStationsAtisReload, &QPushButton::clicked, this, &CAtcStationComponent::ps_requestAtis); connect(this->ui->pb_AtcStationsAtisReload, &QPushButton::clicked, this, &CAtcStationComponent::ps_requestAtis);

View File

@@ -68,17 +68,17 @@ namespace BlackGui
connect(ui->editor_Model, &CModelMappingForm::requestStash, this, &CDbMappingComponent::ps_stashCurrentModel); connect(ui->editor_Model, &CModelMappingForm::requestStash, this, &CDbMappingComponent::ps_stashCurrentModel);
connect(ui->comp_OwnAircraftModels->view(), &CAircraftModelView::doubleClicked, this, &CDbMappingComponent::ps_onModelRowSelected); connect(ui->comp_OwnAircraftModels->view(), &CAircraftModelView::doubleClicked, this, &CDbMappingComponent::ps_onModelRowSelected);
connect(ui->comp_OwnAircraftModels->view(), &CAircraftModelView::rowCountChanged, this, &CDbMappingComponent::ps_onOwnModelsCountChanged); connect(ui->comp_OwnAircraftModels->view(), &CAircraftModelView::modelDataChanged, this, &CDbMappingComponent::ps_onOwnModelsCountChanged);
connect(ui->comp_OwnAircraftModels->view(), &CAircraftModelView::requestStash, this, &CDbMappingComponent::stashSelectedModels); connect(ui->comp_OwnAircraftModels->view(), &CAircraftModelView::requestStash, this, &CDbMappingComponent::stashSelectedModels);
connect(ui->comp_OwnAircraftModels->view(), &CAircraftModelView::toggledHighlightStashedModels, this, &CDbMappingComponent::ps_onStashedModelsChanged); connect(ui->comp_OwnAircraftModels->view(), &CAircraftModelView::toggledHighlightStashedModels, this, &CDbMappingComponent::ps_onStashedModelsChanged);
connect(ui->comp_StashAircraft->view(), &CAircraftModelView::rowCountChanged, this, &CDbMappingComponent::ps_onStashCountChanged); connect(ui->comp_StashAircraft->view(), &CAircraftModelView::modelDataChanged, this, &CDbMappingComponent::ps_onStashCountChanged);
connect(ui->comp_StashAircraft->view(), &CAircraftModelView::doubleClicked, this, &CDbMappingComponent::ps_onModelRowSelected); connect(ui->comp_StashAircraft->view(), &CAircraftModelView::doubleClicked, this, &CDbMappingComponent::ps_onModelRowSelected);
connect(ui->comp_StashAircraft->view(), &CAircraftModelView::requestHandlingOfStashDrop, this, &CDbMappingComponent::ps_handleStashDropRequest); connect(ui->comp_StashAircraft->view(), &CAircraftModelView::requestHandlingOfStashDrop, this, &CDbMappingComponent::ps_handleStashDropRequest);
connect(ui->comp_StashAircraft, &CDbStashComponent::stashedModelsChanged, this, &CDbMappingComponent::ps_onStashedModelsChanged); connect(ui->comp_StashAircraft, &CDbStashComponent::stashedModelsChanged, this, &CDbMappingComponent::ps_onStashedModelsChanged);
connect(ui->comp_StashAircraft, &CDbStashComponent::modelsSuccessfullyPublished, this, &CDbMappingComponent::ps_onModelsSuccessfullyPublished); connect(ui->comp_StashAircraft, &CDbStashComponent::modelsSuccessfullyPublished, this, &CDbMappingComponent::ps_onModelsSuccessfullyPublished);
connect(ui->comp_OwnModelSet->view(), &CAircraftModelView::rowCountChanged, this, &CDbMappingComponent::ps_onModelSetCountChanged); connect(ui->comp_OwnModelSet->view(), &CAircraftModelView::modelDataChanged, this, &CDbMappingComponent::ps_onModelSetCountChanged);
connect(ui->tw_ModelsToBeMapped, &QTabWidget::currentChanged, this, &CDbMappingComponent::ps_tabIndexChanged); connect(ui->tw_ModelsToBeMapped, &QTabWidget::currentChanged, this, &CDbMappingComponent::ps_tabIndexChanged);
connect(ui->tw_ModelsToBeMapped, &QTabWidget::currentChanged, ui->comp_ModelMatcher , &CModelMatcherComponent::tabIndexChanged); connect(ui->tw_ModelsToBeMapped, &QTabWidget::currentChanged, ui->comp_ModelMatcher , &CModelMatcherComponent::tabIndexChanged);
@@ -120,7 +120,7 @@ namespace BlackGui
{ {
this->m_vPilot1stInit = false; this->m_vPilot1stInit = false;
connect(this->ui->tvp_AircraftModelsForVPilot, &CAircraftModelView::doubleClicked, this, &CDbMappingComponent::ps_onModelRowSelected); connect(this->ui->tvp_AircraftModelsForVPilot, &CAircraftModelView::doubleClicked, this, &CDbMappingComponent::ps_onModelRowSelected);
connect(this->ui->tvp_AircraftModelsForVPilot, &CAircraftModelView::rowCountChanged, this, &CDbMappingComponent::ps_onVPilotCountChanged); connect(this->ui->tvp_AircraftModelsForVPilot, &CAircraftModelView::modelDataChanged, this, &CDbMappingComponent::ps_onVPilotCountChanged);
connect(&m_vPilotReader, &CVPilotRulesReader::readFinished, this, &CDbMappingComponent::ps_onLoadVPilotDataFinished); connect(&m_vPilotReader, &CVPilotRulesReader::readFinished, this, &CDbMappingComponent::ps_onLoadVPilotDataFinished);
connect(this->ui->tvp_AircraftModelsForVPilot, &CAircraftModelView::requestStash, this, &CDbMappingComponent::stashSelectedModels); connect(this->ui->tvp_AircraftModelsForVPilot, &CAircraftModelView::requestStash, this, &CDbMappingComponent::stashSelectedModels);
connect(this->ui->tvp_AircraftModelsForVPilot, &CAircraftModelView::toggledHighlightStashedModels, this, &CDbMappingComponent::ps_onStashedModelsChanged); connect(this->ui->tvp_AircraftModelsForVPilot, &CAircraftModelView::toggledHighlightStashedModels, this, &CDbMappingComponent::ps_onStashedModelsChanged);
@@ -466,6 +466,11 @@ namespace BlackGui
} }
void CDbMappingComponent::ps_onStashedModelsChanged() void CDbMappingComponent::ps_onStashedModelsChanged()
{
emit this->ps_digestStashedModelsChanged();
}
void CDbMappingComponent::ps_onStashedModelsChangedDigest()
{ {
const bool hlvp = this->ui->tvp_AircraftModelsForVPilot->derivedModel()->highlightModelStrings(); const bool hlvp = this->ui->tvp_AircraftModelsForVPilot->derivedModel()->highlightModelStrings();
const bool hlom = this->ui->comp_OwnAircraftModels->view()->derivedModel()->highlightModelStrings(); const bool hlom = this->ui->comp_OwnAircraftModels->view()->derivedModel()->highlightModelStrings();

View File

@@ -24,6 +24,7 @@
#include "blackmisc/simulation/data/modelcaches.h" #include "blackmisc/simulation/data/modelcaches.h"
#include "blackmisc/network/entityflags.h" #include "blackmisc/network/entityflags.h"
#include "blackmisc/statusmessagelist.h" #include "blackmisc/statusmessagelist.h"
#include "blackmisc/digestsignal.h"
#include <QFrame> #include <QFrame>
#include <QScopedPointer> #include <QScopedPointer>
@@ -164,6 +165,9 @@ namespace BlackGui
//! Tab index has been changed //! Tab index has been changed
void tabIndexChanged(int index); void tabIndexChanged(int index);
//! \private Just needed to trigger CDbMappingComponent::ps_onStashedModelsChangedDigest
void ps_digestStashedModelsChanged();
private slots: private slots:
//! Load the vPilot rules //! Load the vPilot rules
void ps_loadVPilotData(); void ps_loadVPilotData();
@@ -180,6 +184,9 @@ namespace BlackGui
//! Stashed models changed //! Stashed models changed
void ps_onStashedModelsChanged(); void ps_onStashedModelsChanged();
//! Stashed models changed
void ps_onStashedModelsChangedDigest();
//! Tab index changed //! Tab index changed
void ps_tabIndexChanged(int index); void ps_tabIndexChanged(int index);
@@ -243,10 +250,12 @@ namespace BlackGui
QScopedPointer<CDbModelMappingModifyComponent> m_modelModifyDialog; //!< dialog when modifying models QScopedPointer<CDbModelMappingModifyComponent> m_modelModifyDialog; //!< dialog when modifying models
BlackMisc::Simulation::FsCommon::CVPilotRulesReader m_vPilotReader; //!< read vPilot rules BlackMisc::Simulation::FsCommon::CVPilotRulesReader m_vPilotReader; //!< read vPilot rules
BlackMisc::CData<BlackCore::Data::AuthenticatedDbUser> m_swiftDbUser {this, &CDbMappingComponent::ps_userChanged}; BlackMisc::CData<BlackCore::Data::AuthenticatedDbUser> m_swiftDbUser {this, &CDbMappingComponent::ps_userChanged};
bool m_vPilot1stInit = true; BlackMisc::CDigestSignal m_dsStashedModelsChanged { this, &CDbMappingComponent::ps_digestStashedModelsChanged, &CDbMappingComponent::ps_onStashedModelsChangedDigest, 750, 25 };
bool m_withVPilot = false; bool m_vPilot1stInit = true; //!< vPilot extensions initaliazed?
bool m_withVPilot = false; //!< use vPilot extensions
bool m_autoFilterInDbViews = false; //!< automatically filter the DB view by the current model bool m_autoFilterInDbViews = false; //!< automatically filter the DB view by the current model
//! Init vPilot if rights and suitable //! Init vPilot if rights and suitable
void initVPilotLoading(); void initVPilotLoading();

View File

@@ -48,7 +48,7 @@ namespace BlackGui
connect(ui->pb_LoadExistingSet, &QPushButton::clicked, this, &CDbOwnModelSetComponent::ps_buttonClicked); connect(ui->pb_LoadExistingSet, &QPushButton::clicked, this, &CDbOwnModelSetComponent::ps_buttonClicked);
connect(ui->pb_SaveAsSetForSimulator, &QPushButton::clicked, this, &CDbOwnModelSetComponent::ps_buttonClicked); connect(ui->pb_SaveAsSetForSimulator, &QPushButton::clicked, this, &CDbOwnModelSetComponent::ps_buttonClicked);
connect(&this->m_modelSetLoader, &CAircraftModelSetLoader::simulatorChanged, this, &CDbOwnModelSetComponent::ps_onSimulatorChanged); connect(&this->m_modelSetLoader, &CAircraftModelSetLoader::simulatorChanged, this, &CDbOwnModelSetComponent::ps_onSimulatorChanged);
connect(ui->tvp_OwnModelSet, &CAircraftModelView::rowCountChanged, this, &CDbOwnModelSetComponent::ps_onRowCountChanged); connect(ui->tvp_OwnModelSet, &CAircraftModelView::modelDataChanged, this, &CDbOwnModelSetComponent::ps_onRowCountChanged);
connect(ui->tvp_OwnModelSet, &CAircraftModelView::modelChanged, this, &CDbOwnModelSetComponent::ps_modelChanged); connect(ui->tvp_OwnModelSet, &CAircraftModelView::modelChanged, this, &CDbOwnModelSetComponent::ps_modelChanged);
connect(ui->tvp_OwnModelSet, &CAircraftModelView::jsonModelsForSimulatorLoaded, this, &CDbOwnModelSetComponent::ps_onJsonDataLoaded); connect(ui->tvp_OwnModelSet, &CAircraftModelView::jsonModelsForSimulatorLoaded, this, &CDbOwnModelSetComponent::ps_onJsonDataLoaded);

View File

@@ -44,7 +44,7 @@ namespace BlackGui
connect(this->ui->pb_Validate, &QPushButton::pressed, this, &CDbStashComponent::ps_onValidatePressed); connect(this->ui->pb_Validate, &QPushButton::pressed, this, &CDbStashComponent::ps_onValidatePressed);
connect(this->ui->pb_Publish, &QPushButton::pressed, this, &CDbStashComponent::ps_onPublishPressed); connect(this->ui->pb_Publish, &QPushButton::pressed, this, &CDbStashComponent::ps_onPublishPressed);
connect(this->ui->tvp_StashAircraftModels, &CAircraftModelView::modelChanged, this, &CDbStashComponent::stashedModelsChanged); connect(this->ui->tvp_StashAircraftModels, &CAircraftModelView::modelChanged, this, &CDbStashComponent::stashedModelsChanged);
connect(this->ui->tvp_StashAircraftModels, &CAircraftModelView::rowCountChanged, this, &CDbStashComponent::ps_onRowCountChanged); connect(this->ui->tvp_StashAircraftModels, &CAircraftModelView::modelDataChanged, this, &CDbStashComponent::ps_onRowCountChanged);
// copy over buttons // copy over buttons
connect(this->ui->pb_AircraftIcao, &QPushButton::pressed, this, &CDbStashComponent::ps_copyOverPartsToSelected); connect(this->ui->pb_AircraftIcao, &QPushButton::pressed, this, &CDbStashComponent::ps_copyOverPartsToSelected);

View File

@@ -51,11 +51,11 @@ namespace BlackGui
this->ui->tvp_SimulatedAircraft->setResizeMode(CAircraftModelView::ResizingOnce); this->ui->tvp_SimulatedAircraft->setResizeMode(CAircraftModelView::ResizingOnce);
connect(this->ui->tvp_AircraftModels, &CAircraftModelView::requestUpdate, this, &CMappingComponent::ps_onModelsUpdateRequested); connect(this->ui->tvp_AircraftModels, &CAircraftModelView::requestUpdate, this, &CMappingComponent::ps_onModelsUpdateRequested);
connect(this->ui->tvp_AircraftModels, &CAircraftModelView::rowCountChanged, this, &CMappingComponent::ps_onRowCountChanged); connect(this->ui->tvp_AircraftModels, &CAircraftModelView::modelDataChanged, this, &CMappingComponent::ps_onRowCountChanged);
connect(this->ui->tvp_AircraftModels, &CAircraftModelView::clicked, this, &CMappingComponent::ps_onModelSelectedInView); connect(this->ui->tvp_AircraftModels, &CAircraftModelView::clicked, this, &CMappingComponent::ps_onModelSelectedInView);
connect(this->ui->tvp_AircraftModels, &CAircraftModelView::requestNewBackendData, this, &CMappingComponent::ps_onMenuRequestModelReload); connect(this->ui->tvp_AircraftModels, &CAircraftModelView::requestNewBackendData, this, &CMappingComponent::ps_onMenuRequestModelReload);
connect(this->ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::rowCountChanged, this, &CMappingComponent::ps_onRowCountChanged); connect(this->ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::modelDataChanged, this, &CMappingComponent::ps_onRowCountChanged);
connect(this->ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::clicked, this, &CMappingComponent::ps_onAircraftSelectedInView); connect(this->ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::clicked, this, &CMappingComponent::ps_onAircraftSelectedInView);
connect(this->ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::requestUpdate, this, &CMappingComponent::ps_onSimulatedAircraftUpdateRequested); connect(this->ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::requestUpdate, this, &CMappingComponent::ps_onSimulatedAircraftUpdateRequested);
connect(this->ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::requestTextMessageWidget, this, &CMappingComponent::requestTextMessageWidget); connect(this->ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::requestTextMessageWidget, this, &CMappingComponent::requestTextMessageWidget);

View File

@@ -31,8 +31,8 @@ namespace BlackGui
{ {
ui->setupUi(this); ui->setupUi(this);
this->tabBar()->setExpanding(false); this->tabBar()->setExpanding(false);
connect(this->ui->tvp_AllUsers, &CUserView::rowCountChanged, this, &CUserComponent::ps_onCountChanged); connect(this->ui->tvp_AllUsers, &CUserView::modelDataChanged, this, &CUserComponent::ps_onCountChanged);
connect(this->ui->tvp_Clients, &CClientView::rowCountChanged, this, &CUserComponent::ps_onCountChanged); connect(this->ui->tvp_Clients, &CClientView::modelDataChanged, this, &CUserComponent::ps_onCountChanged);
connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CUserComponent::ps_connectionStatusChanged); connect(sGui->getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CUserComponent::ps_connectionStatusChanged);
} }

View File

@@ -42,9 +42,9 @@ namespace BlackGui
Q_ASSERT_X(!this->m_acceptedMetaTypes.isEmpty(), Q_FUNC_INFO, "no accepted meta type ids"); Q_ASSERT_X(!this->m_acceptedMetaTypes.isEmpty(), Q_FUNC_INFO, "no accepted meta type ids");
if (m_acceptedMetaTypes.isEmpty()) { return false; } if (m_acceptedMetaTypes.isEmpty()) { return false; }
if (!m_allowDrop || !CGuiUtility::hasSwiftVariantMimeType(mime)) { return false; } if (!m_allowDrop || !CGuiUtility::hasSwiftVariantMimeType(mime)) { return false; }
int metaTypeId = CGuiUtility::metaTypeIdFromSwiftDragAndDropData(mime); const int metaTypeId = CGuiUtility::metaTypeIdFromSwiftDragAndDropData(mime);
if (metaTypeId == QMetaType::UnknownType) { return false; } if (metaTypeId == QMetaType::UnknownType) { return false; }
bool accept = m_acceptedMetaTypes.contains(metaTypeId); const bool accept = m_acceptedMetaTypes.contains(metaTypeId);
return accept; return accept;
} }

View File

@@ -157,19 +157,19 @@ namespace BlackGui
return m_modelDestroyed; return m_modelDestroyed;
} }
void CListModelBaseNonTemplate::sendDataChanged(int startRowIndex, int endRowIndex) void CListModelBaseNonTemplate::emitDataChanged(int startRowIndex, int endRowIndex)
{ {
BLACK_VERIFY_X(startRowIndex <= endRowIndex, Q_FUNC_INFO, "check rows"); BLACK_VERIFY_X(startRowIndex <= endRowIndex, Q_FUNC_INFO, "check rows");
BLACK_VERIFY_X(startRowIndex >= 0 && endRowIndex >= 0, Q_FUNC_INFO, "check rows"); BLACK_VERIFY_X(startRowIndex >= 0 && endRowIndex >= 0, Q_FUNC_INFO, "check rows");
int columns = columnCount(); const int columns = columnCount();
int rows = rowCount(); const int rows = rowCount();
if (columns < 1) { return; } if (columns < 1) { return; }
if (startRowIndex < 0) { startRowIndex = 0; } if (startRowIndex < 0) { startRowIndex = 0; }
if (endRowIndex >= rows) { endRowIndex = rows - 1; } if (endRowIndex >= rows) { endRowIndex = rows - 1; }
const QModelIndex topLeft(createIndex(startRowIndex, 0)); const QModelIndex topLeft(createIndex(startRowIndex, 0));
const QModelIndex bottomRight(createIndex(endRowIndex, columns - 1)); const QModelIndex bottomRight(createIndex(endRowIndex, columns - 1));
emit dataChanged(topLeft, bottomRight); emit this->dataChanged(topLeft, bottomRight);
} }
int CListModelBaseNonTemplate::ps_updateContainer(const CVariant &variant, bool sort) int CListModelBaseNonTemplate::ps_updateContainer(const CVariant &variant, bool sort)
@@ -182,6 +182,9 @@ namespace BlackGui
{ {
// non unique default name, set translation context as default // non unique default name, set translation context as default
this->setObjectName(translationContext); this->setObjectName(translationContext);
// connect
connect(this, &CListModelBaseNonTemplate::dataChanged, this, &CListModelBaseNonTemplate::ps_onDataChanged);
} }
template <typename ObjectType, typename ContainerType, bool UseCompare> template <typename ObjectType, typename ContainerType, bool UseCompare>
@@ -288,7 +291,7 @@ namespace BlackGui
this->m_container[index.row()] = obj; this->m_container[index.row()] = obj;
const CVariant co = CVariant::from(obj); const CVariant co = CVariant::from(obj);
emit objectChanged(co, propertyIndex); emit objectChanged(co, propertyIndex);
emit dataChanged(topLeft, bottomRight); emit this->dataChanged(topLeft, bottomRight);
this->updateFilteredContainer(); this->updateFilteredContainer();
return true; return true;
} }
@@ -326,9 +329,9 @@ namespace BlackGui
this->endResetModel(); this->endResetModel();
int newSize = this->m_container.size(); int newSize = this->m_container.size();
// I have to update with same size because cannot tell what data are changed
this->emitRowCountChanged();
Q_UNUSED(oldSize); Q_UNUSED(oldSize);
// I have to update even with same size because I cannot tell what/if data are changed
this->emitModelDataChanged();
return newSize; return newSize;
} }
@@ -400,7 +403,7 @@ namespace BlackGui
this->beginResetModel(); this->beginResetModel();
this->updateFilteredContainer(); this->updateFilteredContainer();
this->endResetModel(); this->endResetModel();
this->emitRowCountChanged(); this->emitModelDataChanged();
} }
template <typename ObjectType, typename ContainerType, bool UseCompare> template <typename ObjectType, typename ContainerType, bool UseCompare>
@@ -417,7 +420,7 @@ namespace BlackGui
this->beginResetModel(); this->beginResetModel();
this->updateFilteredContainer(); this->updateFilteredContainer();
this->endResetModel(); this->endResetModel();
this->emitRowCountChanged(); this->emitModelDataChanged();
} }
else else
{ {
@@ -453,7 +456,7 @@ namespace BlackGui
this->m_container.push_back(object); this->m_container.push_back(object);
endInsertRows(); endInsertRows();
this->updateFilteredContainer(); this->updateFilteredContainer();
this->emitRowCountChanged(); this->emitModelDataChanged();
} }
template <typename ObjectType, typename ContainerType, bool UseCompare> template <typename ObjectType, typename ContainerType, bool UseCompare>
@@ -469,7 +472,7 @@ namespace BlackGui
this->updateFilteredContainer(); this->updateFilteredContainer();
this->endResetModel(); this->endResetModel();
} }
this->emitRowCountChanged(); this->emitModelDataChanged();
} }
template <typename ObjectType, typename ContainerType, bool UseCompare> template <typename ObjectType, typename ContainerType, bool UseCompare>
@@ -486,7 +489,7 @@ namespace BlackGui
this->updateFilteredContainer(); this->updateFilteredContainer();
this->endResetModel(); this->endResetModel();
} }
this->emitRowCountChanged(); this->emitModelDataChanged();
} }
template <typename ObjectType, typename ContainerType, bool UseCompare> template <typename ObjectType, typename ContainerType, bool UseCompare>
@@ -499,7 +502,7 @@ namespace BlackGui
int newSize = this->m_container.size(); int newSize = this->m_container.size();
if (oldSize != newSize) if (oldSize != newSize)
{ {
this->emitRowCountChanged(); this->emitModelDataChanged();
if (this->hasFilter()) if (this->hasFilter())
{ {
this->beginResetModel(); this->beginResetModel();
@@ -516,7 +519,7 @@ namespace BlackGui
this->m_container.clear(); this->m_container.clear();
this->m_containerFiltered.clear(); this->m_containerFiltered.clear();
endResetModel(); endResetModel();
this->emitRowCountChanged(); this->emitModelDataChanged();
} }
template <typename ObjectType, typename ContainerType, bool UseCompare> template <typename ObjectType, typename ContainerType, bool UseCompare>
@@ -559,13 +562,31 @@ namespace BlackGui
} }
template <typename ObjectType, typename ContainerType, bool UseCompare> template <typename ObjectType, typename ContainerType, bool UseCompare>
void CListModelBase<ObjectType, ContainerType, UseCompare>::emitRowCountChanged() void CListModelBase<ObjectType, ContainerType, UseCompare>::emitModelDataChanged()
{ {
int n = this->containerOrFilteredContainer().size(); const int n = this->containerOrFilteredContainer().size();
emit this->rowCountChanged(n, this->hasFilter()); emit this->modelDataChanged(n, this->hasFilter());
emit this->changed(); emit this->changed();
} }
template <typename ObjectType, typename ContainerType, bool UseCompare>
void CListModelBase<ObjectType, ContainerType, UseCompare>::ps_onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
{
// underlying base class changed
Q_UNUSED(topLeft);
Q_UNUSED(bottomRight);
Q_UNUSED(roles);
this->emitModelDataChanged();
}
template <typename ObjectType, typename ContainerType, bool UseCompare>
void CListModelBase<ObjectType, ContainerType, UseCompare>::ps_onChangedDigest()
{
const int n = this->containerOrFilteredContainer().size();
emit this->changedDigest();
emit this->modelDataChangedDigest(n, this->hasFilter());
}
template <typename ObjectType, typename ContainerType, bool UseCompare> template <typename ObjectType, typename ContainerType, bool UseCompare>
void CListModelBase<ObjectType, ContainerType, UseCompare>::moveItems(const ContainerType &items, int position) void CListModelBase<ObjectType, ContainerType, UseCompare>::moveItems(const ContainerType &items, int position)
{ {

View File

@@ -17,6 +17,7 @@
#include "blackgui/models/modelfilter.h" #include "blackgui/models/modelfilter.h"
#include "blackgui/dropbase.h" #include "blackgui/dropbase.h"
#include "blackmisc/worker.h" #include "blackmisc/worker.h"
#include "blackmisc/digestsignal.h"
#include <QStandardItemModel> #include <QStandardItemModel>
#include <QThread> #include <QThread>
#include <memory> #include <memory>
@@ -98,7 +99,7 @@ namespace BlackGui
//! Send signal that data have been changed. //! Send signal that data have been changed.
//! \note Meant for scenarios where the container is directly updated and a subsequent signal is required //! \note Meant for scenarios where the container is directly updated and a subsequent signal is required
void sendDataChanged(int startRowIndex, int endRowIndex); void emitDataChanged(int startRowIndex, int endRowIndex);
//! Convert to JSON //! Convert to JSON
virtual QJsonObject toJson() const = 0; virtual QJsonObject toJson() const = 0;
@@ -110,12 +111,18 @@ namespace BlackGui
//! Asynchronous update finished //! Asynchronous update finished
void asyncUpdateFinished(); void asyncUpdateFinished();
//! Number of elements changed //! Data changed
void rowCountChanged(int count, bool withFilter); void modelDataChanged(int count, bool withFilter);
//! Data changed, digest version
void modelDataChangedDigest(int count, bool withFilter);
//! Model has been changed //! Model has been changed
void changed(); void changed();
//! Model has been changed, digest signal
void changedDigest();
//! Template free information, that object changed //! Template free information, that object changed
void objectChanged(const BlackMisc::CVariant &object, const BlackMisc::CPropertyIndex &changedIndex); void objectChanged(const BlackMisc::CVariant &object, const BlackMisc::CPropertyIndex &changedIndex);
@@ -125,6 +132,12 @@ namespace BlackGui
//! \param sort //! \param sort
int ps_updateContainer(const BlackMisc::CVariant &variant, bool sort); int ps_updateContainer(const BlackMisc::CVariant &variant, bool sort);
//! Feedback when QStandardItemModel::dataChanged was called
virtual void ps_onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles) = 0;
//! Digest signal
virtual void ps_onChangedDigest() = 0;
protected: protected:
//! Constructor //! Constructor
//! \param translationContext I18N context //! \param translationContext I18N context
@@ -136,9 +149,12 @@ namespace BlackGui
CColumns m_columns; //!< columns metadata CColumns m_columns; //!< columns metadata
int m_sortedColumn; //!< current sort column int m_sortedColumn; //!< current sort column
Qt::SortOrder m_sortOrder; //!< sort order (asc/desc)
bool m_modelDestroyed = false; //!< model is about to be destroyed bool m_modelDestroyed = false; //!< model is about to be destroyed
Qt::SortOrder m_sortOrder; //!< sort order (asc/desc)
Qt::DropActions m_dropActions = Qt::IgnoreAction; //!< drop actions Qt::DropActions m_dropActions = Qt::IgnoreAction; //!< drop actions
private:
BlackMisc::CDigestSignal m_dsModelsChanged { this, &CListModelBaseNonTemplate::changed, &CListModelBaseNonTemplate::ps_onChangedDigest, 500, 10 };
}; };
//! List model //! List model
@@ -196,7 +212,8 @@ namespace BlackGui
//! Update single element //! Update single element
virtual void update(int rowIndex, const ObjectType &object); virtual void update(int rowIndex, const ObjectType &object);
//! Move items to position //! Move items to position, normally called from dropMimeData
//! \sa dropMimeData
virtual void moveItems(const ContainerType &items, int position); virtual void moveItems(const ContainerType &items, int position);
//! Object at row position //! Object at row position
@@ -233,7 +250,7 @@ namespace BlackGui
int removeIf(K0 k0, V0 v0, KeysValues... keysValues) int removeIf(K0 k0, V0 v0, KeysValues... keysValues)
{ {
int c = m_container.removeIf(BlackMisc::Predicates::MemberEqual(k0, v0, keysValues...)); int c = m_container.removeIf(BlackMisc::Predicates::MemberEqual(k0, v0, keysValues...));
if (c > 0) { this->emitRowCountChanged();} if (c > 0) { this->emitModelDataChanged();}
this->updateFilteredContainer(); this->updateFilteredContainer();
return c; return c;
} }
@@ -257,14 +274,18 @@ namespace BlackGui
//! Constructor //! Constructor
CListModelBase(const QString &translationContext, QObject *parent = nullptr); CListModelBase(const QString &translationContext, QObject *parent = nullptr);
//! \copydoc BlackGui::Models::CListModelBaseNonTemplate::performUpdateContainer //! \name Base class overrides
//! @{
virtual int performUpdateContainer(const BlackMisc::CVariant &variant, bool sort) override; virtual int performUpdateContainer(const BlackMisc::CVariant &variant, bool sort) override;
virtual void ps_onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomLeft, const QVector<int> &roles) override;
virtual void ps_onChangedDigest() override;
//! @}
//! Update filtered container //! Update filtered container
void updateFilteredContainer(); void updateFilteredContainer();
//! Row count changed //! Row count changed
void emitRowCountChanged(); void emitModelDataChanged();
std::unique_ptr<IModelFilter<ContainerType> > m_filter; //!< Used filter std::unique_ptr<IModelFilter<ContainerType> > m_filter; //!< Used filter
ContainerType m_container; //!< used container ContainerType m_container; //!< used container

View File

@@ -72,10 +72,20 @@ namespace BlackGui
{ {
order = container[position].getOrder(); order = container[position].getOrder();
} }
this->setSortColumnToOrder();
container.moveTo(items, order); container.moveTo(items, order);
// update container
this->updateContainerMaybeAsync(container); this->updateContainerMaybeAsync(container);
} }
template <typename ObjectType, typename ContainerType, typename KeyType, bool UseCompare>
void COrderableListModelDbObjects<ObjectType, ContainerType, KeyType, UseCompare>::setSortColumnToOrder()
{
// force sorted by order, otherwise display looks confusing
this->setSorting(IOrderable::IndexOrder);
}
template <typename ObjectType, typename ContainerType, typename KeyType, bool UseCompare> template <typename ObjectType, typename ContainerType, typename KeyType, bool UseCompare>
int COrderableListModelDbObjects<ObjectType, ContainerType, KeyType, UseCompare>::update(const ContainerType &container, bool sort) int COrderableListModelDbObjects<ObjectType, ContainerType, KeyType, UseCompare>::update(const ContainerType &container, bool sort)
{ {

View File

@@ -73,6 +73,9 @@ namespace BlackGui
virtual void moveItems(const ContainerType &items, int position) override; virtual void moveItems(const ContainerType &items, int position) override;
//! @} //! @}
//! Sort order to order property BlackMisc::IOrderable::IndexOrder
void setSortColumnToOrder();
protected: protected:
//! Constructor //! Constructor
COrderableListModelDbObjects(const QString &translationContext, QObject *parent = nullptr); COrderableListModelDbObjects(const QString &translationContext, QObject *parent = nullptr);

View File

@@ -178,7 +178,14 @@ namespace BlackGui
void CAircraftModelView::dropEvent(QDropEvent *event) void CAircraftModelView::dropEvent(QDropEvent *event)
{ {
// moves from myself are ignored
// depends on isDropAllowed() / acceptDrop() if this function is called
Qt::DropAction action = event->dropAction();
if (action == Qt::MoveAction)
{
COrderableViewWithDbObjects::dropEvent(event);
return;
}
if (!this->isDropAllowed()) { return; } if (!this->isDropAllowed()) { return; }
if (!event) { return; } if (!event) { return; }
const QMimeData *mime = event->mimeData(); const QMimeData *mime = event->mimeData();

View File

@@ -106,6 +106,7 @@ namespace BlackGui
protected: protected:
//! \copydoc QTableView::dropEvent //! \copydoc QTableView::dropEvent
//! \sa BlackGui::Models::CListModelBase::dropMimeData
virtual void dropEvent(QDropEvent *event) override; virtual void dropEvent(QDropEvent *event) override;
//! \name View base class overrides //! \name View base class overrides

View File

@@ -113,7 +113,7 @@ namespace BlackGui
{ {
bool s = connect(filterWidget, &CFilterWidget::changeFilter, this, &CViewBaseNonTemplate::ps_filterWidgetChangedFilter); bool s = connect(filterWidget, &CFilterWidget::changeFilter, this, &CViewBaseNonTemplate::ps_filterWidgetChangedFilter);
Q_ASSERT_X(s, Q_FUNC_INFO, "filter connect"); Q_ASSERT_X(s, Q_FUNC_INFO, "filter connect");
s = connect(this, &CViewBaseNonTemplate::rowCountChanged, filterWidget, &CFilterWidget::onRowCountChanged); s = connect(this, &CViewBaseNonTemplate::modelDataChanged, filterWidget, &CFilterWidget::onRowCountChanged);
Q_ASSERT_X(s, Q_FUNC_INFO, "filter connect"); Q_ASSERT_X(s, Q_FUNC_INFO, "filter connect");
Q_UNUSED(s); Q_UNUSED(s);
} }
@@ -437,6 +437,11 @@ namespace BlackGui
this->ps_saveJson(); this->ps_saveJson();
} }
void CViewBaseNonTemplate::onModelChanged()
{
this->updateSortIndicator();
}
void CViewBaseNonTemplate::rowsResizeModeToInteractive() void CViewBaseNonTemplate::rowsResizeModeToInteractive()
{ {
const int height = this->verticalHeader()->minimumSectionSize(); const int height = this->verticalHeader()->minimumSectionSize();
@@ -625,7 +630,7 @@ namespace BlackGui
this->setSortingEnabled(true); this->setSortingEnabled(true);
if (model) if (model)
{ {
this->setModel(this->m_model); this->standardInit(model);
} }
} }
@@ -659,7 +664,7 @@ namespace BlackGui
this->fullResizeToContents(); this->fullResizeToContents();
} }
} }
int c = this->m_model->update(container, sort); const int c = this->m_model->update(container, sort);
// resize after real update according to mode // resize after real update according to mode
if (presizeThresholdReached) if (presizeThresholdReached)
@@ -675,6 +680,7 @@ namespace BlackGui
// small amount of data not covered before // small amount of data not covered before
this->fullResizeToContents(); this->fullResizeToContents();
} }
this->updateSortIndicator(); // make sure sort indicator represents sort order
this->hideLoadIndicator(); this->hideLoadIndicator();
return c; return c;
} }
@@ -804,7 +810,7 @@ namespace BlackGui
if (c > 0) if (c > 0)
{ {
this->derivedModel()->sendDataChanged(firstUpdatedRow, lastUpdatedRow); this->derivedModel()->emitDataChanged(firstUpdatedRow, lastUpdatedRow);
} }
return c; return c;
} }
@@ -1008,10 +1014,22 @@ namespace BlackGui
Q_ASSERT_X(model || this->m_model, Q_FUNC_INFO, "Missing model"); Q_ASSERT_X(model || this->m_model, Q_FUNC_INFO, "Missing model");
if (model) if (model)
{ {
if (model == this->m_model) { return; }
if (this->m_model)
{
this->m_model->disconnect();
}
this->m_model = model; this->m_model = model;
connect(this->m_model, &ModelClass::rowCountChanged, this, &CViewBase::rowCountChanged); bool c = connect(this->m_model, &ModelClass::modelDataChanged, this, &CViewBase::modelDataChanged);
connect(this->m_model, &ModelClass::objectChanged, this, &CViewBase::objectChanged); Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed");
connect(this->m_model, &ModelClass::changed, this, &CViewBase::modelChanged); c = connect(this->m_model, &ModelClass::objectChanged, this, &CViewBase::objectChanged);
Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed");
c = connect(this->m_model, &ModelClass::changed, this, &CViewBase::modelChanged);
Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed");
c = connect(this->m_model, &ModelClass::changed, this, &CViewBase::onModelChanged);
Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed");
Q_UNUSED(c);
} }
this->setModel(this->m_model); // via QTableView this->setModel(this->m_model); // via QTableView
@@ -1047,6 +1065,17 @@ namespace BlackGui
return this->updateContainer(c, sort, resize); return this->updateContainer(c, sort, resize);
} }
template <class ModelClass, class ContainerType, class ObjectType>
void CViewBase<ModelClass, ContainerType, ObjectType>::updateSortIndicator()
{
if (this->derivedModel()->hasValidSortColumn())
{
const int index = this->derivedModel()->getSortColumn();
Qt::SortOrder order = this->derivedModel()->getSortOrder();
this->horizontalHeader()->setSortIndicator(index, order);
}
}
template <class ModelClass, class ContainerType, class ObjectType> template <class ModelClass, class ContainerType, class ObjectType>
CStatusMessage CViewBase<ModelClass, ContainerType, ObjectType>::modifyLoadedJsonData(ContainerType &data) const CStatusMessage CViewBase<ModelClass, ContainerType, ObjectType>::modifyLoadedJsonData(ContainerType &data) const
{ {

View File

@@ -228,8 +228,8 @@ namespace BlackGui
//! Asynchronous update finished //! Asynchronous update finished
void asyncUpdateFinished(); void asyncUpdateFinished();
//! Number of elements changed //! Model data changed
void rowCountChanged(int count, bool withFilter); void modelDataChanged(int count, bool withFilter);
//! Model bas been changed (means data in view have been changed) //! Model bas been changed (means data in view have been changed)
void modelChanged(); void modelChanged();
@@ -270,6 +270,9 @@ namespace BlackGui
//! \param processEvents force event processing to display indicator by updating GUI //! \param processEvents force event processing to display indicator by updating GUI
void showLoadIndicator(int containerSizeDependent = -1, bool processEvents = true); void showLoadIndicator(int containerSizeDependent = -1, bool processEvents = true);
//! Underlying model changed
void onModelChanged();
//! Hide loading indicator //! Hide loading indicator
void hideLoadIndicator(); void hideLoadIndicator();
@@ -324,6 +327,9 @@ namespace BlackGui
//! Init menu actions //! Init menu actions
BlackGui::Menus::CMenuActions initMenuActions(MenuFlag menu); BlackGui::Menus::CMenuActions initMenuActions(MenuFlag menu);
//! Set the sort indicator to the current sort column
virtual void updateSortIndicator() = 0;
QString m_saveFileName; //!< save file name (JSON) QString m_saveFileName; //!< save file name (JSON)
ResizeMode m_resizeMode = PresizeSubset; //!< mode ResizeMode m_resizeMode = PresizeSubset; //!< mode
RowsResizeMode m_rowResizeMode = Interactive; //!< row resize mode for row height RowsResizeMode m_rowResizeMode = Interactive; //!< row resize mode for row height
@@ -533,7 +539,7 @@ namespace BlackGui
//! Add the object and container type as accepted drop types CDropBase::addAcceptedMetaTypeId //! Add the object and container type as accepted drop types CDropBase::addAcceptedMetaTypeId
void addContainerTypesAsDropTypes(bool objectType = true, bool containerType = true); void addContainerTypesAsDropTypes(bool objectType = true, bool containerType = true);
//! Init so items can be ordered //! Init so items can be ordered, includes enabling drag and drop
void initAsOrderable(); void initAsOrderable();
//! Drop actions //! Drop actions
@@ -556,6 +562,7 @@ namespace BlackGui
virtual bool reachedResizeThreshold(int containrerSize = -1) const override; virtual bool reachedResizeThreshold(int containrerSize = -1) const override;
virtual void performModeBasedResizeToContent() override; virtual void performModeBasedResizeToContent() override;
virtual int performUpdateContainer(const BlackMisc::CVariant &variant, bool sort, bool resize) override; virtual int performUpdateContainer(const BlackMisc::CVariant &variant, bool sort, bool resize) override;
virtual void updateSortIndicator() override;
//! @} //! @}
//! Modify JSON data loaded in BlackGui::Views::CViewBaseNonTemplate::ps_loadJson //! Modify JSON data loaded in BlackGui::Views::CViewBaseNonTemplate::ps_loadJson

View File

@@ -52,7 +52,7 @@ namespace BlackGui
virtual void ps_toggleHighlightDbData() override; virtual void ps_toggleHighlightDbData() override;
}; };
//! Base class for views with DB objects //! Base class for views with DB objects also orderable (based on BlackMisc::IOrderableList )
template <class ModelClass, class ContainerType, class ObjectType, class KeyType> class COrderableViewWithDbObjects : template <class ModelClass, class ContainerType, class ObjectType, class KeyType> class COrderableViewWithDbObjects :
public CViewWithDbObjects<ModelClass, ContainerType, ObjectType, KeyType> public CViewWithDbObjects<ModelClass, ContainerType, ObjectType, KeyType>
{ {

View File

@@ -18,8 +18,7 @@
namespace BlackMisc namespace BlackMisc
{ {
//! Receive 1..n signals, collect them over time, and resend afer n milliseconds
//! Receive 1..n signal, collect them over time, and resend afer n milliseconds
class BLACKMISC_EXPORT CDigestSignal : public QObject class BLACKMISC_EXPORT CDigestSignal : public QObject
{ {
Q_OBJECT Q_OBJECT

View File

@@ -18,6 +18,7 @@
namespace BlackMisc namespace BlackMisc
{ {
//! List of orderable IOrderable objects //! List of orderable IOrderable objects
//! \remark Orerable objects shall implement BlackMisc::IOrderable
template<class OBJ, class CONTAINER> template<class OBJ, class CONTAINER>
class IOrderableList class IOrderableList
{ {
@@ -71,8 +72,8 @@ namespace BlackMisc
extern template class BLACKMISC_EXPORT_TEMPLATE IOrderableList<BlackMisc::Simulation::CAircraftModel, BlackMisc::Simulation::CAircraftModelList>; extern template class BLACKMISC_EXPORT_TEMPLATE IOrderableList<BlackMisc::Simulation::CAircraftModel, BlackMisc::Simulation::CAircraftModelList>;
extern template class BLACKMISC_EXPORT_TEMPLATE IOrderableList<BlackMisc::Simulation::CDistributor, BlackMisc::Simulation::CDistributorList>; extern template class BLACKMISC_EXPORT_TEMPLATE IOrderableList<BlackMisc::Simulation::CDistributor, BlackMisc::Simulation::CDistributorList>;
//! \endcond //! \endcond
} //namespace } //namespace
#endif //guard #endif //guard

View File

@@ -26,9 +26,9 @@ namespace BlackMisc
{ {
//! Value object encapsulating a list of aircraft models //! Value object encapsulating a list of aircraft models
class BLACKMISC_EXPORT CAircraftModelList : class BLACKMISC_EXPORT CAircraftModelList :
public CSequence<CAircraftModel>, public BlackMisc::CSequence<CAircraftModel>,
public IDatastoreObjectList<CAircraftModel, CAircraftModelList, int>, public BlackMisc::IDatastoreObjectList<CAircraftModel, CAircraftModelList, int>,
public IOrderableList<CAircraftModel, CAircraftModelList>, public BlackMisc::IOrderableList<CAircraftModel, CAircraftModelList>,
public BlackMisc::Mixin::MetaType<CAircraftModelList> public BlackMisc::Mixin::MetaType<CAircraftModelList>
{ {
public: public: