ProfessorInputTable.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef PROFESSORINPUTTABLE_H
  2. #define PROFESSORINPUTTABLE_H
  3. #include <QDialog>
  4. #include <QPushButton>
  5. #include <QStackedWidget>
  6. #include <QHBoxLayout>
  7. #include <QVBoxLayout>
  8. #include <QTableWidget>
  9. #include "dbService/ClassSet.h"
  10. namespace Ui {
  11. class ProfessorInputTable;
  12. }
  13. class ProfessorInputTable : public QDialog
  14. {
  15. Q_OBJECT
  16. public:
  17. explicit ProfessorInputTable(QWidget *parent = nullptr);
  18. ~ProfessorInputTable();
  19. void Init();
  20. void InitInterface();
  21. void addStackWidgetPage(int pages);
  22. bool IsTableEmpty(QTableWidget *tableWidget);
  23. bool IsQStringListEqual(QStringList tabList, QStringList nextList);
  24. QList<NodeMatrixInfo *> getTableWidgetContent(QString professorName);
  25. QList<NodeMatrixInfo *> getTableWidgetContent(QMap<int, QMap<QString, QTableWidget *>> pageTabAndCorrTables);
  26. QMap<int, QMap<QString, QTableWidget *>>
  27. setTableWidgetContent(QList<NodeMatrixInfo *> datas, QMap<int, QMap<QString, QTableWidget *>> pageTabAndCorrTables);
  28. int getStackedWidgetPages();
  29. void showTables();
  30. QMap<QString, QSet<QString>> getTabWidgetHeaderLabel(int currentStackWidgetPage);
  31. QTableWidget *createTable(QStringList tableNames);
  32. QTabWidget * createTabWidget(QMap<QString, QSet<QString>> corrElements, int currentPage);
  33. private:
  34. Ui::ProfessorInputTable *ui;
  35. private:
  36. QWidget *m_widget;
  37. QPushButton *lastPageBtn;
  38. QPushButton *nextPageBtn;
  39. QPushButton *restoreBtn;
  40. QFrame * m_frame;
  41. QStackedWidget *m_stackWidget;
  42. QVBoxLayout *mainLayout;
  43. QVBoxLayout *frameLayout;
  44. QHBoxLayout *btnLayout;
  45. private slots:
  46. void switchToNextPage();
  47. void switchToLastPage();
  48. void testfunction();
  49. private:
  50. int stackedWidgetPages;
  51. // QMap<int, QList<QTableWidget* >> pageAndCorrTables;
  52. // QList<QTableWidget* > tmpTables;
  53. QMap<int, QMap<QString, QTableWidget *>> pageTabAndCorrTables;
  54. QMap<QString, QTableWidget *> tabAndCorrTable;
  55. QList<NodeMatrixInfo *> datas;
  56. };
  57. #endif // PROFESSORINPUTTABLE_H