68 lines
1.6 KiB
C++
68 lines
1.6 KiB
C++
#ifndef DBBROWSER_H
|
|
#define DBBROWSER_H
|
|
|
|
#include "global.h"
|
|
#include "messageDialog.h"
|
|
#include <QWidget>
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui {
|
|
class DatabaseBrowser;
|
|
}
|
|
QT_END_NAMESPACE
|
|
|
|
class MainWindow;
|
|
class AttributeView;
|
|
class DatabaseBrowser : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
DatabaseBrowser(QWidget *parent = nullptr);
|
|
~DatabaseBrowser();
|
|
|
|
void setMainWindow(MainWindow*);
|
|
void addTab_attribute(const QString&, ModelAttributeGroup&);
|
|
void closeTab_attribute(ModelAttributeGroup&);
|
|
void closeAllTab_attribute();
|
|
void updateTabTextByModelNameChanged(const QString&, const QString&);
|
|
|
|
protected:
|
|
bool eventFilter(QObject*, QEvent*) override;
|
|
|
|
private slots:
|
|
void onTabCloseRequested(int);
|
|
void onCurrentTabChanged(int);
|
|
void onSyncDataStatus(bool, const PaginationInfo&);
|
|
void onShowMessage(MessageDialogType,const QString&,const QString&);
|
|
|
|
void onBtnClicked_selectRecord();
|
|
void onBtnClicked_addRecord();
|
|
void onBtnClicked_removeRecord();
|
|
void onBtnClicked_submitChanges();
|
|
void onBtnClicked_cancleChanges();
|
|
void onBtnClicked_refreshData();
|
|
|
|
void onBtnClicked_firstPage();
|
|
void onBtnClicked_previousPage();
|
|
void onBtnClicked_nextPage();
|
|
void onBtnClicked_lastPage();
|
|
void onEditingFinished_page();
|
|
|
|
public slots:
|
|
void processAttributeSelectedData(QVector<QVector<QVariant>>);
|
|
|
|
private:
|
|
int tabIndex(const QString&);
|
|
|
|
Ui::DatabaseBrowser *ui;
|
|
MainWindow* m_pMainWindow;
|
|
QList<AttributeView> m_attributeViewList;
|
|
int m_previousTabIndex;
|
|
|
|
signals:
|
|
void openAttributeSelector();
|
|
};
|
|
|
|
#endif //DBBROWSER_H
|