2025-03-14 16:06:20 +08:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
|
#include <QSqlError>
|
|
|
|
|
#include "global.h"
|
|
|
|
|
#include "messageDialog.h"
|
|
|
|
|
|
|
|
|
|
class DatabaseManager;
|
2025-03-18 18:35:30 +08:00
|
|
|
class DatabaseBrowser;
|
2025-03-14 16:06:20 +08:00
|
|
|
class ConnectionDialog;
|
|
|
|
|
class DBStructureView;
|
|
|
|
|
class DBStructureModel;
|
|
|
|
|
class ModelInfoEditDialog;
|
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
namespace Ui {
|
|
|
|
|
class MainWindow;
|
|
|
|
|
}
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
MainWindow(QWidget *parent = nullptr);
|
|
|
|
|
~MainWindow();
|
|
|
|
|
|
|
|
|
|
void showMessageDialog(MessageDialogType,const QString&,const QString&);
|
|
|
|
|
void hideMessageDialog();
|
|
|
|
|
const QString getCurConnection();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
bool eventFilter(QObject*, QEvent*) override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void initialize();
|
|
|
|
|
|
|
|
|
|
Ui::MainWindow *ui;
|
|
|
|
|
DatabaseManager* m_dbManager;
|
2025-03-18 18:35:30 +08:00
|
|
|
DatabaseBrowser* m_dbBrowser;
|
2025-03-14 16:06:20 +08:00
|
|
|
QSqlError m_lastSqlError;
|
|
|
|
|
MessageDialog* m_pMessageDialog;
|
|
|
|
|
ConnectionDialog* m_pConnectionDialog;
|
|
|
|
|
DBStructureView* m_pDBStrutureView;
|
|
|
|
|
DBStructureModel* m_pDBStrutureModel;
|
|
|
|
|
ModelInfoEditDialog* m_pModelInfoDialog;
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void onActionTrigger_connect();
|
|
|
|
|
void onActionTrigger_disconnect();
|
|
|
|
|
void onActionTrigger_addModel();
|
|
|
|
|
void onActionTrigger_removeModel();
|
|
|
|
|
|
|
|
|
|
void onSIG_addConnection(DatabaseConfig&);
|
2025-04-02 18:29:56 +08:00
|
|
|
void onSIG_errorFromDBManger(const QString& strConnectionName, const QString& error);
|
2025-03-14 16:06:20 +08:00
|
|
|
void onSIG_errorFormSQLExecutor(const QString& error);
|
|
|
|
|
void onSIG_connectionStatusChanged(const QString& strConnectionName, bool bConnected);
|
|
|
|
|
void onSIG_addModel(Model&);
|
2025-03-24 18:13:06 +08:00
|
|
|
void onSIG_openAttributeInfo(const QString&, ModelAttributeGroup&);
|
2025-03-14 16:06:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|