mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Copied in RPM/Fwk/AppFwk
Commented out use of stipple line, as VizFwk is not update yet
This commit is contained in:
@@ -37,21 +37,20 @@
|
||||
|
||||
#include "cafPdmUiDefaultObjectEditor.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmUiFieldEditorHandle.h"
|
||||
#include "cafPdmUiOrdering.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmProxyValueField.h"
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "cafPdmUiFieldEditorHandle.h"
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
#include "cafPdmUiListEditor.h"
|
||||
#include "cafPdmUiOrdering.h"
|
||||
|
||||
|
||||
#include <QWidget>
|
||||
#include <QGridLayout>
|
||||
#include <QWidget>
|
||||
|
||||
#include <assert.h>
|
||||
#include <typeinfo>
|
||||
|
||||
|
||||
|
||||
@@ -66,15 +65,11 @@ CAF_PDM_UI_REGISTER_DEFAULT_FIELD_EDITOR(PdmUiLineEditor, int);
|
||||
CAF_PDM_UI_REGISTER_DEFAULT_FIELD_EDITOR(PdmUiLineEditor, double);
|
||||
CAF_PDM_UI_REGISTER_DEFAULT_FIELD_EDITOR(PdmUiLineEditor, float);
|
||||
CAF_PDM_UI_REGISTER_DEFAULT_FIELD_EDITOR(PdmUiLineEditor, quint64);
|
||||
|
||||
CAF_PDM_UI_REGISTER_DEFAULT_FIELD_EDITOR(PdmUiListEditor, std::vector<QString>);
|
||||
CAF_PDM_UI_REGISTER_DEFAULT_FIELD_EDITOR(PdmUiListEditor, std::vector<int>);
|
||||
CAF_PDM_UI_REGISTER_DEFAULT_FIELD_EDITOR(PdmUiListEditor, std::vector<unsigned int>);
|
||||
CAF_PDM_UI_REGISTER_DEFAULT_FIELD_EDITOR(PdmUiListEditor, std::vector<float>);
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -88,7 +83,9 @@ PdmUiDefaultObjectEditor::PdmUiDefaultObjectEditor()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiDefaultObjectEditor::~PdmUiDefaultObjectEditor()
|
||||
{
|
||||
|
||||
// If there are field editor present, the usage of this editor has not cleared correctly
|
||||
// The intended usage is to call the method setPdmObject(NULL) before closing the dialog
|
||||
assert(m_fieldViews.size() == 0);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -112,7 +109,11 @@ void PdmUiDefaultObjectEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
PdmUiOrdering config;
|
||||
if (pdmObject())
|
||||
{
|
||||
pdmObject()->uiOrdering(uiConfigName, config);
|
||||
caf::PdmUiObjectHandle* uiObject = uiObj(pdmObject());
|
||||
if (uiObject)
|
||||
{
|
||||
uiObject->uiOrdering(uiConfigName, config);
|
||||
}
|
||||
}
|
||||
|
||||
// Set all fieldViews to be unvisited
|
||||
@@ -215,12 +216,12 @@ void PdmUiDefaultObjectEditor::recursiveSetupFieldsAndGroups(const std::vector<P
|
||||
}
|
||||
else
|
||||
{
|
||||
PdmFieldHandle* field = dynamic_cast<PdmFieldHandle*>(uiItems[i]);
|
||||
PdmUiFieldHandle* field = dynamic_cast<PdmUiFieldHandle*>(uiItems[i]);
|
||||
PdmUiFieldEditorHandle* fieldEditor = NULL;
|
||||
|
||||
// Find or create FieldEditor
|
||||
std::map<QString, PdmUiFieldEditorHandle*>::iterator it;
|
||||
it = m_fieldViews.find(field->keyword());
|
||||
it = m_fieldViews.find(field->fieldHandle()->keyword());
|
||||
|
||||
if (it == m_fieldViews.end())
|
||||
{
|
||||
@@ -233,7 +234,7 @@ void PdmUiDefaultObjectEditor::recursiveSetupFieldsAndGroups(const std::vector<P
|
||||
{
|
||||
// Find the default field editor
|
||||
|
||||
QString editorTypeName = qStringTypeName(*field);
|
||||
QString editorTypeName = qStringTypeName(*(field->fieldHandle()));
|
||||
|
||||
// Handle a single value field with valueOptions: Make a combobox
|
||||
|
||||
@@ -253,7 +254,7 @@ void PdmUiDefaultObjectEditor::recursiveSetupFieldsAndGroups(const std::vector<P
|
||||
|
||||
if (fieldEditor)
|
||||
{
|
||||
m_fieldViews[field->keyword()] = fieldEditor;
|
||||
m_fieldViews[field->fieldHandle()->keyword()] = fieldEditor;
|
||||
fieldEditor->createWidgets(parent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user