mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1830 AppFwk : Add support for icons
This commit is contained in:
@@ -122,7 +122,7 @@ public:
|
|||||||
options.push_back(caf::PdmOptionItemInfo(text, text));
|
options.push_back(caf::PdmOptionItemInfo(text, text));
|
||||||
|
|
||||||
text = "Second";
|
text = "Second";
|
||||||
options.push_back(caf::PdmOptionItemInfo::createHeader(text));
|
options.push_back(caf::PdmOptionItemInfo::createHeader(text, false, QIcon(QString(":/images/win/textbold.png"))));
|
||||||
|
|
||||||
{
|
{
|
||||||
text = "Second_a";
|
text = "Second_a";
|
||||||
@@ -133,7 +133,7 @@ public:
|
|||||||
|
|
||||||
{
|
{
|
||||||
text = "Second_b";
|
text = "Second_b";
|
||||||
caf::PdmOptionItemInfo itemInfo = caf::PdmOptionItemInfo(text, text);
|
caf::PdmOptionItemInfo itemInfo = caf::PdmOptionItemInfo(text, text, false, QIcon(QString(":/images/win/filenew.png")));
|
||||||
itemInfo.setLevel(1);
|
itemInfo.setLevel(1);
|
||||||
options.push_back(itemInfo);
|
options.push_back(itemInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,6 +187,10 @@ QVariant caf::PdmUiTreeSelectionQModel::data(const QModelIndex &index, int role
|
|||||||
{
|
{
|
||||||
return m_options[opIndex].optionUiText();
|
return m_options[opIndex].optionUiText();
|
||||||
}
|
}
|
||||||
|
else if (role == Qt::DecorationRole)
|
||||||
|
{
|
||||||
|
return m_options[opIndex].icon();
|
||||||
|
}
|
||||||
else if (role == Qt::CheckStateRole && !m_options[opIndex].isHeading())
|
else if (role == Qt::CheckStateRole && !m_options[opIndex].isHeading())
|
||||||
{
|
{
|
||||||
CAF_ASSERT(m_uiFieldHandle);
|
CAF_ASSERT(m_uiFieldHandle);
|
||||||
|
|||||||
Reference in New Issue
Block a user