[Companion] Refactor RawSwitchItemModel and RawSwitchFilterItemModel for better efficiency, does not invalidate whole model on updates (structure is almost identical to the RawSource variants).

This commit is contained in:
Max Paperno
2018-07-12 13:20:07 -04:00
parent b76a0a8789
commit 81c33b6432
11 changed files with 130 additions and 78 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
// Phase switch
if (phaseIdx > 0) {
rawSwitchItemModel = new RawSwitchFilterItemModel(&generalSettings, &model, MixesContext);
rawSwitchItemModel = new RawSwitchFilterItemModel(&generalSettings, &model, RawSwitch::MixesContext, this);
ui->swtch->setModel(rawSwitchItemModel);
ui->swtch->setCurrentIndex(ui->swtch->findData(phase.swtch.toValue()));
connect(ui->swtch, SIGNAL(currentIndexChanged(int)), this, SLOT(phaseSwitch_currentIndexChanged(int)));