NewItemDialog uses dynamically generated control widgets for model data as well. Added a WidgetHelper class to consolidate identical source code for ItemDetailMapper and NewItemDialog.

This commit is contained in:
2026-03-02 19:25:27 +01:00
parent 2fb7560e6e
commit 2d8c97b5f0
7 changed files with 146 additions and 97 deletions

View File

@ -24,20 +24,13 @@ class NewItemDialog : public AbstractDialog {
// void reject() override;
private:
QLabel* m_nameLabel = nullptr;
QLineEdit* m_nameEdit = nullptr;
QGridLayout* m_layout;
QList<QWidget*> m_controlWidgets;
QLabel* m_descriptionLabel = nullptr;
QLineEdit* m_descriptionEdit = nullptr;
void setupWidgetPairForColumn(const int column);
QLabel* m_infoLabel = nullptr;
QLineEdit* m_infoEdit = nullptr;
QLabel* m_amountLabel = nullptr;
QSpinBox* m_amountBox = nullptr;
QLabel* m_factorLabel = nullptr;
QDoubleSpinBox* m_factorBox = nullptr;
void addItemToModel();
void resetContent();
};
#endif // NEWITEMDIALOG_H