Example #1
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
PdmObjectHandle* PdmUiObjectEditorHandle::pdmObject()
{
    PdmUiObjectHandle* uiObject = dynamic_cast<PdmUiObjectHandle*>(pdmItem());
    if (uiObject)
    {
        return uiObject->objectHandle();
    }
    else
    {
        return nullptr;
    }
}
Example #2
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void PdmUiTreeView::slotOnSelectionChanged()
{
    emit selectionChanged();

    std::vector<PdmUiItem*> objects;
    m_treeViewEditor->selectedUiItems(objects);
    PdmObjectHandle* objHandle = NULL;

    if (objects.size())
    {
        PdmUiObjectHandle* uiObjH = dynamic_cast< PdmUiObjectHandle*>(objects[0]);
        if (uiObjH)
        {
            objHandle = uiObjH->objectHandle();
        }
    }

    emit selectedObjectChanged(objHandle);
}