Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QWinEventNotifier Class

The QWinEventNotifier class provides support for the Windows Wait functions. More...

 #include <QWinEventNotifier>

Inherits: QObject.

This class was introduced in Qt 5.0.

Public Functions

QWinEventNotifier(QObject * parent = 0)
QWinEventNotifier(HANDLE hEvent, QObject * parent = 0)
~QWinEventNotifier()
HANDLE handle() const
bool isEnabled() const
void setHandle(HANDLE hEvent)
  • 31 public functions inherited from QObject

Public Slots

void setEnabled(bool enable)
  • 1 public slot inherited from QObject

Signals

void activated(HANDLE hEvent)

Reimplemented Protected Functions

virtual bool event(QEvent * e)
  • 9 protected functions inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 11 static public members inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

The QWinEventNotifier class provides support for the Windows Wait functions.

The QWinEventNotifier class makes it possible to use the wait functions on windows in a asynchronous manner. With this class, you can register a HANDLE to an event and get notification when that event becomes signalled. The state of the event is not modified in the process so if it is a manual reset event you will need to reset it after the notification.

Once you have created a event object using Windows API such as CreateEvent() or OpenEvent(), you can create an event notifier to monitor the event handle. If the event notifier is enabled, it will emit the activated() signal whenever the corresponding event object is signalled.

The setEnabled() function allows you to disable as well as enable the event notifier. It is generally advisable to explicitly enable or disable the event notifier. A disabled notifier does nothing when the event object is signalled (the same effect as not creating the event notifier). Use the isEnabled() function to determine the notifier's current status.

Finally, you can use the setHandle() function to register a new event object, and the handle() function to retrieve the event handle.

Further information: Although the class is called QWinEventNotifier, it can be used for certain other objects which are so-called synchronization objects, such as Processes, Threads, Waitable timers.

Warning: This class is only available on Windows.

Member Function Documentation

QWinEventNotifier::QWinEventNotifier(QObject * parent = 0)

Constructs an event notifier with the given parent.

QWinEventNotifier::QWinEventNotifier(HANDLE hEvent, QObject * parent = 0)

Constructs an event notifier with the given parent. It enables the notifier, and watches for the event hEvent.

The notifier is enabled by default, i.e. it emits the activated() signal whenever the corresponding event is signalled. However, it is generally advisable to explicitly enable or disable the event notifier.

See also setEnabled() and isEnabled().

QWinEventNotifier::~QWinEventNotifier()

Destroys this notifier.

void QWinEventNotifier::activated(HANDLE hEvent) [signal]

This signal is emitted whenever the event notifier is enabled and the corresponding HANDLE is signalled.

The state of the event is not modified in the process, so if it is a manual reset event, you will need to reset it after the notification.

The object is passed in the hEvent parameter.

See also handle().

bool QWinEventNotifier::event(QEvent * e) [virtual protected]

Reimplemented from QObject::event().

HANDLE QWinEventNotifier::handle() const

Returns the HANDLE that has been registered in the notifier.

See also setHandle().

bool QWinEventNotifier::isEnabled() const

Returns true if the notifier is enabled; otherwise returns false.

See also setEnabled().

void QWinEventNotifier::setEnabled(bool enable) [slot]

If enable is true, the notifier is enabled; otherwise the notifier is disabled.

See also isEnabled() and activated().

void QWinEventNotifier::setHandle(HANDLE hEvent)

Register the HANDLE hEvent. The old HANDLE will be automatically unregistered.

Note: The notifier will be disabled as a side effect and needs to be re-enabled.

See also handle() and setEnabled().

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web