diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-09-01 00:43:07 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-09-01 00:43:07 (GMT) |
commit | 5db9309f372b4aec16c2206fccde0c4c3e19fdc2 (patch) | |
tree | 7d04e8dbe32653d80fa9a3244606b4741828dcfe /src/declarative | |
parent | 77305eb29e25bb4fff50e1df6f39d5adfdcac144 (diff) | |
download | Qt-5db9309f372b4aec16c2206fccde0c4c3e19fdc2.zip Qt-5db9309f372b4aec16c2206fccde0c4c3e19fdc2.tar.gz Qt-5db9309f372b4aec16c2206fccde0c4c3e19fdc2.tar.bz2 |
Fix FocusPanel.
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/fx/qfxfocuspanel.cpp | 19 | ||||
-rw-r--r-- | src/declarative/fx/qfxfocuspanel.h | 6 |
2 files changed, 10 insertions, 15 deletions
diff --git a/src/declarative/fx/qfxfocuspanel.cpp b/src/declarative/fx/qfxfocuspanel.cpp index 374f566..3bb0b25 100644 --- a/src/declarative/fx/qfxfocuspanel.cpp +++ b/src/declarative/fx/qfxfocuspanel.cpp @@ -41,6 +41,7 @@ #include "qfxfocuspanel.h" #include <QtGui/qgraphicsscene.h> +#include <QEvent> QT_BEGIN_NAMESPACE @@ -76,19 +77,13 @@ QFxFocusPanel::~QFxFocusPanel() Sets whether the item is the active focus panel. */ -void QFxFocusPanel::setActive(bool a) -{ - if (!scene()) - return; - - if (isActive() == a) - return; - if (a) - scene()->setActivePanel(this); - else - scene()->setActivePanel(0); - emit activeChanged(); +bool QFxFocusPanel::sceneEvent(QEvent *event) +{ + if (event->type() == QEvent::WindowActivate || + event->type() == QEvent::WindowDeactivate) + emit activeChanged(); + return QFxItem::sceneEvent(event); } QT_END_NAMESPACE diff --git a/src/declarative/fx/qfxfocuspanel.h b/src/declarative/fx/qfxfocuspanel.h index ba4c1f5..1fea011 100644 --- a/src/declarative/fx/qfxfocuspanel.h +++ b/src/declarative/fx/qfxfocuspanel.h @@ -58,12 +58,12 @@ public: QFxFocusPanel(QFxItem *parent=0); virtual ~QFxFocusPanel(); - //bool isActive() const; - void setActive(bool); - Q_SIGNALS: void activeChanged(); +protected: + bool sceneEvent(QEvent *event); + private: Q_DISABLE_COPY(QFxFocusPanel) }; |