This repository was archived by the owner on Jun 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
src/libHeaven/CentralUI/States Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -226,4 +226,31 @@ namespace Heaven
226226 return mOptions .contains (name);
227227 }
228228
229+ void WindowState::setWidget (QWidget* widget)
230+ {
231+ mWidget = widget;
232+
233+ if (mWidget ) {
234+ applyConfig ();
235+ }
236+ }
237+
238+ void WindowState::clearWidgets ()
239+ {
240+ if (mWidget ) {
241+ updateConfig ();
242+ }
243+
244+ mWidget = NULL ;
245+
246+ foreach (WindowState::Ptr pChild, mChildren ) {
247+ pChild->clearWidgets ();
248+ }
249+ }
250+
251+ QWidget* WindowState::widget () const
252+ {
253+ return mWidget ;
254+ }
255+
229256}
Original file line number Diff line number Diff line change 2121
2222#include < QSharedData>
2323#include < QVariant>
24+ #include < QPointer>
2425#include < QVector>
2526#include < QSet>
2627
@@ -82,6 +83,11 @@ namespace Heaven
8283 void setCurrentContent ( AbstractViewWidget* avw );
8384 AbstractViewWidget* currentContent ();
8485
86+ public:
87+ void setWidget (QWidget* widget);
88+ QWidget* widget () const ;
89+ void clearWidgets ();
90+
8591 protected:
8692 void readOptions (const QDomElement& el);
8793 void readChildren (const QDomElement& elParent, ChildTypes allowed);
@@ -100,10 +106,11 @@ namespace Heaven
100106 QVector< WindowState::Ptr > mChildren ;
101107 ViewIdentifier mId ;
102108 QVariantHash mOptions ;
109+ QPointer< QWidget > mWidget ;
103110 };
104111
105112}
106113
107- Q_DECLARE_OPERATORS_FOR_FLAGS ( Heaven::WindowState::ChildTypes );
114+ Q_DECLARE_OPERATORS_FOR_FLAGS (Heaven::WindowState::ChildTypes)
108115
109116#endif
You can’t perform that action at this time.
0 commit comments