|
KTutorial
0.5.1
|
Spy to know when windows from a widget hierarchy are shown or hidden. More...
#include <WindowVisibilitySpy.h>
Signals | |
| void | windowShown (QWidget *window) |
| Emitted when any of the spied widgets or its children is shown as a window. | |
| void | windowHidden (QWidget *window) |
| Emitted when any of the spied widgets or its children is hidden (and it was a window). | |
Public Member Functions | |
| WindowVisibilitySpy (QObject *parent=0) | |
| Creates a new WindowVisibilitySpy with the given parent. | |
| void | addWidgetToSpy (QWidget *widget) |
| Add widget and all its child widgets to spy. | |
Protected Member Functions | |
| virtual bool | eventFilter (QObject *object, QEvent *event) |
| Filters the events received in the spied widget hierarchies. | |
Spy to know when windows from a widget hierarchy are shown or hidden.
WindowVisibilitySpy emitts windowShown(QWidget*) whenever any of the spied widgets or its child widgets (recursively) are shown as a window. The signal windowHidden(QWidget*) is emitted when any of them is hidden. The signals are emitted for windows but also for dialogs.
Children added to a spied widget after it was added to the WindowVisibilitySpy are also automatically spied.
Definition at line 37 of file WindowVisibilitySpy.h.
| ktutorial::common::WindowVisibilitySpy::WindowVisibilitySpy | ( | QObject * | parent = 0 | ) | [explicit] |
Creates a new WindowVisibilitySpy with the given parent.
| parent | The parent QObject. |
Definition at line 29 of file WindowVisibilitySpy.cpp.
| void ktutorial::common::WindowVisibilitySpy::addWidgetToSpy | ( | QWidget * | widget | ) |
Add widget and all its child widgets to spy.
| widget | The widget to spy. |
Definition at line 33 of file WindowVisibilitySpy.cpp.
Referenced by eventFilter(), ktutorial::view::WindowOnTopEnforcer::setBaseWindow(), and ktutorial::WaitForWindow::WaitForWindow().
| bool ktutorial::common::WindowVisibilitySpy::eventFilter | ( | QObject * | object, |
| QEvent * | event | ||
| ) | [protected, virtual] |
Filters the events received in the spied widget hierarchies.
A windowShown(QWidget*) is emitted when a window is shown, and a windowHidden(QWidget*) is emitted when a window is hidden.
| object | The widget that received the event. |
| event | The event received. |
Definition at line 47 of file WindowVisibilitySpy.cpp.
References addWidgetToSpy(), windowHidden(), and windowShown().
| void ktutorial::common::WindowVisibilitySpy::windowHidden | ( | QWidget * | window | ) | [signal] |
Emitted when any of the spied widgets or its children is hidden (and it was a window).
| window | The widget hidden. |
Referenced by eventFilter().
| void ktutorial::common::WindowVisibilitySpy::windowShown | ( | QWidget * | window | ) | [signal] |
Emitted when any of the spied widgets or its children is shown as a window.
| window | The widget shown. |
Referenced by eventFilter().
1.8.0