planner: initialize subobject of PlannerWidgets in correct order
The DivePlannerWidget was initialized before the planner models. However, it attaches these (non existing) models to the comboboxes. That can't work. Initialize in correct order. Fixes #4014 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
13b894a756
commit
bdade9e499
@ -542,11 +542,11 @@ void PlannerDetails::setPlanNotes(QString plan)
|
||||
|
||||
PlannerWidgets::PlannerWidgets() :
|
||||
planned_dive(alloc_dive()),
|
||||
gasModel(std::make_unique<GasSelectionModel>()),
|
||||
diveTypeModel(std::make_unique<DiveTypeSelectionModel>()),
|
||||
plannerWidget(*planned_dive, this),
|
||||
plannerSettingsWidget(this)
|
||||
{
|
||||
gasModel = std::make_unique<GasSelectionModel>();
|
||||
diveTypeModel = std::make_unique<DiveTypeSelectionModel>();
|
||||
connect(plannerDetails.printPlan(), &QPushButton::pressed, this, &PlannerWidgets::printDecoPlan);
|
||||
connect(DivePlannerPointsModel::instance(), &DivePlannerPointsModel::calculatedPlanNotes,
|
||||
&plannerDetails, &PlannerDetails::setPlanNotes);
|
||||
|
||||
@ -94,11 +94,11 @@ slots:
|
||||
public:
|
||||
void repopulateGasModel();
|
||||
OwningDivePtr planned_dive;
|
||||
std::unique_ptr<GasSelectionModel> gasModel;
|
||||
std::unique_ptr<DiveTypeSelectionModel> diveTypeModel;
|
||||
DivePlannerWidget plannerWidget;
|
||||
PlannerSettingsWidget plannerSettingsWidget;
|
||||
PlannerDetails plannerDetails;
|
||||
std::unique_ptr<GasSelectionModel> gasModel;
|
||||
std::unique_ptr<DiveTypeSelectionModel> diveTypeModel;
|
||||
};
|
||||
|
||||
#endif // DIVEPLANNER_H
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user