diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiComboBoxEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiComboBoxEditor.cpp index e6955de851..75a4879dfb 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiComboBoxEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiComboBoxEditor.cpp @@ -227,6 +227,11 @@ void PdmUiComboBoxEditor::configureAndUpdateUi(const QString& uiConfigName) m_comboBox->setEditable(true); } + if (m_attributes.minimumWidth != -1) + { + m_comboBox->setMinimumWidth(m_attributes.minimumWidth); + } + m_comboBox->blockSignals(false); } @@ -405,13 +410,16 @@ void PdmUiComboBoxEditor::slotIndexActivated(int index) { if (m_attributes.enableEditableContent) { - // Use the text directly, as the selected item text could be entered directly by the user + // Use the text directly, as the item text could be entered directly by the user auto text = m_comboBox->itemText(index); this->setValueToField(text); } else { + // Use index as data carrier to PDM field + // The index will be used as a lookup in a list of option items + QVariant v; v = index; diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiComboBoxEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiComboBoxEditor.h index cfc00c578b..d421b70cee 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiComboBoxEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiComboBoxEditor.h @@ -62,6 +62,7 @@ public: showPreviousAndNextButtons = false; minimumContentsLength = 8; enableEditableContent = false; + minimumWidth = -1; } public: @@ -70,10 +71,10 @@ public: int minimumContentsLength; // The length of string to adjust to if adjustWidthToContents = false. // Set to <= 0 to ignore and use AdjustToContentsOnFirstShow instead + bool enableEditableContent; + int minimumWidth; QString nextButtonText; QString prevButtonText; - - bool enableEditableContent; };