ConfigExpertWidget.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include "ConfigExpertWidget.h"
  2. #include <QBoxLayout>
  3. #include <QSplitter>
  4. #include <QLabel>
  5. ConfigExpertWidget::ConfigExpertWidget(QWidget *parent) : QWidget(parent)
  6. {
  7. initialize();
  8. initLayout();
  9. connectSignalsAndSlots();
  10. }
  11. void ConfigExpertWidget::initialize()
  12. {
  13. QPalette pal(palette());
  14. pal.setColor(QPalette::Background, QColor("#eeeeee"));
  15. setAutoFillBackground(true);
  16. setPalette(pal);
  17. m_vBoxLayout = new QVBoxLayout(this);
  18. m_titleLabel = new QLabel("配置专家", this);
  19. m_titleLabel->setObjectName("titleLabel");
  20. m_splitter = new QSplitter(Qt::Vertical, this);
  21. m_splitter->setChildrenCollapsible(false);
  22. }
  23. void ConfigExpertWidget::initLayout()
  24. {
  25. m_vBoxLayout->setMargin(0);
  26. m_vBoxLayout->addWidget(m_titleLabel);
  27. m_vBoxLayout->addWidget(m_splitter);
  28. QWidget *w1 = new QWidget();
  29. QWidget *w2 = new QWidget();
  30. w1->setMinimumHeight(100);
  31. w2->setMinimumHeight(100);
  32. w1->setStyleSheet("background-color:#f4f4f4");
  33. w2->setStyleSheet("background-color:#f4f4f4");
  34. m_splitter->addWidget(w1);
  35. m_splitter->addWidget(w2);
  36. m_splitter->setStretchFactor(0, 2);
  37. m_splitter->setStretchFactor(1, 3);
  38. }
  39. void ConfigExpertWidget::connectSignalsAndSlots() { }