Skip to content

Commit

Permalink
ticket:4421
Browse files Browse the repository at this point in the history
Show a fixed value when there is only one unit.
  • Loading branch information
adeas31 committed Jun 1, 2017
1 parent 5215a82 commit 1830335
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion OMEdit/OMEditGUI/Component/ComponentProperties.cpp
Expand Up @@ -742,7 +742,14 @@ void ComponentParameters::setUpDialog()
pGroupBoxGridLayout->addItem(new QSpacerItem(1, 1), layoutIndex, columnIndex++);
}
if (pParameter->getUnitComboBox()->count() > 0) { // only add the unit combobox if we really have a unit
pGroupBoxGridLayout->addWidget(pParameter->getUnitComboBox(), layoutIndex, columnIndex++);
/* ticket:4421
* Show a fixed value when there is only one unit.
*/
if (pParameter->getUnitComboBox()->count() == 1) {
pGroupBoxGridLayout->addWidget(new Label(pParameter->getUnitComboBox()->currentText()), layoutIndex, columnIndex++);
} else {
pGroupBoxGridLayout->addWidget(pParameter->getUnitComboBox(), layoutIndex, columnIndex++);
}
} else {
pGroupBoxGridLayout->addItem(new QSpacerItem(1, 1), layoutIndex, columnIndex++);
}
Expand Down

0 comments on commit 1830335

Please sign in to comment.