AppFwk : Rename to uiField() and setUiField()

This commit is contained in:
Magne Sjaastad 2018-06-15 14:22:03 +02:00
parent a801fd9cc5
commit 17ee25d0b2
25 changed files with 127 additions and 127 deletions

View File

@ -242,7 +242,7 @@ void RicSummaryCurveCreatorSplitterUi::configureAndUpdateFields(int widgetStartI
if (fieldEditor)
{
fieldEditor->setField(field);
fieldEditor->setUiField(field);
// Place the widget(s) into the correct parent and layout
QWidget* fieldCombinedWidget = fieldEditor->combinedWidget();

View File

@ -158,7 +158,7 @@ void RiuSummaryCurveDefSelectionEditor::configureAndUpdateFields(int widgetStart
if (fieldEditor)
{
fieldEditor->setField(field);
fieldEditor->setUiField(field);
// Place the widget(s) into the correct parent and layout
QWidget* fieldCombinedWidget = fieldEditor->combinedWidget();

View File

@ -74,7 +74,7 @@ PdmUiFieldEditorHandle::~PdmUiFieldEditorHandle()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void PdmUiFieldEditorHandle::setField(PdmUiFieldHandle * field)
void PdmUiFieldEditorHandle::setUiField(PdmUiFieldHandle * field)
{
this->bindToPdmItem(field);
@ -94,7 +94,7 @@ void PdmUiFieldEditorHandle::setField(PdmUiFieldHandle * field)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
PdmUiFieldHandle* PdmUiFieldEditorHandle::field()
PdmUiFieldHandle* PdmUiFieldEditorHandle::uiField()
{
return dynamic_cast<PdmUiFieldHandle*>(pdmItem());
}
@ -119,7 +119,7 @@ void PdmUiFieldEditorHandle::createWidgets(QWidget * parent)
//--------------------------------------------------------------------------------------------------
void PdmUiFieldEditorHandle::setValueToField(const QVariant& newUiValue)
{
PdmUiCommandSystemProxy::instance()->setUiValueToField(field(), newUiValue);
PdmUiCommandSystemProxy::instance()->setUiValueToField(uiField(), newUiValue);
}
//--------------------------------------------------------------------------------------------------
@ -154,9 +154,9 @@ void PdmUiFieldEditorHandle::updateLabelFromField(QLabel* label, const QString&
void PdmUiFieldEditorHandle::customMenuRequested(QPoint pos)
{
PdmObjectHandle* objectHandle = nullptr;
if (field() && field()->fieldHandle())
if (uiField() && uiField()->fieldHandle())
{
objectHandle = field()->fieldHandle()->ownerObject();
objectHandle = uiField()->fieldHandle()->ownerObject();
}
if (!objectHandle)
@ -182,7 +182,7 @@ void PdmUiFieldEditorHandle::customMenuRequested(QPoint pos)
}
QMenu menu;
objectHandle->uiCapability()->defineCustomContextMenu(field()->fieldHandle(), &menu, widget);
objectHandle->uiCapability()->defineCustomContextMenu(uiField()->fieldHandle(), &menu, widget);
if (!menu.actions().empty())
{

View File

@ -103,8 +103,8 @@ public:
PdmUiFieldEditorHandle();
~PdmUiFieldEditorHandle();
PdmUiFieldHandle* field();
void setField(PdmUiFieldHandle * field);
PdmUiFieldHandle* uiField();
void setUiField(PdmUiFieldHandle* uiFieldHandle);
void createWidgets(QWidget * parent);
QWidget* combinedWidget() { return m_combinedWidget; }

View File

@ -63,28 +63,28 @@ void PdmUiCheckBoxEditor::configureAndUpdateUi(const QString& uiConfigName)
CAF_ASSERT(!m_label.isNull());
PdmUiCheckBoxEditorAttribute attributes;
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &attributes);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &attributes);
}
if (attributes.m_useNativeCheckBoxLabel)
{
m_checkBox->setText(field()->uiName(uiConfigName));
m_checkBox->setText(uiField()->uiName(uiConfigName));
m_label->setEnabled(!field()->isUiReadOnly(uiConfigName));
m_label->setToolTip(field()->uiToolTip(uiConfigName));
m_label->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
m_label->setToolTip(uiField()->uiToolTip(uiConfigName));
}
else
{
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
}
m_checkBox->setEnabled(!field()->isUiReadOnly(uiConfigName));
m_checkBox->setToolTip(field()->uiToolTip(uiConfigName));
m_checkBox->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
m_checkBox->setToolTip(uiField()->uiToolTip(uiConfigName));
m_checkBox->setChecked(field()->uiValue().toBool());
m_checkBox->setChecked(uiField()->uiValue().toBool());
}

View File

@ -30,10 +30,10 @@ void PdmUiCheckBoxTristateEditor::configureAndUpdateUi(const QString& uiConfigNa
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
m_checkBox->setEnabled(!field()->isUiReadOnly(uiConfigName));
m_checkBox->setToolTip(field()->uiToolTip(uiConfigName));
m_checkBox->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
m_checkBox->setToolTip(uiField()->uiToolTip(uiConfigName));
Tristate state = field()->uiValue().value<Tristate>();
Tristate state = uiField()->uiValue().value<Tristate>();
if (state == Tristate::State::True)
{

View File

@ -76,13 +76,13 @@ void PdmUiColorEditor::configureAndUpdateUi(const QString& uiConfigName)
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &m_attributes);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &m_attributes);
}
QColor col = field()->uiValue().value<QColor>();
QColor col = uiField()->uiValue().value<QColor>();
setColor(col);
}

View File

@ -66,18 +66,18 @@ void PdmUiComboBoxEditor::configureAndUpdateUi(const QString& uiConfigName)
// Handle attributes
PdmUiComboBoxEditorAttribute attributes;
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &attributes);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &attributes);
}
if (!m_comboBox.isNull())
{
m_comboBox->setEnabled(!field()->isUiReadOnly(uiConfigName));
m_comboBox->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
bool fromMenuOnly = true;
QList<PdmOptionItemInfo> options = field()->valueOptions(&fromMenuOnly);
QList<PdmOptionItemInfo> options = uiField()->valueOptions(&fromMenuOnly);
CAF_ASSERT(fromMenuOnly); // Not supported
m_comboBox->blockSignals(true);
@ -88,11 +88,11 @@ void PdmUiComboBoxEditor::configureAndUpdateUi(const QString& uiConfigName)
{
m_comboBox->addItem(options[i].icon(), options[i].optionUiText());
}
m_comboBox->setCurrentIndex(field()->uiValue().toInt());
m_comboBox->setCurrentIndex(uiField()->uiValue().toInt());
}
else
{
m_comboBox->addItem(field()->uiValue().toString());
m_comboBox->addItem(uiField()->uiValue().toString());
m_comboBox->setCurrentIndex(0);
}

