diff --git a/Fwk/AppFwk/cafUserInterface/cafUiStyleSheet.cpp b/Fwk/AppFwk/cafUserInterface/cafUiStyleSheet.cpp index 5cb4f0b39e..c46d44d2f8 100644 --- a/Fwk/AppFwk/cafUserInterface/cafUiStyleSheet.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafUiStyleSheet.cpp @@ -213,6 +213,25 @@ void caf::UiStyleSheet::setWidgetState(QWidget* widget, QString stateTag, bool o refreshWidget(widget); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void caf::UiStyleSheet::stashWidgetStates() +{ + m_stashedStates.swap(m_states); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void caf::UiStyleSheet::restoreWidgetStates() +{ + if (!m_stashedStates.empty()) + { + m_stashedStates.swap(m_states); + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/Fwk/AppFwk/cafUserInterface/cafUiStyleSheet.h b/Fwk/AppFwk/cafUserInterface/cafUiStyleSheet.h index e1e9cec7cb..f6b0613204 100644 --- a/Fwk/AppFwk/cafUserInterface/cafUiStyleSheet.h +++ b/Fwk/AppFwk/cafUserInterface/cafUiStyleSheet.h @@ -86,6 +86,8 @@ public: void applyToWidgetAndChildren(QWidget* widget); static void clearWidgetStates(QWidget* widget); void setWidgetState(QWidget* widget, QString stateTag, bool on = true) const; + void stashWidgetStates(); + void restoreWidgetStates(); private: QString fullText(const QString& className, const QString& objectName, bool applyToSubClasses) const; @@ -93,5 +95,6 @@ private: private: std::map m_states; + std::map m_stashedStates; }; }