Wed, 06 Apr 2022 20:26:47 +0200
Fermentables are loaded in the main recipe record in a QList. The refresh table function does the sorting, on added moment (mash first), amount and finally color of the malt. Removed the old hidden table columns. Do all manipulation on the recipe record with QList arrays. The ferment_amount_changed() slot is complete. The whole recipe editor is going in the right direction.
#ifndef _RECIPESTREE_H #define _RECIPESTREE_H #include <QDialog> #include <QtWidgets/QGridLayout> #include <QtWidgets/QGroupBox> #include <QtWidgets/QPushButton> #include <QtWidgets/QListView> #include <QtWidgets/QTreeWidget> #include <QtWidgets/QDialog> #include <QtWidgets/QHeaderView> #include <QtWidgets/QLabel> #include <QtWidgets/QLineEdit> #include <QtWidgets/QPlainTextEdit> #include <QtWidgets/QDoubleSpinBox> #include <QtWidgets/QSpinBox> namespace Ui { class RecipesTree; } class RecipesTree : public QDialog { Q_OBJECT public: explicit RecipesTree(QWidget *parent = nullptr); ~RecipesTree(); signals: void setStatus(QString); private slots: void on_insertButton_clicked(); void on_openButton_clicked(); void on_item_clicked(QTreeWidgetItem *, int); void on_item_doubleclicked(QTreeWidgetItem *, int); void refreshTable(void); private: QGridLayout *gridLayout; QTreeWidget *treeWidget; QGroupBox *groupBox, *recipeBox; QHBoxLayout *horizontalLayout; QPushButton *quitButton, *insertButton, *openButton; QLabel *volumeLabel, *efficiencyLabel, *boilvolumeLabel; QLabel *boiltimeLabel, *ogLabel, *fgLabel; QLabel *abvLabel, *co2Label, *colorLabel; QLabel *colormethodLabel, *ibuLabel, *ibumethodLabel; QLabel *remarksLabel; QDoubleSpinBox *volumeEdit, *boilvolumeEdit; QDoubleSpinBox *efficiencyEdit, *ogEdit, *fgEdit; QDoubleSpinBox *abvEdit, *co2Edit; QSpinBox *boiltimeEdit, *colorEdit, *ibuEdit; QPlainTextEdit *remarksEdit; QLineEdit *colormethodEdit, *ibumethodEdit; int record; void edit(int recno); void showRecipe(); }; #endif