View File

@ -73,12 +73,12 @@ void PdmUiDateEditor::configureAndUpdateUi(const QString& uiConfigName)
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
m_dateEdit->setEnabled(!field()->isUiReadOnly(uiConfigName));
m_dateEdit->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &m_attributes);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &m_attributes);
}
if (!m_attributes.dateFormat.isEmpty())
@ -86,7 +86,7 @@ void PdmUiDateEditor::configureAndUpdateUi(const QString& uiConfigName)
m_dateEdit->setDisplayFormat(m_attributes.dateFormat);
}
m_dateEdit->setDate(field()->uiValue().toDate());
m_dateEdit->setDate(uiField()->uiValue().toDate());
}

View File

@ -90,17 +90,17 @@ void PdmUiDoubleSliderEditor::configureAndUpdateUi(const QString& uiConfigName)
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
m_lineEdit->setEnabled(!field()->isUiReadOnly(uiConfigName));
m_slider->setEnabled(!field()->isUiReadOnly(uiConfigName));
m_lineEdit->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
m_slider->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &m_attributes);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &m_attributes);
}
double doubleValue = field()->uiValue().toDouble();
QString textValue = field()->uiValue().toString();
double doubleValue = uiField()->uiValue().toDouble();
QString textValue = uiField()->uiValue().toString();
m_slider->blockSignals(true);
m_slider->setMaximum(m_attributes.m_sliderTickCount);

View File

@ -71,16 +71,16 @@ void PdmUiDoubleValueEditor::configureAndUpdateUi(const QString& uiConfigName)
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
m_lineEdit->setEnabled(!field()->isUiReadOnly(uiConfigName));
m_lineEdit->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &m_attributes);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &m_attributes);
}
bool valueOk = false;
double value = field()->uiValue().toDouble(&valueOk);
double value = uiField()->uiValue().toDouble(&valueOk);
QString textValue;
if (valueOk)
{
@ -88,7 +88,7 @@ void PdmUiDoubleValueEditor::configureAndUpdateUi(const QString& uiConfigName)
}
else
{
textValue = field()->uiValue().toString();
textValue = uiField()->uiValue().toString();
}
m_lineEdit->setText(textValue);

