Organize source files into src subdirectories (gui/forms, gui/widgets, models, utils); replace magic numbers with ElementType enumeration in formproduct.cpp and formbudget.cpp (TODO completed); move mainwindow and related files to src/gui/
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
#ifndef FORMBUDGET_H
|
||||
#define FORMBUDGET_H
|
||||
|
||||
#include "formbase.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
class QString;
|
||||
class TreeItem;
|
||||
class QSqlQuery;
|
||||
class QAbstractItemModel;
|
||||
class TreeModel;
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class formBudget;
|
||||
}
|
||||
|
||||
class formBudget : public formBase
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit formBudget(QString aID = "", int aEditMode = 0, QWidget *parent = nullptr);
|
||||
~formBudget() override;
|
||||
|
||||
//void openDocument(QString id);
|
||||
void newDocument() override;
|
||||
void openDocument(QString id) override;
|
||||
void save() override;
|
||||
bool needsave() override;
|
||||
void setEditMode(bool aMode) override;
|
||||
void closeDocument() override;
|
||||
private slots:
|
||||
void on_editPrice_textChanged(const QString &arg1);
|
||||
void on_buttonInsertRow_released();
|
||||
void on_buttonInsertChild_released();
|
||||
void on_buttonPercent_released();
|
||||
void on_buttonRemoveRow_released();
|
||||
void on_buttonMaterials_released();
|
||||
void on_buttoMachinary_released();
|
||||
void on_buttonManpower_released();
|
||||
void on_buttonValidate_released();
|
||||
void on_buttonSave_released();
|
||||
void on_ModelSetData(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);
|
||||
void on_tabWidget_currentChanged(int index);
|
||||
|
||||
private:
|
||||
TreeModel *m_treeModel;
|
||||
Ui::formBudget *ui;
|
||||
|
||||
void setLineType(QString type, QModelIndex index);
|
||||
void setCellText(QString val, QModelIndex index, int col);
|
||||
bool InsertElement(QString ID, QModelIndex index);
|
||||
void saveModel(QSqlQuery qry, QString aCommand, QAbstractItemModel *aModel, int aLevel);
|
||||
void setupTreeView();
|
||||
void setupDelegates();
|
||||
void setupConnections();
|
||||
void initializeDocument();
|
||||
|
||||
|
||||
protected:
|
||||
virtual void focusInEvent(QFocusEvent *event) override;
|
||||
virtual void focusOutEvent(QFocusEvent *event) override;
|
||||
};
|
||||
|
||||
#endif // FORMBUDGET_H
|
||||
Reference in New Issue
Block a user