| 107 | } |
| 108 | |
| 109 | QWidget *SmartUTWidget::createMainWidget() |
| 110 | { |
| 111 | auto createButton = [this](const QString &icon, const QString &tips) { |
| 112 | auto btn = new DToolButton(this); |
| 113 | btn->setIconSize({ 16, 16 }); |
| 114 | btn->setIcon(QIcon::fromTheme(icon)); |
| 115 | btn->setToolTip(tips); |
| 116 | return btn; |
| 117 | }; |
| 118 | |
| 119 | QWidget *widget = new QWidget(this); |
| 120 | QVBoxLayout *layout = new QVBoxLayout(widget); |
| 121 | layout->setContentsMargins(0, 0, 0, 0); |
| 122 | layout->setSpacing(0); |
| 123 | |
| 124 | prjView = new ProjectTreeView(ProjectTreeView::UnitTest, this); |
| 125 | modelCB = new DComboBox(this); |
| 126 | modelCB->addItems(SmartUTManager::instance()->modelList()); |
| 127 | generateBtn = createButton("uc_generate", tr("Generate unit test files")); |
| 128 | continueBtn = createButton("uc_run", tr("Continue to generate")); |
| 129 | stopBtn = createButton("uc_stop", tr("Stop")); |
| 130 | stopBtn->setEnabled(false); |
| 131 | |
| 132 | QHBoxLayout *bottomLayout = new QHBoxLayout; |
| 133 | bottomLayout->setContentsMargins(10, 10, 10, 10); |
| 134 | bottomLayout->addWidget(new DLabel(tr("Select Model:"), this)); |
| 135 | bottomLayout->addWidget(modelCB, 1); |
| 136 | bottomLayout->addWidget(continueBtn); |
| 137 | bottomLayout->addWidget(generateBtn); |
| 138 | bottomLayout->addWidget(stopBtn); |
| 139 | |
| 140 | layout->addWidget(prjView, 1); |
| 141 | layout->addWidget(new DHorizontalLine(this)); |
| 142 | layout->addLayout(bottomLayout); |
| 143 | |
| 144 | return widget; |
| 145 | } |
| 146 | |
| 147 | void SmartUTWidget::setProjectList(const QString &workspace, const QStringList &fileList) |
| 148 | { |
nothing calls this directly
no test coverage detected