View File

@ -67,16 +67,16 @@ void PdmUiFilePathEditor::configureAndUpdateUi(const QString& uiConfigName)
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
m_lineEdit->setEnabled(!field()->isUiReadOnly(uiConfigName));
m_lineEdit->setToolTip(field()->uiToolTip(uiConfigName));
m_lineEdit->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
m_lineEdit->setToolTip(uiField()->uiToolTip(uiConfigName));
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &m_attributes);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &m_attributes);
}
m_lineEdit->setText(field()->uiValue().toString());
m_lineEdit->setText(uiField()->uiValue().toString());
if (m_attributes.m_appendUiSelectedFolderToText)
{

View File

@ -166,7 +166,7 @@ void PdmUiLineEditor::configureAndUpdateUi(const QString& uiConfigName)
if (!m_lineEdit.isNull())
{
bool isReadOnly = field()->isUiReadOnly(uiConfigName);
bool isReadOnly = uiField()->isUiReadOnly(uiConfigName);
if (isReadOnly)
{
m_lineEdit->setReadOnly(true);
@ -181,14 +181,14 @@ void PdmUiLineEditor::configureAndUpdateUi(const QString& uiConfigName)
m_lineEdit->setStyleSheet("");
}
m_lineEdit->setToolTip(field()->uiToolTip(uiConfigName));
m_lineEdit->setToolTip(uiField()->uiToolTip(uiConfigName));
{
PdmUiLineEditorAttribute leab;
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &leab);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &leab);
}
if (leab.useRangeValidator)
@ -199,30 +199,30 @@ void PdmUiLineEditor::configureAndUpdateUi(const QString& uiConfigName)
{
PdmUiLineEditorAttributeUniqueValues leab;
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &leab);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &leab);
}
if (leab.usedIds.size() > 0)
{
if (isMultipleFieldsWithSameKeywordSelected(field()->fieldHandle()))
if (isMultipleFieldsWithSameKeywordSelected(uiField()->fieldHandle()))
{
QMessageBox::information(nullptr, "Invalid operation", "The field you are manipulating is defined to have unique values. A selection of multiple fields is detected. Please select a single item.");
}
m_lineEdit->setValidator(new PdmUniqueIdValidator(leab.usedIds, isMultipleFieldsWithSameKeywordSelected(field()->fieldHandle()), leab.errorMessage, this));
m_lineEdit->setValidator(new PdmUniqueIdValidator(leab.usedIds, isMultipleFieldsWithSameKeywordSelected(uiField()->fieldHandle()), leab.errorMessage, this));
}
}
bool fromMenuOnly = true;
QList<PdmOptionItemInfo> enumNames = field()->valueOptions(&fromMenuOnly);
QList<PdmOptionItemInfo> enumNames = uiField()->valueOptions(&fromMenuOnly);
CAF_ASSERT(fromMenuOnly); // Not supported
if (!enumNames.isEmpty() && fromMenuOnly == true)
{
int enumValue = field()->uiValue().toInt();
int enumValue = uiField()->uiValue().toInt();
if (enumValue < enumNames.size() && enumValue > -1)
{
@ -232,16 +232,16 @@ void PdmUiLineEditor::configureAndUpdateUi(const QString& uiConfigName)
else
{
PdmUiLineEditorAttributeUiDisplayString leab;
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &leab);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &leab);
}
QString displayString;
if (leab.m_displayString.isEmpty())
{
displayString = field()->uiValue().toString();
displayString = uiField()->uiValue().toString();
}
else
{

View File

@ -164,13 +164,13 @@ void PdmUiListEditor::configureAndUpdateUi(const QString& uiConfigName)
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
m_listView->setEnabled(!field()->isUiReadOnly(uiConfigName));
m_listView->setToolTip(field()->uiToolTip(uiConfigName));
m_listView->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
m_listView->setToolTip(uiField()->uiToolTip(uiConfigName));
bool optionsOnly = true;
QList<PdmOptionItemInfo> options = field()->valueOptions(&optionsOnly);
QList<PdmOptionItemInfo> options = uiField()->valueOptions(&optionsOnly);
m_optionItemCount = options.size();
if (options.size() > 0 || field()->isUiReadOnly(uiConfigName))
if (options.size() > 0 || uiField()->isUiReadOnly(uiConfigName))
{
m_isEditOperationsAvailable = false;
}
@ -180,10 +180,10 @@ void PdmUiListEditor::configureAndUpdateUi(const QString& uiConfigName)
}
PdmUiListEditorAttribute attributes;
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &attributes);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &attributes);
QPalette myPalette(m_listView->palette());
myPalette.setColor(QPalette::Base, attributes.m_baseColor);
@ -205,11 +205,11 @@ void PdmUiListEditor::configureAndUpdateUi(const QString& uiConfigName)
QStringList texts = PdmOptionItemInfo::extractUiTexts(options);
strListModel->setStringList(texts);
QVariant fieldValue = field()->uiValue();
QVariant fieldValue = uiField()->uiValue();
if (fieldValue.type() == QVariant::Int || fieldValue.type() == QVariant::UInt)
{
int col = 0;
int row = field()->uiValue().toInt();
int row = uiField()->uiValue().toInt();
QModelIndex mi = strListModel->index(row, col);
@ -253,7 +253,7 @@ void PdmUiListEditor::configureAndUpdateUi(const QString& uiConfigName)
QItemSelection selection = m_listView->selectionModel()->selection();
QModelIndex currentItem = m_listView->selectionModel()->currentIndex();
QVariant fieldValue = field()->uiValue();
QVariant fieldValue = uiField()->uiValue();
QStringList texts = fieldValue.toStringList();
texts.push_back("");
strListModel->setStringList(texts);
@ -306,7 +306,7 @@ void PdmUiListEditor::slotSelectionChanged(const QItemSelection & selected, cons
{
if (m_optionItemCount == 0) return;
QVariant fieldValue = field()->uiValue();
QVariant fieldValue = uiField()->uiValue();
if (fieldValue.type() == QVariant::Int || fieldValue.type() == QVariant::UInt)
{
// NOTE : Workaround for update issue seen on RHEL6 with Qt 4.6.2
@ -331,7 +331,7 @@ void PdmUiListEditor::slotSelectionChanged(const QItemSelection & selected, cons
{
QModelIndexList idxList = m_listView->selectionModel()->selectedIndexes();
QVariant fieldValue = field()->uiValue();
QVariant fieldValue = uiField()->uiValue();
QList<QVariant> valuesSelectedInField = fieldValue.toList();
if (idxList.size() == 1 && valuesSelectedInField.size() == 1)

View File

@ -69,17 +69,17 @@ void PdmUiPushButtonEditor::configureAndUpdateUi(const QString& uiConfigName)
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
m_pushButton->setCheckable(true);
m_pushButton->setEnabled(!field()->isUiReadOnly(uiConfigName));
m_pushButton->setToolTip(field()->uiToolTip(uiConfigName));
m_pushButton->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
m_pushButton->setToolTip(uiField()->uiToolTip(uiConfigName));
PdmUiPushButtonEditorAttribute attributes;
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &attributes);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &attributes);
}
QVariant variantFieldValue = field()->uiValue();
QVariant variantFieldValue = uiField()->uiValue();
if (!attributes.m_buttonIcon.isNull())
{
@ -108,7 +108,7 @@ void PdmUiPushButtonEditor::configureAndUpdateUi(const QString& uiConfigName)
if (variantFieldValue.type() == QVariant::Bool)
{
m_pushButton->setChecked(field()->uiValue().toBool());
m_pushButton->setChecked(uiField()->uiValue().toBool());
}
}
@ -166,7 +166,7 @@ QWidget* PdmUiPushButtonEditor::createLabelWidget(QWidget * parent)
//--------------------------------------------------------------------------------------------------
void PdmUiPushButtonEditor::slotClicked(bool checked)
{
if (field() && dynamic_cast<PdmField<bool> *> (field()->fieldHandle()))
if (uiField() && dynamic_cast<PdmField<bool> *> (uiField()->fieldHandle()))
{
QVariant v;
v = checked;

View File

@ -65,16 +65,16 @@ void PdmUiSliderEditor::configureAndUpdateUi(const QString& uiConfigName)
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
m_spinBox->setEnabled(!field()->isUiReadOnly(uiConfigName));
m_spinBox->setToolTip(field()->uiToolTip(uiConfigName));
m_spinBox->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
m_spinBox->setToolTip(uiField()->uiToolTip(uiConfigName));
m_slider->setEnabled(!field()->isUiReadOnly(uiConfigName));
m_slider->setToolTip(field()->uiToolTip(uiConfigName));
m_slider->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
m_slider->setToolTip(uiField()->uiToolTip(uiConfigName));
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &m_attributes);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &m_attributes);
}
{
@ -90,7 +90,7 @@ void PdmUiSliderEditor::configureAndUpdateUi(const QString& uiConfigName)
m_slider->blockSignals(false);
}
QString textValue = field()->uiValue().toString();
QString textValue = uiField()->uiValue().toString();
m_spinBox->setValue(textValue.toInt());
updateSliderPosition();

View File

@ -90,11 +90,11 @@ void PdmUiTableView::setChildArrayField(PdmChildArrayFieldHandle* childArrayFiel
if (childArrayField)
{
m_listViewEditor->setField(childArrayField->uiCapability());
m_listViewEditor->setUiField(childArrayField->uiCapability());
}
else
{
m_listViewEditor->setField(nullptr);
m_listViewEditor->setUiField(nullptr);
}
// SIG_CAF_HACK

View File

@ -442,9 +442,9 @@ void PdmUiTableViewEditor::updateSelectionManagerFromTableSelection()
caf::PdmChildArrayFieldHandle* PdmUiTableViewEditor::childArrayFieldHandle()
{
caf::PdmChildArrayFieldHandle* childArrayFieldHandle = nullptr;
if (this->field())
if (this->uiField())
{
childArrayFieldHandle = dynamic_cast<PdmChildArrayFieldHandle*>(this->field()->fieldHandle());
childArrayFieldHandle = dynamic_cast<PdmChildArrayFieldHandle*>(this->uiField()->fieldHandle());
}
return childArrayFieldHandle;

View File

@ -353,7 +353,7 @@ void PdmUiTableViewQModel::setPdmData(PdmChildArrayFieldHandle* listField, const
std::map<QString, PdmUiFieldEditorHandle*>::iterator it;
for (it = m_fieldEditors.begin(); it != m_fieldEditors.end(); ++it)
{
it->second->setField(nullptr);
it->second->setUiField(nullptr);
}
m_modelColumnIndexToFieldIndex.clear();
@ -388,7 +388,7 @@ void PdmUiTableViewQModel::setPdmData(PdmChildArrayFieldHandle* listField, const
if (fieldEditor)
{
fieldEditor->setField(field);
fieldEditor->setUiField(field);
//TODO: Create/update is not required at this point, as UI is recreated in getEditorWidgetAndTransferOwnership()
// Can be moved, but a move will require changes in PdmUiFieldEditorHandle
@ -407,7 +407,7 @@ void PdmUiTableViewQModel::setPdmData(PdmChildArrayFieldHandle* listField, const
std::vector< QString > fvhToRemoveFromMap;
for (it = m_fieldEditors.begin(); it != m_fieldEditors.end(); ++it)
{
if (it->second->field() == nullptr)
if (it->second->uiField() == nullptr)
{
PdmUiFieldEditorHandle* fvh = it->second;
delete fvh;
@ -477,7 +477,7 @@ PdmUiFieldEditorHandle* PdmUiTableViewQModel::getEditor(const QModelIndex &index
{
if (field)
{
editor->setField(field->uiCapability());
editor->setUiField(field->uiCapability());
}
}
}

View File

@ -109,16 +109,16 @@ void PdmUiTextEditor::configureAndUpdateUi(const QString& uiConfigName)
PdmUiFieldEditorHandle::updateLabelFromField(m_label, uiConfigName);
m_textEdit->setReadOnly(field()->isUiReadOnly(uiConfigName));
m_textEdit->setReadOnly(uiField()->isUiReadOnly(uiConfigName));
//m_textEdit->setEnabled(!field()->isUiReadOnly(uiConfigName)); // Neccesary ?
m_textEdit->setToolTip(field()->uiToolTip(uiConfigName));
m_textEdit->setToolTip(uiField()->uiToolTip(uiConfigName));
PdmUiTextEditorAttribute leab;
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &leab);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &leab);
}
m_textMode = leab.textMode;
@ -138,10 +138,10 @@ void PdmUiTextEditor::configureAndUpdateUi(const QString& uiConfigName)
switch (leab.textMode)
{
case PdmUiTextEditorAttribute::PLAIN:
m_textEdit->setPlainText(field()->uiValue().toString());
m_textEdit->setPlainText(uiField()->uiValue().toString());
break;
case PdmUiTextEditorAttribute::HTML:
m_textEdit->setHtml(field()->uiValue().toString());
m_textEdit->setHtml(uiField()->uiValue().toString());
break;
}
m_textEdit->blockSignals(false);

View File

@ -166,7 +166,7 @@ void PdmUiToolBarEditor::configureAndUpdateUi(const QString& uiConfigName)
m_toolbar->addWidget(widget);
}
fieldEditor->setField(uiFieldHandle);
fieldEditor->setUiField(uiFieldHandle);
fieldEditor->updateUi(uiConfigName);
}
}

View File

@ -56,32 +56,32 @@ void PdmUiToolButtonEditor::configureAndUpdateUi(const QString& uiConfigName)
{
CAF_ASSERT(!m_toolButton.isNull());
QIcon ic = field()->uiIcon(uiConfigName);
QIcon ic = uiField()->uiIcon(uiConfigName);
if (!ic.isNull())
{
m_toolButton->setIcon(ic);
}
QString buttonText = field()->uiName(uiConfigName);
QString buttonText = uiField()->uiName(uiConfigName);
m_toolButton->setText(buttonText);
m_toolButton->setEnabled(!field()->isUiReadOnly(uiConfigName));
m_toolButton->setToolTip(field()->uiToolTip(uiConfigName));
m_toolButton->setEnabled(!uiField()->isUiReadOnly(uiConfigName));
m_toolButton->setToolTip(uiField()->uiToolTip(uiConfigName));
PdmUiToolButtonEditorAttribute attributes;
PdmUiObjectHandle* pdmUiOjectHandle = uiObj(field()->fieldHandle()->ownerObject());
PdmUiObjectHandle* pdmUiOjectHandle = uiObj(uiField()->fieldHandle()->ownerObject());
if (pdmUiOjectHandle)
{
pdmUiOjectHandle->editorAttribute(field()->fieldHandle(), uiConfigName, &attributes);
pdmUiOjectHandle->editorAttribute(uiField()->fieldHandle(), uiConfigName, &attributes);
}
bool isCheckable = attributes.m_checkable;
m_toolButton->setCheckable(isCheckable);
QVariant variantFieldValue = field()->uiValue();
QVariant variantFieldValue = uiField()->uiValue();
if (isCheckable)
{
m_toolButton->setChecked(field()->uiValue().toBool());
m_toolButton->setChecked(uiField()->uiValue().toBool());
}
}

View File

@ -250,12 +250,12 @@ void PdmUiTreeSelectionEditor::configureAndUpdateUi(const QString& uiConfigName)
}
bool optionsOnly = true;
QList<PdmOptionItemInfo> options = field()->valueOptions(&optionsOnly);
QList<PdmOptionItemInfo> options = uiField()->valueOptions(&optionsOnly);
bool itemCountHasChaged = false;
if (m_model->optionItemCount() != options.size()) itemCountHasChaged = true;
QVariant fieldValue = field()->uiValue();
QVariant fieldValue = uiField()->uiValue();
m_model->setUiValueCache(&fieldValue);
// TODO: If the count is different between incoming and current list of items,
@ -274,10 +274,10 @@ void PdmUiTreeSelectionEditor::configureAndUpdateUi(const QString& uiConfigName)
}
else if (PdmUiTreeSelectionQModel::isMultipleValueField(fieldValue))
{
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
caf::PdmUiObjectHandle* uiObject = uiObj(uiField()->fieldHandle()->ownerObject());
if (uiObject)
{
uiObject->editorAttribute(field()->fieldHandle(), uiConfigName, &m_attributes);
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &m_attributes);
}
if (m_attributes.singleSelectionMode)

View File

@ -91,11 +91,11 @@ int caf::PdmUiTreeSelectionQModel::optionItemValueRole()
//--------------------------------------------------------------------------------------------------
void caf::PdmUiTreeSelectionQModel::setCheckedStateForItems(const QModelIndexList& sourceModelIndices, bool checked)
{
if (!m_uiFieldHandle || !m_uiFieldHandle->field()) return;
if (!m_uiFieldHandle || !m_uiFieldHandle->uiField()) return;
std::set<unsigned int> selectedIndices;
{
QVariant fieldValue = m_uiFieldHandle->field()->uiValue();
QVariant fieldValue = m_uiFieldHandle->uiField()->uiValue();
QList<QVariant> fieldValueSelection = fieldValue.toList();
for (auto v : fieldValueSelection)
@ -125,7 +125,7 @@ void caf::PdmUiTreeSelectionQModel::setCheckedStateForItems(const QModelIndexLis
fieldValueSelection.push_back(QVariant(v));
}
PdmUiCommandSystemProxy::instance()->setUiValueToField(m_uiFieldHandle->field(), fieldValueSelection);
PdmUiCommandSystemProxy::instance()->setUiValueToField(m_uiFieldHandle->uiField(), fieldValueSelection);
}
//--------------------------------------------------------------------------------------------------
@ -326,11 +326,11 @@ QVariant caf::PdmUiTreeSelectionQModel::data(const QModelIndex &index, int role
}
else if (role == Qt::CheckStateRole && !optionItemInfo->isHeading())
{
if (m_uiFieldHandle && m_uiFieldHandle->field())
if (m_uiFieldHandle && m_uiFieldHandle->uiField())
{
// Avoid calling the seriously heavy uiValue method if we have a temporary valid cache.
QVariant fieldValue = m_uiValueCache ? *m_uiValueCache : m_uiFieldHandle->field()->uiValue();
QVariant fieldValue = m_uiValueCache ? *m_uiValueCache : m_uiFieldHandle->uiField()->uiValue();
if (isSingleValueField(fieldValue))
{
int row = fieldValue.toInt();
@ -389,17 +389,17 @@ QVariant caf::PdmUiTreeSelectionQModel::data(const QModelIndex &index, int role
//--------------------------------------------------------------------------------------------------
bool caf::PdmUiTreeSelectionQModel::setData(const QModelIndex &index, const QVariant &value, int role /*= Qt::EditRole*/)
{
if (!m_uiFieldHandle || !m_uiFieldHandle->field()) return false;
if (!m_uiFieldHandle || !m_uiFieldHandle->uiField()) return false;
if (role == Qt::CheckStateRole)
{
QVariant fieldValue = m_uiFieldHandle->field()->uiValue();
QVariant fieldValue = m_uiFieldHandle->uiField()->uiValue();
if (isSingleValueField(fieldValue))
{
if (value.toBool() == true)
{
QVariant v = static_cast<unsigned int>(optionIndex(index));
PdmUiCommandSystemProxy::instance()->setUiValueToField(m_uiFieldHandle->field(), v);
PdmUiCommandSystemProxy::instance()->setUiValueToField(m_uiFieldHandle->uiField(), v);
return true;
}
@ -452,7 +452,7 @@ bool caf::PdmUiTreeSelectionQModel::setData(const QModelIndex &index, const QVar
fieldValueSelection.push_back(QVariant(v));
}
PdmUiCommandSystemProxy::instance()->setUiValueToField(m_uiFieldHandle->field(), fieldValueSelection);
PdmUiCommandSystemProxy::instance()->setUiValueToField(m_uiFieldHandle->uiField(), fieldValueSelection);
return true;
}

View File

@ -108,7 +108,7 @@ void caf::PdmUiWidgetBasedObjectEditor::recursivelyConfigureAndUpdateUiItemsInGr
if (fieldEditor)
{
fieldEditor->setField(field);
fieldEditor->setUiField(field);
// Place the widget(s) into the correct parent and layout
QWidget* fieldCombinedWidget = fieldEditor->combinedWidget();
@ -338,7 +338,7 @@ void caf::PdmUiWidgetBasedObjectEditor::configureAndUpdateUi(const QString& uiCo
std::map<PdmFieldHandle*, PdmUiFieldEditorHandle*>::iterator it;
for (it = m_fieldViews.begin(); it != m_fieldViews.end(); ++it)
{
it->second->setField(nullptr);
it->second->setUiField(nullptr);
}
// Set all group Boxes to be unvisited
@ -352,7 +352,7 @@ void caf::PdmUiWidgetBasedObjectEditor::configureAndUpdateUi(const QString& uiCo
std::vector< PdmFieldHandle* > fvhToRemoveFromMap;
for (it = m_fieldViews.begin(); it != m_fieldViews.end(); ++it)
{
if (it->second->field() == nullptr)
if (it->second->uiField() == nullptr)
{
PdmUiFieldEditorHandle* fvh = it->second;
delete fvh;