KTutorial  0.5.1
Signals | Public Member Functions | Protected Member Functions
ktutorial::common::WindowVisibilitySpy Class Reference

Spy to know when windows from a widget hierarchy are shown or hidden. More...

#include <WindowVisibilitySpy.h>

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

Creates a new WindowVisibilitySpy with the given parent.

Parameters:
parentThe parent QObject.

Definition at line 29 of file WindowVisibilitySpy.cpp.


Member Function Documentation

Add widget and all its child widgets to spy.

Parameters:
widgetThe 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.

Parameters:
objectThe widget that received the event.
eventThe event received.
Returns:
False, to let the events be handled as necessary.

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).

Parameters:
windowThe 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.

Parameters:
windowThe widget shown.

Referenced by eventFilter().


The documentation for this class was generated from the following files: