EXIndexView.cpp 898 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "EXIndexView.h"
  2. #include "dbService/ClassSet.h"
  3. #include "dbService/CNodeDataService.h"
  4. #include <CMindView.h>
  5. #include <QTabWidget>
  6. #include <QDebug>
  7. EXIndexView::EXIndexView(ProjectInfo *proj, QWidget *parent) : EXEvalView(proj, parent)
  8. {
  9. setTitle("指标体系");
  10. }
  11. void EXIndexView::setType(int type)
  12. {
  13. EXEvalView::setType(type);
  14. setupTabWidget();
  15. }
  16. void EXIndexView::setupTabWidget()
  17. {
  18. m_tab->clear();
  19. for (int i : indexList()) {
  20. CMindView *m = new CMindView(this);
  21. m->setAllowEdit(false);
  22. ProjectManager::IndexType t = (ProjectManager::IndexType)i;
  23. QString s = ProjectManager::nameOfIndexType(t);
  24. m_tab->addTab(m, s);
  25. QList<CNodeData> list;
  26. bool ret = CNodeDataService().QueryAllValid(list, proj()->id, t);
  27. if (ret) {
  28. m->setNodeList(list);
  29. }
  30. }
  31. }