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:
parent
5994ef1393
commit
de7c4617d8
@ -122,7 +122,7 @@ public:
|
||||
options.push_back(caf::PdmOptionItemInfo(text, text));
|
||||
|
||||
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";
|
||||
@ -133,7 +133,7 @@ public:
|
||||
|
||||
{
|
||||
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);
|
||||
options.push_back(itemInfo);
|
||||
}
|
||||
|
@ -187,6 +187,10 @@ QVariant caf::PdmUiTreeSelectionQModel::data(const QModelIndex &index, int role
|
||||
{
|
||||
return m_options[opIndex].optionUiText();
|
||||
}
|
||||
else if (role == Qt::DecorationRole)
|
||||
{
|
||||
return m_options[opIndex].icon();
|
||||
}
|
||||
else if (role == Qt::CheckStateRole && !m_options[opIndex].isHeading())
|
||||
{
|
||||
CAF_ASSERT(m_uiFieldHandle);
|
||||
|
Loading…
Reference in New Issue
Block a user