| 241 | } |
| 242 | |
| 243 | QLayout * DeviceOptions::get_property_form(QWidget * parent) |
| 244 | { |
| 245 | QGridLayout *const layout = new QGridLayout(parent); |
| 246 | layout->setVerticalSpacing(2); |
| 247 | const auto &properties =_device_options_binding.properties(); |
| 248 | |
| 249 | QFont font = this->font(); |
| 250 | font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); |
| 251 | |
| 252 | int i = 0; |
| 253 | for(auto p : properties) |
| 254 | { |
| 255 | const QString label = p->labeled_widget() ? QString() : p->label(); |
| 256 | QString lable_text = ""; |
| 257 | |
| 258 | if (label != ""){ |
| 259 | QByteArray bytes = label.toLocal8Bit(); |
| 260 | const char *lang_str = LangResource::Instance()->get_lang_text(STR_PAGE_DSL, bytes.data(), bytes.data()); |
| 261 | lable_text = QString(lang_str); |
| 262 | } |
| 263 | |
| 264 | QLabel *lb = new QLabel(lable_text, parent); |
| 265 | lb->setFont(font); |
| 266 | layout->addWidget(lb, i, 0); |
| 267 | |
| 268 | if (label == QString("Operation Mode")){ |
| 269 | QWidget *wid = p->get_widget(parent, true); |
| 270 | wid->setFont(font); |
| 271 | layout->addWidget(wid, i, 1); |
| 272 | } |
| 273 | else{ |
| 274 | QWidget *wid = p->get_widget(parent); |
| 275 | wid->setFont(font); |
| 276 | layout->addWidget(wid, i, 1); |
| 277 | } |
| 278 | layout->setRowMinimumHeight(i, 22); |
| 279 | i++; |
| 280 | } |
| 281 | |
| 282 | _groupHeight1 = parent->sizeHint().height() + 30; |
| 283 | |
| 284 | parent->setFixedHeight(_groupHeight1); |
| 285 | |
| 286 | return layout; |
| 287 | } |
| 288 | |
| 289 | void DeviceOptions::logic_probes(QVBoxLayout &layout) |
| 290 | { |
nothing calls this directly
no test coverage detected