PowerModeler/include/mainwindow.h

79 lines
2.2 KiB
C
Raw Normal View History

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;
class DatabaseBrowser;
2025-03-14 16:06:20 +08:00
class ConnectionDialog;
class DBStructureView;
class DBStructureModel;
class ModelInfoEditDialog;
2025-04-18 18:44:26 +08:00
class GroupSelectionDialog;
class AttributeSelector;
2025-03-14 16:06:20 +08:00
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;
2025-04-11 17:14:17 +08:00
void resizeEvent(QResizeEvent*) override;
2025-03-14 16:06:20 +08:00
private:
void initialize();
Ui::MainWindow *ui;
DatabaseManager* m_dbManager;
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;
2025-04-18 18:44:26 +08:00
GroupSelectionDialog* m_pGroupSelectionDialog;
AttributeSelector* m_pAttributeSelector;
2025-03-14 16:06:20 +08:00
private slots:
void onActionTrigger_connect();
void onActionTrigger_disconnect();
void onActionTrigger_addModel();
void onActionTrigger_updateModel(int);
2025-03-14 16:06:20 +08:00
void onActionTrigger_removeModel();
2025-04-18 18:44:26 +08:00
void onActionTrigger_addGroup(int);
2025-03-14 16:06:20 +08:00
2025-05-26 16:50:46 +08:00
void onSIG_addConnection(const DatabaseConfig&);
void onSIG_updateConnectionInfo(const DatabaseConfig&);
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-04-18 18:44:26 +08:00
void onSIG_addGroups(int, QVector<int>);
void onSIG_updateModelNodeText(int, const QString&);
//void onSIG_addAttributes();
void onSIG_openAttributeInfo(const QString&, ModelAttributeGroup&);
2025-04-17 15:34:43 +08:00
void onSIG_closeAttributeInfo(ModelAttributeGroup&);
void onSIG_disconnect();
void onSIG_openAttributeSelector();
2025-03-14 16:06:20 +08:00
};
#endif // MAINWINDOW_H