AppFwk: Read only checkboxes in table view, now is rendered disabled

This commit is contained in:
Jacob Støren 2018-10-02 16:52:56 +02:00
parent e3c7b4ffa4
commit 979882da03

View File

@ -135,9 +135,16 @@ Qt::ItemFlags PdmUiTableViewQModel::flags(const QModelIndex &index) const
PdmUiFieldHandle* uiFieldHandle = getUiFieldHandle(index);
if (uiFieldHandle)
{
if (uiFieldHandle->isUiReadOnly(m_currentConfigName))
if ( uiFieldHandle->isUiReadOnly(m_currentConfigName) )
{
flagMask = flagMask ^ Qt::ItemIsEditable;
if ( flagMask & Qt::ItemIsUserCheckable )
{
flagMask = flagMask & (~Qt::ItemIsEnabled);
}
else
{
flagMask = flagMask ^ Qt::ItemIsEditable; // To make it selectable, but not editable
}
}
}
return flagMask;