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  ·  Fonctions  · 

QEvent Class Reference

The QEvent class is the base class of all event classes. Event objects contain event parameters. More...

#include <qevent.h>

Inherits Qt.

Inherited by QTimerEvent, QMouseEvent, QWheelEvent, QTabletEvent, QKeyEvent, QFocusEvent, QPaintEvent, QMoveEvent, QResizeEvent, QCloseEvent, QIconDragEvent, QShowEvent, QHideEvent, QContextMenuEvent, QIMEvent, QDropEvent, QDragLeaveEvent, QChildEvent, and QCustomEvent.

List of all member functions.

Public Members

  • enum Type { None = 0, Timer = 1, MouseButtonPress = 2, MouseButtonRelease = 3, MouseButtonDblClick = 4, MouseMove = 5, KeyPress = 6, KeyRelease = 7, FocusIn = 8, FocusOut = 9, Enter = 10, Leave = 11, Paint = 12, Move = 13, Resize = 14, Create = 15, Destroy = 16, Show = 17, Hide = 18, Close = 19, Quit = 20, Reparent = 21, ShowMinimized = 22, ShowNormal = 23, WindowActivate = 24, WindowDeactivate = 25, ShowToParent = 26, HideToParent = 27, ShowMaximized = 28, ShowFullScreen = 29, Accel = 30, Wheel = 31, AccelAvailable = 32, CaptionChange = 33, IconChange = 34, ParentFontChange = 35, ApplicationFontChange = 36, ParentPaletteChange = 37, ApplicationPaletteChange = 38, PaletteChange = 39, Clipboard = 40, Speech = 42, SockAct = 50, AccelOverride = 51, DeferredDelete = 52, DragEnter = 60, DragMove = 61, DragLeave = 62, Drop = 63, DragResponse = 64, ChildInserted = 70, ChildRemoved = 71, LayoutHint = 72, ShowWindowRequest = 73, WindowBlocked = 74, WindowUnblocked = 75, ActivateControl = 80, DeactivateControl = 81, ContextMenu = 82, IMStart = 83, IMCompose = 84, IMEnd = 85, Accessibility = 86, TabletMove = 87, LocaleChange = 88, LanguageChange = 89, LayoutDirectionChange = 90, Style = 91, TabletPress = 92, TabletRelease = 93, OkRequest = 94, HelpRequest = 95, WindowStateChange = 96, IconDrag = 97, User = 1000, MaxUser = 65535 }
  • QEvent ( Type type )
  • virtual ~QEvent ()
  • Type type () const
  • bool spontaneous () const

Detailed Description

The QEvent class is the base class of all event classes. Event objects contain event parameters.

Qt's main event loop (QApplication::exec()) fetches native window system events from the event queue, translates them into QEvents and sends the translated events to QObjects.

In general, events come from the underlying window system (spontaneous() returns TRUE) but it is also possible to manually send events using QApplication::sendEvent() and QApplication::postEvent() (spontaneous() returns FALSE).

QObjects receive events by having their QObject::event() function called. The function can be reimplemented in subclasses to customize event handling and add additional event types; QWidget::event() is a notable example. By default, events are dispatched to event handlers like QObject::timerEvent() and QWidget::mouseMoveEvent(). QObject::installEventFilter() allows an object to intercept events destined for another object.

The basic QEvent contains only an event type parameter. Subclasses of QEvent contain additional parameters that describe the particular event.

See also QObject::event(), QObject::installEventFilter(), QWidget::event(), QApplication::sendEvent(), QApplication::postEvent(), QApplication::processEvents(), Environment Classes, and Event Classes.


Member Type Documentation

QEvent::Type

