SchemeWidget.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #include "SchemeWidget.h"
  2. #include "SchemeOptionWidget.h"
  3. #include <QBoxLayout>
  4. #include <QTableWidget>
  5. SchemeWidget::SchemeWidget(QWidget *parent) : QDialog(parent)
  6. {
  7. initWindow();
  8. initialize();
  9. initLayout();
  10. connectSignalsAndSlots();
  11. }
  12. void SchemeWidget::initWindow()
  13. {
  14. setWindowTitle("评估方案");
  15. setModal(true);
  16. setWindowFlags(Qt::Dialog);
  17. setWindowFlag(Qt::WindowContextHelpButtonHint, false);
  18. resize(1000, 600);
  19. }
  20. void SchemeWidget::initialize()
  21. {
  22. m_hBoxLayout = new QHBoxLayout(this);
  23. m_tableWidget = new QTableWidget(this);
  24. m_optionWidget = new SchemeOptionWidget(this);
  25. m_optionWidget->setFixedWidth(200);
  26. setStyleSheet("QTableWidget {border: 1px solid rgba(0, 0, 0, 0.073);background: rgb(244, 244, "
  27. "255);alternate-background-color: rgb(255, 255, 255);}"
  28. "QHeaderView::section {"
  29. "background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,"
  30. "stop:0 #616161, stop: 0.5 #505050,"
  31. "stop: 0.6 #434343, stop:1 #656565);"
  32. "color: white;"
  33. "padding-left: 4px;"
  34. "border: 1px solid #6c6c6c;"
  35. "}");
  36. }
  37. void SchemeWidget::initLayout()
  38. {
  39. m_hBoxLayout->addWidget(m_tableWidget);
  40. m_hBoxLayout->addWidget(m_optionWidget);
  41. }
  42. void SchemeWidget::connectSignalsAndSlots() { }