Changeset 7fa329cb in OpenModelica
- Timestamp:
- 2020-10-21T18:53:49+02:00 (4 years ago)
- Branches:
- maintenance/v1.16
- Children:
- 8dab0e9
- Parents:
- 7dc23f4
- git-author:
- Adrian Pop <adrian.pop@…> (10/18/20 23:26:07)
- git-committer:
- Adrian Pop <adrian.pop@…> (10/21/20 18:53:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OMEdit/OMEditLIB/Element/ElementProperties.cpp
rfeadc57b r7fa329cb 314 314 QString replaceable = "", replaceableText = ""; 315 315 QStringList enumerationLiterals, replaceableChoices; 316 316 317 switch (mValueType) { 317 318 case Parameter::Boolean: … … 348 349 if (!mDefaultValue.isEmpty()) { 349 350 mpValueComboBox->addItem(mDefaultValue, mDefaultValue); 351 mpValueComboBox->lineEdit()->setPlaceholderText(mDefaultValue); 350 352 } 351 353 else { … … 353 355 QString str = (pOMCProxy->getClassInformation(className)).comment; 354 356 if (!str.isEmpty()) { 355 str = " \"" + str + "\"";357 str = " - " + str; 356 358 } 357 359 replaceableText = className + str; 358 360 mpValueComboBox->addItem(replaceableText, replaceableText); 361 mpValueComboBox->lineEdit()->setPlaceholderText(replaceableText); 359 362 } 360 363 else { 361 364 replaceable = "redeclare " + className + " " + mpComponent->getName(); 362 365 mpValueComboBox->addItem(replaceable, replaceable); 366 mpValueComboBox->lineEdit()->setPlaceholderText(replaceable); 363 367 } 364 368 } 369 365 370 if (constrainedByClassName.contains("$Any")) { 366 371 constrainedByClassName = className; 367 372 } 373 368 374 replaceableChoices = pOMCProxy->getAllSubtypeOf(constrainedByClassName, mpComponent->getComponentInfo()->getParentClassName()); 369 375 for (i = 0 ; i < replaceableChoices.size(); i++) { … … 376 382 QString str = (pOMCProxy->getClassInformation(replaceableChoices[i])).comment; 377 383 if (!str.isEmpty()) { 378 str = " \"" + str + "\"";384 str = " - " + str; 379 385 } 380 386 replaceableText = replaceableChoices[i] + str; … … 390 396 } 391 397 392 QStandardItemModel *model = qobject_cast<QStandardItemModel *>(mpValueComboBox->model()); 393 if (model != NULL) 394 { 395 QStandardItem *item = model->item(0); 396 if (item != NULL) 397 item->setFlags(item->flags() & ~Qt::ItemIsEnabled); 398 } 398 // add a way to remove the modifiers 399 mpValueComboBox->addItem("[remove modifier]", ""); 399 400 400 401 connect(mpValueComboBox, SIGNAL(currentIndexChanged(int)), SLOT(valueComboBoxChanged(int)));
Note: See TracChangeset
for help on using the changeset viewer.