mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 22:13:25 -06:00
#1830 AppFwk : Add level to PdmOptionItemInfo
This commit is contained in:
parent
642348ffed
commit
9eab559272
@ -46,7 +46,11 @@ namespace caf
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmOptionItemInfo::PdmOptionItemInfo(const QString& anOptionUiText, const QVariant& aValue, bool anIsDimmed /* = false */, QIcon anIcon /* = QIcon()*/)
|
||||
: m_value(aValue), m_optionUiText(anOptionUiText), m_isDimmed(anIsDimmed), m_icon(anIcon)
|
||||
: m_value(aValue),
|
||||
m_optionUiText(anOptionUiText),
|
||||
m_isDimmed(anIsDimmed),
|
||||
m_icon(anIcon),
|
||||
m_level(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -55,11 +59,22 @@ PdmOptionItemInfo::PdmOptionItemInfo(const QString& anOptionUiText, const QVaria
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmOptionItemInfo::PdmOptionItemInfo(const QString& anOptionUiText, caf::PdmObjectHandle* obj, bool anIsDimmed /*= false*/, QIcon anIcon /*= QIcon()*/)
|
||||
: m_optionUiText(anOptionUiText), m_isDimmed(anIsDimmed), m_icon(anIcon)
|
||||
: m_optionUiText(anOptionUiText),
|
||||
m_isDimmed(anIsDimmed),
|
||||
m_icon(anIcon),
|
||||
m_level(0)
|
||||
{
|
||||
m_value = QVariant::fromValue(caf::PdmPointer<caf::PdmObjectHandle>(obj));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmOptionItemInfo::setLevel(int level)
|
||||
{
|
||||
m_level = level;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -92,6 +107,14 @@ const QIcon PdmOptionItemInfo::icon() const
|
||||
return m_icon;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int PdmOptionItemInfo::level() const
|
||||
{
|
||||
return m_level;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -86,13 +86,16 @@ private:
|
||||
class PdmOptionItemInfo
|
||||
{
|
||||
public:
|
||||
PdmOptionItemInfo(const QString& anOptionUiText, const QVariant& aValue, bool anIsDimmed = false, QIcon anIcon = QIcon() );
|
||||
PdmOptionItemInfo(const QString& anOptionUiText, const QVariant& aValue, bool anIsDimmed = false, QIcon anIcon = QIcon());
|
||||
PdmOptionItemInfo(const QString& anOptionUiText, caf::PdmObjectHandle* obj, bool anIsDimmed = false, QIcon anIcon = QIcon());
|
||||
|
||||
void setLevel(int level);
|
||||
|
||||
const QString optionUiText() const;
|
||||
const QVariant value() const;
|
||||
bool isDimmed() const;
|
||||
const QIcon icon() const;
|
||||
int level() const;
|
||||
|
||||
|
||||
// Static utility methods to handle QList of PdmOptionItemInfo
|
||||
@ -104,10 +107,11 @@ public:
|
||||
std::vector<unsigned int>& foundIndexes);
|
||||
|
||||
private:
|
||||
QString m_optionUiText;
|
||||
QVariant m_value;
|
||||
bool m_isDimmed;
|
||||
QIcon m_icon;
|
||||
QString m_optionUiText;
|
||||
QVariant m_value;
|
||||
bool m_isDimmed;
|
||||
QIcon m_icon;
|
||||
int m_level;
|
||||
};
|
||||
|
||||
class PdmUiEditorHandle;
|
||||
|
Loading…
Reference in New Issue
Block a user