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:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user