2025-03-24 18:13:06 +08:00
|
|
|
#ifndef DBBROWSER_H
|
|
|
|
|
#define DBBROWSER_H
|
|
|
|
|
|
|
|
|
|
#include "global.h"
|
2025-03-26 15:57:08 +08:00
|
|
|
#include "messageDialog.h"
|
2025-03-18 18:35:30 +08:00
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
namespace Ui {
|
|
|
|
|
class DatabaseBrowser;
|
|
|
|
|
}
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2025-03-26 15:57:08 +08:00
|
|
|
class MainWindow;
|
2025-03-24 18:13:06 +08:00
|
|
|
class AttributeView;
|
2025-03-18 18:35:30 +08:00
|
|
|
class DatabaseBrowser : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
DatabaseBrowser(QWidget *parent = nullptr);
|
|
|
|
|
~DatabaseBrowser();
|
|
|
|
|
|
2025-03-26 15:57:08 +08:00
|
|
|
void setMainWindow(MainWindow*);
|
2025-03-24 18:13:06 +08:00
|
|
|
void addTab_attribute(const QString&, ModelAttributeGroup&);
|
2025-04-17 15:34:43 +08:00
|
|
|
void closeTab_attribute(ModelAttributeGroup&);
|
2025-04-25 11:49:03 +08:00
|
|
|
void closeAllTab_attribute();
|
2025-06-04 18:41:55 +08:00
|
|
|
void updateTabTextByModelNameChanged(const QString&, const QString&);
|
2025-03-24 18:13:06 +08:00
|
|
|
|
2025-05-19 11:04:46 +08:00
|
|
|
protected:
|
|
|
|
|
bool eventFilter(QObject*, QEvent*) override;
|
|
|
|
|
|
2025-03-24 18:13:06 +08:00
|
|
|
private slots:
|
2025-03-25 17:58:48 +08:00
|
|
|
void onTabCloseRequested(int);
|
|
|
|
|
void onCurrentTabChanged(int);
|
2025-03-25 20:53:15 +08:00
|
|
|
void onSyncDataStatus(bool, const PaginationInfo&);
|
2025-03-26 15:57:08 +08:00
|
|
|
void onShowMessage(MessageDialogType,const QString&,const QString&);
|
2025-03-24 18:13:06 +08:00
|
|
|
|
2025-04-29 17:54:44 +08:00
|
|
|
void onBtnClicked_selectRecord();
|
2025-03-27 21:01:25 +08:00
|
|
|
void onBtnClicked_addRecord();
|
|
|
|
|
void onBtnClicked_removeRecord();
|
2025-04-01 14:37:41 +08:00
|
|
|
void onBtnClicked_submitChanges();
|
2025-04-02 15:57:00 +08:00
|
|
|
void onBtnClicked_cancleChanges();
|
|
|
|
|
void onBtnClicked_refreshData();
|
2025-03-27 21:01:25 +08:00
|
|
|
|
2025-04-25 11:49:03 +08:00
|
|
|
void onBtnClicked_firstPage();
|
|
|
|
|
void onBtnClicked_previousPage();
|
|
|
|
|
void onBtnClicked_nextPage();
|
|
|
|
|
void onBtnClicked_lastPage();
|
|
|
|
|
void onEditingFinished_page();
|
|
|
|
|
|
2025-05-08 09:30:47 +08:00
|
|
|
public slots:
|
|
|
|
|
void processAttributeSelectedData(QVector<QVector<QVariant>>);
|
|
|
|
|
|
2025-03-18 18:35:30 +08:00
|
|
|
private:
|
2025-03-24 19:55:01 +08:00
|
|
|
int tabIndex(const QString&);
|
|
|
|
|
|
2025-03-18 18:35:30 +08:00
|
|
|
Ui::DatabaseBrowser *ui;
|
2025-03-26 15:57:08 +08:00
|
|
|
MainWindow* m_pMainWindow;
|
2025-03-24 18:13:06 +08:00
|
|
|
QList<AttributeView> m_attributeViewList;
|
2025-04-25 11:49:03 +08:00
|
|
|
int m_previousTabIndex;
|
2025-04-29 17:54:44 +08:00
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void openAttributeSelector();
|
2025-03-18 18:35:30 +08:00
|
|
|
};
|
2025-03-24 18:13:06 +08:00
|
|
|
|
|
|
|
|
#endif //DBBROWSER_H
|