diff options
author | Owen Williams <owilliams@mixxx.org> | 2015-01-15 20:31:59 -0500 |
---|---|---|
committer | Owen Williams <owilliams@mixxx.org> | 2015-01-15 20:31:59 -0500 |
commit | b371427855bbef8b9e05e02b7052ecc2a86b611c (patch) | |
tree | 2b2a0f892e4827c82b00463e46ca1281fda09dc4 /src/widget/wsingletoncontainer.h | |
parent | fe2fa3a6396cc72f567a04f87bda2b0043a3178a (diff) |
Move SingletonWidget map into SkinContext for easier lifetime management.
Also address other notes.
Diffstat (limited to 'src/widget/wsingletoncontainer.h')
-rw-r--r-- | src/widget/wsingletoncontainer.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/widget/wsingletoncontainer.h b/src/widget/wsingletoncontainer.h index 17cdbc67e3..b2bd95ffc2 100644 --- a/src/widget/wsingletoncontainer.h +++ b/src/widget/wsingletoncontainer.h @@ -42,6 +42,8 @@ #ifndef WSINGLETONCONTAINER_H #define WSINGLETONCONTAINER_H +#include <QPointer> + #include "widget/wwidgetgroup.h" class WSingletonContainer : public WWidgetGroup { @@ -56,21 +58,22 @@ class WSingletonContainer : public WWidgetGroup { // We don't want to end up with badly-constructed containers, so only // provide a factory function. - static WSingletonContainer* getSingleton(QString objectname, + static WSingletonContainer* getSingleton(QString objectName, + WidgetMap* widgetMap, QWidget* pParent=NULL); // Takes a constructed QWidget and inserts it in the map of available // singletons. - static void defineSingleton(QString objectname, QWidget* widget); + static void defineSingleton(QString objectName, QWidget* widget, + WidgetMap* widgetMap); public slots: virtual void showEvent(QShowEvent* event); private: - WSingletonContainer(QString objectname, QWidget* pParent=NULL); + WSingletonContainer(QWidget* widget, QWidget* pParent=NULL); - static WidgetMap m_singletons; - QWidget* m_pWidget; + QPointer<QWidget> m_pWidget; QLayout* m_pLayout; }; |