#ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include #include #include QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE class MainWindow : public QMainWindow { Q_OBJECT enum eStateLevel: quint8 { createRoot, createDatabase, createTable, createField, editDatabase, editTable, editField }; enum eElementType:quint8 { root, database, table, field, unknown }; public: MainWindow(QWidget *parent = nullptr); ~MainWindow(); private slots: void on_actionCreate_Database_triggered(); void on_Append_btn_clicked(); void on_actionAdd_Table_triggered(); void on_actionAdd_Field_triggered(); void on_chbIsForignKey_stateChanged(int arg1); void on_cmbTablsName_currentIndexChanged(int index); void on_treeView_doubleClicked(const QModelIndex &index); void on_cmbType_currentTextChanged(const QString &arg1); void on_actionsave_triggered(); void on_actionEdit_Database_triggered(); private: Ui::MainWindow *ui; QStandardItemModel *_model; QString _fileName; int _state = 0; QDomDocument _xmlDoc; QString _xmlAddress; QDomElement _root; QVector _DBNameVector; QVector _DBElementVector; QDomElement _lastDBElement; QDomElement _lastTableElement; QDomElement _lastFieldElement; QDomElement* _lastDBPointer; void readFile(); void readFile(QDomDocument xmlInput); void writeFile(); void hideWidgets(); eElementType getElementType(QModelIndex indInput); }; #endif // MAINWINDOW_H