48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
#ifndef DBSTRUCTUREVIEW_H
|
|
#define DBSTRUCTUREVIEW_H
|
|
|
|
#include "global.h"
|
|
#include <QTreeView>
|
|
|
|
class MainWindow;
|
|
class DatabaseManager;
|
|
class DBStructureNode;
|
|
class DBStructureView : public QTreeView
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit DBStructureView(DatabaseManager* dbManager, QWidget* parent = nullptr);
|
|
~DBStructureView();
|
|
|
|
void setMainWindow(MainWindow*);
|
|
|
|
void disconnectCurConnection();
|
|
const QString curConnection();
|
|
|
|
void onActionTrigger_removeModel();
|
|
|
|
protected:
|
|
void mouseDoubleClickEvent(QMouseEvent* event) override;
|
|
|
|
private:
|
|
MainWindow* m_pMainWindow;
|
|
DatabaseManager* m_dbManager;
|
|
QString m_curConnection; //用来记录当前链接,只能存在一个链接
|
|
|
|
void initView();
|
|
void connectToDB(const QString&);
|
|
void disconnectToDB(const QString&);
|
|
void removeNode(DBStructureNode*);
|
|
|
|
signals:
|
|
void actionTrigger_addModel();
|
|
void openAttributeInfo(const QString&, ModelAttributeGroup&);
|
|
|
|
private slots:
|
|
void itemDoubleClick(const QModelIndex&);
|
|
void showContextMenu(const QPoint&);
|
|
};
|
|
|
|
#endif //DBSTRUCTUREVIEW_H
|