1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #ifndef MODELVIEWTABLE_H
- #define MODELVIEWTABLE_H
- #include <QDialog>
- #include <QFrame>
- #include <QStackedWidget>
- #include <QStandardItemModel>
- #include <QHBoxLayout>
- #include <QVBoxLayout>
- #include <QPushButton>
- #include <QTableView>
- #include "dbService/ClassSet.h"
- namespace Ui {
- class ModelViewTable;
- }
- class ModelViewTable : public QWidget
- {
- Q_OBJECT
- public:
- explicit ModelViewTable(QWidget *parent = nullptr);
- ~ModelViewTable();
- void init(QList<NodeMatrixInfo *> &infos);
- void setIndexForMessaureMethods(QStringList methods) { indexForMeasureMehods = methods; }
- void addStackWidgetPage(int pages);
- int getStackedWidgetPages(QList<NodeMatrixInfo *> datas);
- bool IsTableEmpty(QStandardItemModel *tableModel);
- bool IsQStringListEqual(QStringList tabList, QStringList nextList);
- QMap<QString, QSet<QString>> getTabWidgetHeaderLabel(int currentStackWidgetPage);
- QTabWidget * createTabWidget(QMap<QString, QSet<QString>> corrElements, int currentPage);
- QList<NodeMatrixInfo *> getTableViewContent(QMap<int, QMap<QString, QStandardItemModel *>> pageTabAndCorrTables);
- void setTableWidgetContent(QList<NodeMatrixInfo *> datas,
- QMap<int, QMap<QString, QStandardItemModel *>> pageTabAndCorrTables);
- QStandardItemModel *createModel(QStringList rowHeaderList, QStringList colHeaderList);
- private:
- QWidget *m_widget;
- QPushButton *lastPageBtn;
- QPushButton *nextPageBtn;
- QPushButton *restoreBtn;
- QFrame * m_frame;
- QStackedWidget *m_stackWidget;
- QVBoxLayout *mainLayout;
- QVBoxLayout *frameLayout;
- QHBoxLayout *btnLayout;
- QTableView *m_tableView;
- private:
- Ui::ModelViewTable *ui;
- private slots:
- void switchToNextPage();
- void switchToLastPage();
- void saveResult();
- private:
- int stackedWidgetPages;
- // QMap<int, QList<QTableWidget* >> pageAndCorrTables;
- // QList<QTableWidget* > tmpTables;
- QMap<int, QMap<QString, QStandardItemModel *>> pageTabAndCorrTableModels;
- QMap<QString, QStandardItemModel *> tabAndCorrTableModel;
- QList<NodeMatrixInfo *> datas;
- QStringList indexForMeasureMehods;
- };
- #endif // MODELVIEWTABLE_H
|