AppFwk: Added a convenince constructor to PdmOptionItemInfo to make it easier to use PdmPtrField

This commit is contained in:
Jacob Støren 2016-12-14 09:12:27 +01:00
parent 2692abe7fe
commit c555f77a71
2 changed files with 13 additions and 0 deletions

View File

@ -37,10 +37,21 @@
#include "cafPdmUiItem.h"
#include "cafPdmUiEditorHandle.h"
#include "cafPdmPtrField.h"
namespace caf
{
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
PdmOptionItemInfo::PdmOptionItemInfo(QString anOptionUiText, caf::PdmObjectHandle* obj, bool anIsDimmed /*= false*/, QIcon anIcon /*= QIcon()*/)
: optionUiText(anOptionUiText), isDimmed(anIsDimmed), icon(anIcon)
{
value = QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(obj));
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -90,6 +90,8 @@ public:
: value(aValue), optionUiText(anOptionUiText), isDimmed(anIsDimmed), icon(anIcon)
{}
PdmOptionItemInfo(QString anOptionUiText, caf::PdmObjectHandle* obj, bool anIsDimmed = false, QIcon anIcon = QIcon());
QString optionUiText;
bool isDimmed;
QIcon icon;