subsurface/desktop-widgets/tab-widgets/TabDiveEquipment.h
Berthold Stoeger 32de8a1387 tab-widgets: make delegates subobject
The dive-equipment tab has a number of "delegates" for editing
tanks sizes, etc. Instead of allocating them, make them subobjects.

The main point here is that, in an upcoming commit, the sensor
delegate will have to be accessed to change the current dive computer.
So far it didn't have a name and therefore was hard to access.
By making it a subobject it also gets a name.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-04-16 20:23:59 +02:00

49 lines
1.2 KiB
C++

// SPDX-License-Identifier: GPL-2.0
#ifndef TAB_DIVE_EQUIPMENT_H
#define TAB_DIVE_EQUIPMENT_H
#include "TabBase.h"
#include "ui_TabDiveEquipment.h"
#include "qt-models/completionmodels.h"
#include "desktop-widgets/divelistview.h"
#include "desktop-widgets/modeldelegates.h"
namespace Ui {
class TabDiveEquipment;
};
class WeightModel;
class CylindersModel;
class TabDiveEquipment : public TabBase {
Q_OBJECT
public:
TabDiveEquipment(MainTab *parent);
~TabDiveEquipment();
void updateData(const std::vector<dive *> &selection, dive *currentDive, int currentDC) override;
void clear() override;
void closeWarning();
private slots:
void divesChanged(const QVector<dive *> &dives, DiveField field);
void addCylinder_clicked();
void addWeight_clicked();
void toggleTriggeredColumn();
void editCylinderWidget(const QModelIndex &index);
void editWeightWidget(const QModelIndex &index);
void on_suit_editingFinished();
void divesEdited(int count);
private:
Ui::TabDiveEquipment ui;
SuitCompletionModel suitModel;
CylindersModel *cylindersModel;
WeightModel *weightModel;
TankInfoDelegate tankInfoDelegate;
TankUseDelegate tankUseDelegate;
SensorDelegate sensorDelegate;
WSInfoDelegate wsInfoDelegate;
};
#endif // TAB_DIVE_EQUIPMENT_H