This enum type defines the valid event types in Qt. The event types and the specialized classes for each type are these:

  • QEvent::None - Not an event.
  • QEvent::Accessibility - Accessibility information is requested
  • QEvent::Timer - Regular timer events, QTimerEvent.
  • QEvent::MouseButtonPress - Mouse press, QMouseEvent.
  • QEvent::MouseButtonRelease - Mouse release, QMouseEvent.
  • QEvent::MouseButtonDblClick - Mouse press again, QMouseEvent.
  • QEvent::MouseMove - Mouse move, QMouseEvent.
  • QEvent::KeyPress - Key press (including Shift, for example), QKeyEvent.
  • QEvent::KeyRelease - Key release, QKeyEvent.
  • QEvent::IMStart - The start of input method composition, QIMEvent.
  • QEvent::IMCompose - Input method composition is taking place, QIMEvent.
  • QEvent::IMEnd - The end of input method composition, QIMEvent.
  • QEvent::FocusIn - Widget gains keyboard focus, QFocusEvent.
  • QEvent::FocusOut - Widget loses keyboard focus, QFocusEvent.
  • QEvent::Enter - Mouse enters widget's boundaries.
  • QEvent::Leave - Mouse leaves widget's boundaries.
  • QEvent::Paint - Screen update necessary, QPaintEvent.
  • QEvent::Move - Widget's position changed, QMoveEvent.
  • QEvent::Resize - Widget's size changed, QResizeEvent.
  • QEvent::Show - Widget was shown on screen, QShowEvent.
  • QEvent::Hide - Widget was hidden, QHideEvent.
  • QEvent::ShowToParent - A child widget has been shown.
  • QEvent::HideToParent - A child widget has been hidden.
  • QEvent::Close - Widget was closed (permanently), QCloseEvent.
  • QEvent::ShowNormal - Widget should be shown normally (obsolete).
  • QEvent::ShowMaximized - Widget should be shown maximized (obsolete).
  • QEvent::ShowMinimized - Widget should be shown minimized (obsolete).
  • QEvent::ShowFullScreen - Widget should be shown full-screen (obsolete).
  • QEvent::ShowWindowRequest - Widget's window should be shown (obsolete).
  • QEvent::DeferredDelete - The object will be deleted after it has cleaned up.
  • QEvent::Accel - Key press in child for shortcut key handling, QKeyEvent.
  • QEvent::Wheel - Mouse wheel rolled, QWheelEvent.
  • QEvent::ContextMenu - Context popup menu, QContextMenuEvent
  • QEvent::AccelOverride - Key press in child, for overriding shortcut key handling, QKeyEvent.
  • QEvent::AccelAvailable - internal.
  • QEvent::WindowActivate - Window was activated.
  • QEvent::WindowDeactivate - Window was deactivated.
  • QEvent::CaptionChange - Widget's caption changed.
  • QEvent::IconChange - Widget's icon changed.
  • QEvent::ParentFontChange - Font of the parent widget changed.
  • QEvent::ApplicationFontChange - Default application font changed.
  • QEvent::PaletteChange - Palette of the widget changed.
  • QEvent::ParentPaletteChange - Palette of the parent widget changed.
  • QEvent::ApplicationPaletteChange - Default application palette changed.
  • QEvent::Clipboard - Clipboard contents have changed.
  • QEvent::SockAct - Socket activated, used to implement QSocketNotifier.
  • QEvent::DragEnter - A drag-and-drop enters widget, QDragEnterEvent.
  • QEvent::DragMove - A drag-and-drop is in progress, QDragMoveEvent.
  • QEvent::DragLeave - A drag-and-drop leaves widget, QDragLeaveEvent.
  • QEvent::Drop - A drag-and-drop is completed, QDropEvent.
  • QEvent::DragResponse - Internal event used by Qt on some platforms.
  • QEvent::ChildInserted - Object gets a child, QChildEvent.
  • QEvent::ChildRemoved - Object loses a child, QChildEvent.
  • QEvent::LayoutHint - Widget child has changed layout properties.
  • QEvent::ActivateControl - Internal event used by Qt on some platforms.
  • QEvent::DeactivateControl - Internal event used by Qt on some platforms.
  • QEvent::LanguageChange - The application translation changed, QTranslator
  • QEvent::LayoutDirectionChange - The direction of layouts changed
  • QEvent::LocaleChange - The system locale changed
  • QEvent::Quit - Reserved.
  • QEvent::Create - Reserved.
  • QEvent::Destroy - Reserved.
  • QEvent::Reparent - Reserved.
  • QEvent::Speech - Reserved for speech input.
  • QEvent::TabletMove - A Wacom Tablet Move Event.
  • QEvent::Style - Internal use only
  • QEvent::TabletPress - A Wacom Tablet Press Event
  • QEvent::TabletRelease - A Wacom Tablet Release Event
  • QEvent::OkRequest - Internal event used by Qt on some platforms.
  • QEvent::HelpRequest - Internal event used by Qt on some platforms.
  • QEvent::IconDrag - Internal event used by Qt on some platforms when proxy icon is dragged.
  • QEvent::WindowStateChange - The window's state, i.e. minimized, maximized or full-screen, has changed. See QWidget::windowState().
  • QEvent::WindowBlocked - The window is modally blocked
  • QEvent::WindowUnblocked - The window leaves modal blocking
  • QEvent::User - User defined event.
  • QEvent::MaxUser - Last user event id.

User events should have values between User and MaxUser inclusive.


Member Function Documentation

QEvent::QEvent ( Type type )

Contructs an event object of type type.

QEvent::~QEvent () [virtual]

Destroys the event. If it was posted, it will be removed from the list of events to be posted.

bool QEvent::spontaneous () const

Returns TRUE if the event originated outside the application, i.e. it is a system event; otherwise returns FALSE.

Type QEvent::type () const

Returns the event type.


This file is part of the Qt toolkit. Copyright © 1995-2005 Trolltech. All Rights Reserved.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 43
  4. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 9
Page suivante

Le Qt Developer Network au hasard

Logo

Génération de bindings PySide avec Shiboken

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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 3.3
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