mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Show class name as debug info in project tree
This commit is contained in:
parent
ffbc4f13e7
commit
cc59cb84af
@ -485,16 +485,34 @@ QVariant PdmUiTreeViewModel::data(const QModelIndex &index, int role ) const
|
||||
PdmUiObjectHandle* pdmUiObject = uiObj(uitreeOrdering->object());
|
||||
if (pdmUiObject)
|
||||
{
|
||||
QVariant v;
|
||||
if (pdmUiObject->userDescriptionField())
|
||||
{
|
||||
caf::PdmUiFieldHandle* uiFieldHandle = pdmUiObject->userDescriptionField()->uiCapability();
|
||||
if (uiFieldHandle)
|
||||
{
|
||||
return uiFieldHandle->uiValue();
|
||||
v = uiFieldHandle->uiValue();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
v = pdmUiObject->uiName();
|
||||
}
|
||||
|
||||
return pdmUiObject->uiName();
|
||||
QString txt = v.toString();
|
||||
|
||||
// Uncomment following to show class names of objects in property viewer
|
||||
//#define SHOW_CLASS_NAME_IN_TREE
|
||||
#ifdef SHOW_CLASS_NAME_IN_TREE
|
||||
PdmObjectHandle* pdmObjHandle = pdmUiObject->objectHandle();
|
||||
if (pdmObjHandle)
|
||||
{
|
||||
txt += " - ";
|
||||
txt += typeid(*pdmObjHandle).name();
|
||||
}
|
||||
#endif
|
||||
|
||||
return txt;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user