IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QAbstractEventDispatcher Class

The https:// class provides an interface to manage Qt's event queue.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QAbstractEventDispatcher Class▲

  • Header: QAbstractEventDispatcher

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Core)

    target_link_libraries(mytarget PRIVATE Qt6::Core)

  • qmake: QT += core

  • Inherits: https://

  • Inherited By:

  • Group: QAbstractEventDispatcher is part of https://

Detailed Description▲

An event dispatcher receives events from the window system and other sources. It then sends them to the https:// or QApplication instance for processing and delivery. https:// provides fine-grained control over event delivery.

For simple control of event processing use https://().

For finer control of the application's event loop, call https://() and call functions on the https:// object that is returned. If you want to use your own instance of https:// or of a https:// subclass, you must install it with https://() or https://() before a default event dispatcher has been installed.

The main event loop is started by calling https://(), and stopped by calling https://(). Local event loops can be created using https://.

Programs that perform long operations can call https://() with a bitwise OR combination of various https:// values to control which events should be delivered.

https:// also allows the integration of an external event loop with the Qt event loop.

See Also▲

See also https://, https://, https://

Member Function Documentation▲

 

[explicit] QAbstractEventDispatcher::QAbstractEventDispatcher(QObject *parent = nullptr)▲

Constructs a new event dispatcher with the given parent.

[virtual] QAbstractEventDispatcher::~QAbstractEventDispatcher()▲

Destroys the event dispatcher.

void QAbstractEventDispatcher::aboutToBlock()▲

This signal is emitted before the event loop calls a function that could block.

See Also▲

See also https://()

void QAbstractEventDispatcher::awake()▲

This signal is emitted after the event loop returns from a function that could block.

See Also▲

See also https://(), https://()

[since 5.0] bool QAbstractEventDispatcher::filterNativeEvent(const QByteArray &eventType, void *message, qintptr *result)▲

Sends message through the event filters that were set by https://(). This function returns true as soon as an event filter returns true, and false otherwise to indicate that the processing of the event should continue.

Subclasses of https:// must call this function for all messages received from the system to ensure compatibility with any extensions that may be used in the application. The type of event eventType is specific to the platform plugin chosen at run-time, and can be used to cast message to the right type. The result pointer is only used on Windows, and corresponds to the LRESULT pointer.

Note that the type of message is platform dependent. See https:// for details.

This function was introduced in Qt 5.0.

See Also▲

See also https://(), https://()

[since 5.0] void QAbstractEventDispatcher::installNativeEventFilter(QAbstractNativeEventFilter *filterObj)▲

Installs an event filter filterObj for all native events received by the application.

The event filter filterObj receives events via its https://() function, which is called for all events received by all threads.

The https://() function should return true if the event should be filtered, (in this case, stopped). It should return false to allow normal Qt processing to continue: the native event can then be translated into a https:// and handled by the standard Qt https:// filtering, e.g. https://().

If multiple event filters are installed, the filter that was installed last is activated first.

The filter function set here receives native messages, that is, MSG or XEvent structs.

For maximum portability, you should always try to use https:// objects and https://() whenever possible.

This function was introduced in Qt 5.0.

See Also▲

See also https://()

[static] QAbstractEventDispatcher *QAbstractEventDispatcher::instance(QThread *thread = nullptr)▲

Returns a pointer to the event dispatcher object for the specified thread. If thread is nullptr, the current thread is used. If no event dispatcher exists for the specified thread, this function returns nullptr.

Note: If Qt is built without thread support, the thread argument is ignored.

[pure virtual] void QAbstractEventDispatcher::interrupt()▲

Interrupts event dispatching. The event dispatcher will return from https://() as soon as possible.

[pure virtual] bool QAbstractEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)▲

Processes pending events that match flags until there are no more events to process. Returns true if an event was processed; otherwise returns false.

This function is especially useful if you have a long running operation, and want to show its progress without allowing user input by using the https:// flag.

If the https:// flag is set in flags, the behavior of this function is as follows:

  • If events are available, this function returns after processing them.

  • If no events are available, this function will wait until more are available and return after processing newly available events.

If the https:// flag is not set in flags, and no events are available, this function will return immediately.

Note: This function does not process events continuously; it returns after all available events are processed.

[pure virtual] void QAbstractEventDispatcher::registerSocketNotifier(QSocketNotifier *notifier)▲

Registers notifier with the event loop. Subclasses must implement this method to tie a socket notifier into another event loop.

int QAbstractEventDispatcher::registerTimer(qint64 interval, Qt::TimerType timerType, QObject *object)▲

Registers a timer with the specified interval and timerType for the given object and returns the timer id.

[pure virtual] void QAbstractEventDispatcher::registerTimer(int timerId, qint64 interval, Qt::TimerType timerType, QObject *object)▲

Register a timer with the specified timerId, interval, and timerType for the given object.

[pure virtual] QList<QAbstractEventDispatcher::TimerInfo> QAbstractEventDispatcher::registeredTimers(QObject *object) const▲

Returns a list of registered timers for object. The https:// struct has timerId, interval, and timerType members.

See Also▲

See also https://

[pure virtual] int QAbstractEventDispatcher::remainingTime(int timerId)▲

Returns the remaining time in milliseconds with the given timerId. If the timer is inactive, the returned value will be -1. If the timer is overdue, the returned value will be 0.

See Also▲

See also https://

[since 5.0] void QAbstractEventDispatcher::removeNativeEventFilter(QAbstractNativeEventFilter *filter)▲

Removes the event filter filter from this object. The request is ignored if such an event filter has not been installed.

All event filters for this object are automatically removed when this object is destroyed.

It is always safe to remove an event filter, even during event filter filter activation (that is, even from within the https://() function).

This function was introduced in Qt 5.0.

See Also▲

See also https://(), https://

[pure virtual] void QAbstractEventDispatcher::unregisterSocketNotifier(QSocketNotifier *notifier)▲

Unregisters notifier from the event dispatcher. Subclasses must reimplement this method to tie a socket notifier into another event loop. Reimplementations must call the base implementation.

[pure virtual] bool QAbstractEventDispatcher::unregisterTimer(int timerId)▲

Unregisters the timer with the given timerId. Returns true if successful; otherwise returns false.

See Also▲

See also https://(), https://()

[pure virtual] bool QAbstractEventDispatcher::unregisterTimers(QObject *object)▲

Unregisters all the timers associated with the given object. Returns true if all timers were successful removed; otherwise returns false.

See Also▲

See also https://(), https://()

[pure virtual] void QAbstractEventDispatcher::wakeUp()▲

Wakes up the event loop.

This function is thread-safe.

See Also▲

See also https://()

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+   

Ce document est disponible sous la licence https:// telle que publiée par la Free Software Foundation.