mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fwl: Always update action look when retreiving it.
This commit is contained in:
parent
f8c5bbc481
commit
4606a3de8b
@ -61,24 +61,29 @@ QAction* CmdFeature::action()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QAction* CmdFeature::action(QString customText)
|
QAction* CmdFeature::action(QString customText)
|
||||||
{
|
{
|
||||||
|
QAction* action = NULL;
|
||||||
|
|
||||||
std::map<QString, QAction*>::iterator it;
|
std::map<QString, QAction*>::iterator it;
|
||||||
it = m_customTextToActionMap.find(customText);
|
it = m_customTextToActionMap.find(customText);
|
||||||
|
|
||||||
if (it != m_customTextToActionMap.end() && it->second != NULL)
|
if (it != m_customTextToActionMap.end() && it->second != NULL)
|
||||||
{
|
{
|
||||||
return it->second;
|
action = it->second;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QAction* action = new QAction(this);
|
action = new QAction(this);
|
||||||
this->setupActionLook(action);
|
|
||||||
if (!customText.isEmpty())
|
|
||||||
{
|
|
||||||
action->setText(customText);
|
|
||||||
}
|
|
||||||
connect(action, SIGNAL(triggered(bool)), SLOT(actionTriggered(bool)));
|
connect(action, SIGNAL(triggered(bool)), SLOT(actionTriggered(bool)));
|
||||||
m_customTextToActionMap[customText]= action;
|
m_customTextToActionMap[customText]= action;
|
||||||
return action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->setupActionLook(action);
|
||||||
|
if (!customText.isEmpty())
|
||||||
|
{
|
||||||
|
action->setText(customText);
|
||||||
|
}
|
||||||
|
|
||||||
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user