| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/kernel/qcoreevent.cpp |
| Source code | Switch to Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | /**************************************************************************** | - | ||||||||||||||||||
| 2 | ** | - | ||||||||||||||||||
| 3 | ** Copyright (C) 2015 The Qt Company Ltd. | - | ||||||||||||||||||
| 4 | ** Contact: http://www.qt.io/licensing/ | - | ||||||||||||||||||
| 5 | ** | - | ||||||||||||||||||
| 6 | ** This file is part of the QtCore module of the Qt Toolkit. | - | ||||||||||||||||||
| 7 | ** | - | ||||||||||||||||||
| 8 | ** $QT_BEGIN_LICENSE:LGPL21$ | - | ||||||||||||||||||
| 9 | ** Commercial License Usage | - | ||||||||||||||||||
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - | ||||||||||||||||||
| 11 | ** accordance with the commercial license agreement provided with the | - | ||||||||||||||||||
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - | ||||||||||||||||||
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | - | ||||||||||||||||||
| 14 | ** and conditions see http://www.qt.io/terms-conditions. For further | - | ||||||||||||||||||
| 15 | ** information use the contact form at http://www.qt.io/contact-us. | - | ||||||||||||||||||
| 16 | ** | - | ||||||||||||||||||
| 17 | ** GNU Lesser General Public License Usage | - | ||||||||||||||||||
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - | ||||||||||||||||||
| 19 | ** General Public License version 2.1 or version 3 as published by the Free | - | ||||||||||||||||||
| 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and | - | ||||||||||||||||||
| 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the | - | ||||||||||||||||||
| 22 | ** following information to ensure the GNU Lesser General Public License | - | ||||||||||||||||||
| 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and | - | ||||||||||||||||||
| 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | - | ||||||||||||||||||
| 25 | ** | - | ||||||||||||||||||
| 26 | ** As a special exception, The Qt Company gives you certain additional | - | ||||||||||||||||||
| 27 | ** rights. These rights are described in The Qt Company LGPL Exception | - | ||||||||||||||||||
| 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | - | ||||||||||||||||||
| 29 | ** | - | ||||||||||||||||||
| 30 | ** $QT_END_LICENSE$ | - | ||||||||||||||||||
| 31 | ** | - | ||||||||||||||||||
| 32 | ****************************************************************************/ | - | ||||||||||||||||||
| 33 | - | |||||||||||||||||||
| 34 | #include "qcoreevent.h" | - | ||||||||||||||||||
| 35 | #include "qcoreapplication.h" | - | ||||||||||||||||||
| 36 | #include "qcoreapplication_p.h" | - | ||||||||||||||||||
| 37 | - | |||||||||||||||||||
| 38 | #include "qbasicatomic.h" | - | ||||||||||||||||||
| 39 | - | |||||||||||||||||||
| 40 | #include <limits> | - | ||||||||||||||||||
| 41 | - | |||||||||||||||||||
| 42 | QT_BEGIN_NAMESPACE | - | ||||||||||||||||||
| 43 | - | |||||||||||||||||||
| 44 | /*! | - | ||||||||||||||||||
| 45 | \class QEvent | - | ||||||||||||||||||
| 46 | \inmodule QtCore | - | ||||||||||||||||||
| 47 | \brief The QEvent class is the base class of all | - | ||||||||||||||||||
| 48 | event classes. Event objects contain event parameters. | - | ||||||||||||||||||
| 49 | - | |||||||||||||||||||
| 50 | \ingroup events | - | ||||||||||||||||||
| 51 | - | |||||||||||||||||||
| 52 | Qt's main event loop (QCoreApplication::exec()) fetches native | - | ||||||||||||||||||
| 53 | window system events from the event queue, translates them into | - | ||||||||||||||||||
| 54 | QEvents, and sends the translated events to \l{QObject}s. | - | ||||||||||||||||||
| 55 | - | |||||||||||||||||||
| 56 | In general, events come from the underlying window system | - | ||||||||||||||||||
| 57 | (spontaneous() returns \c true), but it is also possible to manually | - | ||||||||||||||||||
| 58 | send events using QCoreApplication::sendEvent() and | - | ||||||||||||||||||
| 59 | QCoreApplication::postEvent() (spontaneous() returns \c false). | - | ||||||||||||||||||
| 60 | - | |||||||||||||||||||
| 61 | \l {QObject}{QObjects} receive events by having their QObject::event() function | - | ||||||||||||||||||
| 62 | called. The function can be reimplemented in subclasses to | - | ||||||||||||||||||
| 63 | customize event handling and add additional event types; | - | ||||||||||||||||||
| 64 | QWidget::event() is a notable example. By default, events are | - | ||||||||||||||||||
| 65 | dispatched to event handlers like QObject::timerEvent() and | - | ||||||||||||||||||
| 66 | QWidget::mouseMoveEvent(). QObject::installEventFilter() allows an | - | ||||||||||||||||||
| 67 | object to intercept events destined for another object. | - | ||||||||||||||||||
| 68 | - | |||||||||||||||||||
| 69 | The basic QEvent contains only an event type parameter and an | - | ||||||||||||||||||
| 70 | "accept" flag. The accept flag set with accept(), and cleared | - | ||||||||||||||||||
| 71 | with ignore(). It is set by default, but don't rely on this as | - | ||||||||||||||||||
| 72 | subclasses may choose to clear it in their constructor. | - | ||||||||||||||||||
| 73 | - | |||||||||||||||||||
| 74 | Subclasses of QEvent contain additional parameters that describe | - | ||||||||||||||||||
| 75 | the particular event. | - | ||||||||||||||||||
| 76 | - | |||||||||||||||||||
| 77 | \sa QObject::event(), QObject::installEventFilter(), | - | ||||||||||||||||||
| 78 | QCoreApplication::sendEvent(), | - | ||||||||||||||||||
| 79 | QCoreApplication::postEvent(), QCoreApplication::processEvents() | - | ||||||||||||||||||
| 80 | */ | - | ||||||||||||||||||
| 81 | - | |||||||||||||||||||
| 82 | - | |||||||||||||||||||
| 83 | /*! | - | ||||||||||||||||||
| 84 | \enum QEvent::Type | - | ||||||||||||||||||
| 85 | - | |||||||||||||||||||
| 86 | This enum type defines the valid event types in Qt. The event | - | ||||||||||||||||||
| 87 | types and the specialized classes for each type are as follows: | - | ||||||||||||||||||
| 88 | - | |||||||||||||||||||
| 89 | \value None Not an event. | - | ||||||||||||||||||
| 90 | \value ActionAdded A new action has been added (QActionEvent). | - | ||||||||||||||||||
| 91 | \value ActionChanged An action has been changed (QActionEvent). | - | ||||||||||||||||||
| 92 | \value ActionRemoved An action has been removed (QActionEvent). | - | ||||||||||||||||||
| 93 | \value ActivationChange A widget's top-level window activation state has changed. | - | ||||||||||||||||||
| 94 | \value ApplicationActivate This enum has been deprecated. Use ApplicationStateChange instead. | - | ||||||||||||||||||
| 95 | \value ApplicationActivated This enum has been deprecated. Use ApplicationStateChange instead. | - | ||||||||||||||||||
| 96 | \value ApplicationDeactivate This enum has been deprecated. Use ApplicationStateChange instead. | - | ||||||||||||||||||
| 97 | \value ApplicationFontChange The default application font has changed. | - | ||||||||||||||||||
| 98 | \value ApplicationLayoutDirectionChange The default application layout direction has changed. | - | ||||||||||||||||||
| 99 | \value ApplicationPaletteChange The default application palette has changed. | - | ||||||||||||||||||
| 100 | \value ApplicationStateChange The state of the application has changed. | - | ||||||||||||||||||
| 101 | \value ApplicationWindowIconChange The application's icon has changed. | - | ||||||||||||||||||
| 102 | \value ChildAdded An object gets a child (QChildEvent). | - | ||||||||||||||||||
| 103 | \value ChildPolished A widget child gets polished (QChildEvent). | - | ||||||||||||||||||
| 104 | \value ChildRemoved An object loses a child (QChildEvent). | - | ||||||||||||||||||
| 105 | \value Clipboard The clipboard contents have changed. | - | ||||||||||||||||||
| 106 | \value Close Widget was closed (QCloseEvent). | - | ||||||||||||||||||
| 107 | \value CloseSoftwareInputPanel A widget wants to close the software input panel (SIP). | - | ||||||||||||||||||
| 108 | \value ContentsRectChange The margins of the widget's content rect changed. | - | ||||||||||||||||||
| 109 | \value ContextMenu Context popup menu (QContextMenuEvent). | - | ||||||||||||||||||
| 110 | \value CursorChange The widget's cursor has changed. | - | ||||||||||||||||||
| 111 | \value DeferredDelete The object will be deleted after it has cleaned up (QDeferredDeleteEvent) | - | ||||||||||||||||||
| 112 | \value DragEnter The cursor enters a widget during a drag and drop operation (QDragEnterEvent). | - | ||||||||||||||||||
| 113 | \value DragLeave The cursor leaves a widget during a drag and drop operation (QDragLeaveEvent). | - | ||||||||||||||||||
| 114 | \value DragMove A drag and drop operation is in progress (QDragMoveEvent). | - | ||||||||||||||||||
| 115 | \value Drop A drag and drop operation is completed (QDropEvent). | - | ||||||||||||||||||
| 116 | \value DynamicPropertyChange A dynamic property was added, changed, or removed from the object. | - | ||||||||||||||||||
| 117 | \value EnabledChange Widget's enabled state has changed. | - | ||||||||||||||||||
| 118 | \value Enter Mouse enters widget's boundaries (QEnterEvent). | - | ||||||||||||||||||
| 119 | \value EnterEditFocus An editor widget gains focus for editing. \c QT_KEYPAD_NAVIGATION must be defined. | - | ||||||||||||||||||
| 120 | \value EnterWhatsThisMode Send to toplevel widgets when the application enters "What's This?" mode. | - | ||||||||||||||||||
| 121 | \value Expose Sent to a window when its on-screen contents are invalidated and need to be flushed from the backing store. | - | ||||||||||||||||||
| 122 | \value FileOpen File open request (QFileOpenEvent). | - | ||||||||||||||||||
| 123 | \value FocusIn Widget or Window gains keyboard focus (QFocusEvent). | - | ||||||||||||||||||
| 124 | \value FocusOut Widget or Window loses keyboard focus (QFocusEvent). | - | ||||||||||||||||||
| 125 | \value FocusAboutToChange Widget or Window focus is about to change (QFocusEvent) | - | ||||||||||||||||||
| 126 | \value FontChange Widget's font has changed. | - | ||||||||||||||||||
| 127 | \value Gesture A gesture was triggered (QGestureEvent). | - | ||||||||||||||||||
| 128 | \value GestureOverride A gesture override was triggered (QGestureEvent). | - | ||||||||||||||||||
| 129 | \value GrabKeyboard Item gains keyboard grab (QGraphicsItem only). | - | ||||||||||||||||||
| 130 | \value GrabMouse Item gains mouse grab (QGraphicsItem only). | - | ||||||||||||||||||
| 131 | \value GraphicsSceneContextMenu Context popup menu over a graphics scene (QGraphicsSceneContextMenuEvent). | - | ||||||||||||||||||
| 132 | \value GraphicsSceneDragEnter The cursor enters a graphics scene during a drag and drop operation (QGraphicsSceneDragDropEvent). | - | ||||||||||||||||||
| 133 | \value GraphicsSceneDragLeave The cursor leaves a graphics scene during a drag and drop operation (QGraphicsSceneDragDropEvent). | - | ||||||||||||||||||
| 134 | \value GraphicsSceneDragMove A drag and drop operation is in progress over a scene (QGraphicsSceneDragDropEvent). | - | ||||||||||||||||||
| 135 | \value GraphicsSceneDrop A drag and drop operation is completed over a scene (QGraphicsSceneDragDropEvent). | - | ||||||||||||||||||
| 136 | \value GraphicsSceneHelp The user requests help for a graphics scene (QHelpEvent). | - | ||||||||||||||||||
| 137 | \value GraphicsSceneHoverEnter The mouse cursor enters a hover item in a graphics scene (QGraphicsSceneHoverEvent). | - | ||||||||||||||||||
| 138 | \value GraphicsSceneHoverLeave The mouse cursor leaves a hover item in a graphics scene (QGraphicsSceneHoverEvent). | - | ||||||||||||||||||
| 139 | \value GraphicsSceneHoverMove The mouse cursor moves inside a hover item in a graphics scene (QGraphicsSceneHoverEvent). | - | ||||||||||||||||||
| 140 | \value GraphicsSceneMouseDoubleClick Mouse press again (double click) in a graphics scene (QGraphicsSceneMouseEvent). | - | ||||||||||||||||||
| 141 | \value GraphicsSceneMouseMove Move mouse in a graphics scene (QGraphicsSceneMouseEvent). | - | ||||||||||||||||||
| 142 | \value GraphicsSceneMousePress Mouse press in a graphics scene (QGraphicsSceneMouseEvent). | - | ||||||||||||||||||
| 143 | \value GraphicsSceneMouseRelease Mouse release in a graphics scene (QGraphicsSceneMouseEvent). | - | ||||||||||||||||||
| 144 | \value GraphicsSceneMove Widget was moved (QGraphicsSceneMoveEvent). | - | ||||||||||||||||||
| 145 | \value GraphicsSceneResize Widget was resized (QGraphicsSceneResizeEvent). | - | ||||||||||||||||||
| 146 | \value GraphicsSceneWheel Mouse wheel rolled in a graphics scene (QGraphicsSceneWheelEvent). | - | ||||||||||||||||||
| 147 | \value Hide Widget was hidden (QHideEvent). | - | ||||||||||||||||||
| 148 | \value HideToParent A child widget has been hidden. | - | ||||||||||||||||||
| 149 | \value HoverEnter The mouse cursor enters a hover widget (QHoverEvent). | - | ||||||||||||||||||
| 150 | \value HoverLeave The mouse cursor leaves a hover widget (QHoverEvent). | - | ||||||||||||||||||
| 151 | \value HoverMove The mouse cursor moves inside a hover widget (QHoverEvent). | - | ||||||||||||||||||
| 152 | \value IconDrag The main icon of a window has been dragged away (QIconDragEvent). | - | ||||||||||||||||||
| 153 | \value IconTextChange Widget's icon text has been changed. (Deprecated) | - | ||||||||||||||||||
| 154 | \value InputMethod An input method is being used (QInputMethodEvent). | - | ||||||||||||||||||
| 155 | \value InputMethodQuery A input method query event (QInputMethodQueryEvent) | - | ||||||||||||||||||
| 156 | \value KeyboardLayoutChange The keyboard layout has changed. | - | ||||||||||||||||||
| 157 | \value KeyPress Key press (QKeyEvent). | - | ||||||||||||||||||
| 158 | \value KeyRelease Key release (QKeyEvent). | - | ||||||||||||||||||
| 159 | \value LanguageChange The application translation changed. | - | ||||||||||||||||||
| 160 | \value LayoutDirectionChange The direction of layouts changed. | - | ||||||||||||||||||
| 161 | \value LayoutRequest Widget layout needs to be redone. | - | ||||||||||||||||||
| 162 | \value Leave Mouse leaves widget's boundaries. | - | ||||||||||||||||||
| 163 | \value LeaveEditFocus An editor widget loses focus for editing. QT_KEYPAD_NAVIGATION must be defined. | - | ||||||||||||||||||
| 164 | \value LeaveWhatsThisMode Send to toplevel widgets when the application leaves "What's This?" mode. | - | ||||||||||||||||||
| 165 | \value LocaleChange The system locale has changed. | - | ||||||||||||||||||
| 166 | \value NonClientAreaMouseButtonDblClick A mouse double click occurred outside the client area. | - | ||||||||||||||||||
| 167 | \value NonClientAreaMouseButtonPress A mouse button press occurred outside the client area. | - | ||||||||||||||||||
| 168 | \value NonClientAreaMouseButtonRelease A mouse button release occurred outside the client area. | - | ||||||||||||||||||
| 169 | \value NonClientAreaMouseMove A mouse move occurred outside the client area. | - | ||||||||||||||||||
| 170 | \value MacSizeChange The user changed his widget sizes (\macos only). | - | ||||||||||||||||||
| 171 | \value MetaCall An asynchronous method invocation via QMetaObject::invokeMethod(). | - | ||||||||||||||||||
| 172 | \value ModifiedChange Widgets modification state has been changed. | - | ||||||||||||||||||
| 173 | \value MouseButtonDblClick Mouse press again (QMouseEvent). | - | ||||||||||||||||||
| 174 | \value MouseButtonPress Mouse press (QMouseEvent). | - | ||||||||||||||||||
| 175 | \value MouseButtonRelease Mouse release (QMouseEvent). | - | ||||||||||||||||||
| 176 | \value MouseMove Mouse move (QMouseEvent). | - | ||||||||||||||||||
| 177 | \value MouseTrackingChange The mouse tracking state has changed. | - | ||||||||||||||||||
| 178 | \value Move Widget's position changed (QMoveEvent). | - | ||||||||||||||||||
| 179 | \value NativeGesture The system has detected a gesture (QNativeGestureEvent). | - | ||||||||||||||||||
| 180 | \value OrientationChange The screens orientation has changes (QScreenOrientationChangeEvent). | - | ||||||||||||||||||
| 181 | \value Paint Screen update necessary (QPaintEvent). | - | ||||||||||||||||||
| 182 | \value PaletteChange Palette of the widget changed. | - | ||||||||||||||||||
| 183 | \value ParentAboutToChange The widget parent is about to change. | - | ||||||||||||||||||
| 184 | \value ParentChange The widget parent has changed. | - | ||||||||||||||||||
| 185 | \value PlatformPanel A platform specific panel has been requested. | - | ||||||||||||||||||
| 186 | \value PlatformSurface A native platform surface has been created or is about to be destroyed (QPlatformSurfaceEvent). | - | ||||||||||||||||||
| 187 | \value Polish The widget is polished. | - | ||||||||||||||||||
| 188 | \value PolishRequest The widget should be polished. | - | ||||||||||||||||||
| 189 | \value QueryWhatsThis The widget should accept the event if it has "What's This?" help. | - | ||||||||||||||||||
| 190 | \value ReadOnlyChange Widget's read-only state has changed (since Qt 5.4). | - | ||||||||||||||||||
| 191 | \value RequestSoftwareInputPanel A widget wants to open a software input panel (SIP). | - | ||||||||||||||||||
| 192 | \value Resize Widget's size changed (QResizeEvent). | - | ||||||||||||||||||
| 193 | \value ScrollPrepare The object needs to fill in its geometry information (QScrollPrepareEvent). | - | ||||||||||||||||||
| 194 | \value Scroll The object needs to scroll to the supplied position (QScrollEvent). | - | ||||||||||||||||||
| 195 | \value Shortcut Key press in child for shortcut key handling (QShortcutEvent). | - | ||||||||||||||||||
| 196 | \value ShortcutOverride Key press in child, for overriding shortcut key handling (QKeyEvent). | - | ||||||||||||||||||
| 197 | \value Show Widget was shown on screen (QShowEvent). | - | ||||||||||||||||||
| 198 | \value ShowToParent A child widget has been shown. | - | ||||||||||||||||||
| 199 | \value SockAct Socket activated, used to implement QSocketNotifier. | - | ||||||||||||||||||
| 200 | \omitvalue SockClose | - | ||||||||||||||||||
| 201 | \value StateMachineSignal A signal delivered to a state machine (QStateMachine::SignalEvent). | - | ||||||||||||||||||
| 202 | \value StateMachineWrapped The event is a wrapper for, i.e., contains, another event (QStateMachine::WrappedEvent). | - | ||||||||||||||||||
| 203 | \value StatusTip A status tip is requested (QStatusTipEvent). | - | ||||||||||||||||||
| 204 | \value StyleChange Widget's style has been changed. | - | ||||||||||||||||||
| 205 | \value TabletMove Wacom tablet move (QTabletEvent). | - | ||||||||||||||||||
| 206 | \value TabletPress Wacom tablet press (QTabletEvent). | - | ||||||||||||||||||
| 207 | \value TabletRelease Wacom tablet release (QTabletEvent). | - | ||||||||||||||||||
| 208 | \value OkRequest Ok button in decoration pressed. Supported only for Windows CE. | - | ||||||||||||||||||
| 209 | \value TabletEnterProximity Wacom tablet enter proximity event (QTabletEvent), sent to QApplication. | - | ||||||||||||||||||
| 210 | \value TabletLeaveProximity Wacom tablet leave proximity event (QTabletEvent), sent to QApplication. | - | ||||||||||||||||||
| 211 | \omitvalue ThemeChange | - | ||||||||||||||||||
| 212 | \value ThreadChange The object is moved to another thread. This is the last event sent to this object in the previous thread. See QObject::moveToThread(). | - | ||||||||||||||||||
| 213 | \value Timer Regular timer events (QTimerEvent). | - | ||||||||||||||||||
| 214 | \value ToolBarChange The toolbar button is toggled on \macos. | - | ||||||||||||||||||
| 215 | \value ToolTip A tooltip was requested (QHelpEvent). | - | ||||||||||||||||||
| 216 | \value ToolTipChange The widget's tooltip has changed. | - | ||||||||||||||||||
| 217 | \value TouchBegin Beginning of a sequence of touch-screen or track-pad events (QTouchEvent). | - | ||||||||||||||||||
| 218 | \value TouchCancel Cancellation of touch-event sequence (QTouchEvent). | - | ||||||||||||||||||
| 219 | \value TouchEnd End of touch-event sequence (QTouchEvent). | - | ||||||||||||||||||
| 220 | \value TouchUpdate Touch-screen event (QTouchEvent). | - | ||||||||||||||||||
| 221 | \value UngrabKeyboard Item loses keyboard grab (QGraphicsItem only). | - | ||||||||||||||||||
| 222 | \value UngrabMouse Item loses mouse grab (QGraphicsItem, QQuickItem). | - | ||||||||||||||||||
| 223 | \value UpdateLater The widget should be queued to be repainted at a later time. | - | ||||||||||||||||||
| 224 | \value UpdateRequest The widget should be repainted. | - | ||||||||||||||||||
| 225 | \value WhatsThis The widget should reveal "What's This?" help (QHelpEvent). | - | ||||||||||||||||||
| 226 | \value WhatsThisClicked A link in a widget's "What's This?" help was clicked. | - | ||||||||||||||||||
| 227 | \value Wheel Mouse wheel rolled (QWheelEvent). | - | ||||||||||||||||||
| 228 | \value WinEventAct A Windows-specific activation event has occurred. | - | ||||||||||||||||||
| 229 | \value WindowActivate Window was activated. | - | ||||||||||||||||||
| 230 | \value WindowBlocked The window is blocked by a modal dialog. | - | ||||||||||||||||||
| 231 | \value WindowDeactivate Window was deactivated. | - | ||||||||||||||||||
| 232 | \value WindowIconChange The window's icon has changed. | - | ||||||||||||||||||
| 233 | \value WindowStateChange The \l{QWindow::windowState()}{window's state} (minimized, maximized or full-screen) has changed (QWindowStateChangeEvent). | - | ||||||||||||||||||
| 234 | \value WindowTitleChange The window title has changed. | - | ||||||||||||||||||
| 235 | \value WindowUnblocked The window is unblocked after a modal dialog exited. | - | ||||||||||||||||||
| 236 | \value WinIdChange The window system identifer for this native widget has changed. | - | ||||||||||||||||||
| 237 | \value ZOrderChange The widget's z-order has changed. This event is never sent to top level windows. | - | ||||||||||||||||||
| 238 | - | |||||||||||||||||||
| 239 | User events should have values between \c User and \c{MaxUser}: | - | ||||||||||||||||||
| 240 | - | |||||||||||||||||||
| 241 | \value User User-defined event. | - | ||||||||||||||||||
| 242 | \value MaxUser Last user event ID. | - | ||||||||||||||||||
| 243 | - | |||||||||||||||||||
| 244 | For convenience, you can use the registerEventType() function to | - | ||||||||||||||||||
| 245 | register and reserve a custom event type for your | - | ||||||||||||||||||
| 246 | application. Doing so will allow you to avoid accidentally | - | ||||||||||||||||||
| 247 | re-using a custom event type already in use elsewhere in your | - | ||||||||||||||||||
| 248 | application. | - | ||||||||||||||||||
| 249 | - | |||||||||||||||||||
| 250 | \omitvalue AcceptDropsChange | - | ||||||||||||||||||
| 251 | \omitvalue ActivateControl | - | ||||||||||||||||||
| 252 | \omitvalue Create | - | ||||||||||||||||||
| 253 | \omitvalue DeactivateControl | - | ||||||||||||||||||
| 254 | \omitvalue Destroy | - | ||||||||||||||||||
| 255 | \omitvalue DragResponse | - | ||||||||||||||||||
| 256 | \omitvalue EmbeddingControl | - | ||||||||||||||||||
| 257 | \omitvalue HelpRequest | - | ||||||||||||||||||
| 258 | \omitvalue Quit | - | ||||||||||||||||||
| 259 | \omitvalue ShowWindowRequest | - | ||||||||||||||||||
| 260 | \omitvalue Speech | - | ||||||||||||||||||
| 261 | \omitvalue Style | - | ||||||||||||||||||
| 262 | \omitvalue StyleAnimationUpdate | - | ||||||||||||||||||
| 263 | \omitvalue ZeroTimerEvent | - | ||||||||||||||||||
| 264 | \omitvalue ApplicationActivate | - | ||||||||||||||||||
| 265 | \omitvalue ApplicationActivated | - | ||||||||||||||||||
| 266 | \omitvalue ApplicationDeactivate | - | ||||||||||||||||||
| 267 | \omitvalue ApplicationDeactivated | - | ||||||||||||||||||
| 268 | \omitvalue MacGLWindowChange | - | ||||||||||||||||||
| 269 | \omitvalue MacGLClearDrawable | - | ||||||||||||||||||
| 270 | \omitvalue NetworkReplyUpdated | - | ||||||||||||||||||
| 271 | \omitvalue FutureCallOut | - | ||||||||||||||||||
| 272 | \omitvalue NativeGesture | - | ||||||||||||||||||
| 273 | \omitvalue WindowChangeInternal | - | ||||||||||||||||||
| 274 | \omitvalue ScreenChangeInternal | - | ||||||||||||||||||
| 275 | */ | - | ||||||||||||||||||
| 276 | - | |||||||||||||||||||
| 277 | /*! | - | ||||||||||||||||||
| 278 | Contructs an event object of type \a type. | - | ||||||||||||||||||
| 279 | */ | - | ||||||||||||||||||
| 280 | QEvent::QEvent(Type type) | - | ||||||||||||||||||
| 281 | : d(0), t(type), posted(false), spont(false), m_accept(true) | - | ||||||||||||||||||
| 282 | {} executed 2181899 times by 537 tests: end of blockExecuted by:
| 2181899 | ||||||||||||||||||
| 283 | - | |||||||||||||||||||
| 284 | /*! | - | ||||||||||||||||||
| 285 | \internal | - | ||||||||||||||||||
| 286 | Attempts to copy the \a other event. | - | ||||||||||||||||||
| 287 | - | |||||||||||||||||||
| 288 | Copying events is a bad idea, yet some Qt 4 code does it (notably, | - | ||||||||||||||||||
| 289 | QApplication and the state machine). | - | ||||||||||||||||||
| 290 | */ | - | ||||||||||||||||||
| 291 | QEvent::QEvent(const QEvent &other) | - | ||||||||||||||||||
| 292 | : d(other.d), t(other.t), posted(other.posted), spont(other.spont), | - | ||||||||||||||||||
| 293 | m_accept(other.m_accept) | - | ||||||||||||||||||
| 294 | { | - | ||||||||||||||||||
| 295 | // if QEventPrivate becomes available, make sure to implement a | - | ||||||||||||||||||
| 296 | // virtual QEventPrivate *clone() const; function so we can copy here | - | ||||||||||||||||||
| 297 | Q_ASSERT_X(!d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere"); | - | ||||||||||||||||||
| 298 | } executed 24 times by 1 test: end of blockExecuted by:
| 24 | ||||||||||||||||||
| 299 | - | |||||||||||||||||||
| 300 | /*! | - | ||||||||||||||||||
| 301 | \internal | - | ||||||||||||||||||
| 302 | Attempts to copy the \a other event. | - | ||||||||||||||||||
| 303 | - | |||||||||||||||||||
| 304 | Copying events is a bad idea, yet some Qt 4 code does it (notably, | - | ||||||||||||||||||
| 305 | QApplication and the state machine). | - | ||||||||||||||||||
| 306 | */ | - | ||||||||||||||||||
| 307 | QEvent &QEvent::operator=(const QEvent &other) | - | ||||||||||||||||||
| 308 | { | - | ||||||||||||||||||
| 309 | // if QEventPrivate becomes available, make sure to implement a | - | ||||||||||||||||||
| 310 | // virtual QEventPrivate *clone() const; function so we can copy here | - | ||||||||||||||||||
| 311 | Q_ASSERT_X(!other.d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere"); | - | ||||||||||||||||||
| 312 | - | |||||||||||||||||||
| 313 | t = other.t; | - | ||||||||||||||||||
| 314 | posted = other.posted; | - | ||||||||||||||||||
| 315 | spont = other.spont; | - | ||||||||||||||||||
| 316 | m_accept = other.m_accept; | - | ||||||||||||||||||
| 317 | return *this; executed 6721 times by 46 tests: return *this;Executed by:
| 6721 | ||||||||||||||||||
| 318 | } | - | ||||||||||||||||||
| 319 | - | |||||||||||||||||||
| 320 | /*! | - | ||||||||||||||||||
| 321 | Destroys the event. If it was \l{QCoreApplication::postEvent()}{posted}, | - | ||||||||||||||||||
| 322 | it will be removed from the list of events to be posted. | - | ||||||||||||||||||
| 323 | */ | - | ||||||||||||||||||
| 324 | - | |||||||||||||||||||
| 325 | QEvent::~QEvent() | - | ||||||||||||||||||
| 326 | { | - | ||||||||||||||||||
| 327 | if (posted && QCoreApplication::instance())
| 0-2181909 | ||||||||||||||||||
| 328 | QCoreApplicationPrivate::removePostedEvent(this); never executed: QCoreApplicationPrivate::removePostedEvent(this); | 0 | ||||||||||||||||||
| 329 | Q_ASSERT_X(!d, "QEvent", "Impossible, this can't happen: QEventPrivate isn't defined anywhere"); | - | ||||||||||||||||||
| 330 | } executed 2181909 times by 541 tests: end of blockExecuted by:
| 2181909 | ||||||||||||||||||
| 331 | - | |||||||||||||||||||
| 332 | - | |||||||||||||||||||
| 333 | /*! | - | ||||||||||||||||||
| 334 | \property QEvent::accepted | - | ||||||||||||||||||
| 335 | the accept flag of the event object | - | ||||||||||||||||||
| 336 | - | |||||||||||||||||||
| 337 | Setting the accept parameter indicates that the event receiver | - | ||||||||||||||||||
| 338 | wants the event. Unwanted events might be propagated to the parent | - | ||||||||||||||||||
| 339 | widget. By default, isAccepted() is set to true, but don't rely on | - | ||||||||||||||||||
| 340 | this as subclasses may choose to clear it in their constructor. | - | ||||||||||||||||||
| 341 | - | |||||||||||||||||||
| 342 | For convenience, the accept flag can also be set with accept(), | - | ||||||||||||||||||
| 343 | and cleared with ignore(). | - | ||||||||||||||||||
| 344 | */ | - | ||||||||||||||||||
| 345 | - | |||||||||||||||||||
| 346 | /*! | - | ||||||||||||||||||
| 347 | \fn void QEvent::accept() | - | ||||||||||||||||||
| 348 | - | |||||||||||||||||||
| 349 | Sets the accept flag of the event object, the equivalent of | - | ||||||||||||||||||
| 350 | calling setAccepted(true). | - | ||||||||||||||||||
| 351 | - | |||||||||||||||||||
| 352 | Setting the accept parameter indicates that the event receiver | - | ||||||||||||||||||
| 353 | wants the event. Unwanted events might be propagated to the parent | - | ||||||||||||||||||
| 354 | widget. | - | ||||||||||||||||||
| 355 | - | |||||||||||||||||||
| 356 | \sa ignore() | - | ||||||||||||||||||
| 357 | */ | - | ||||||||||||||||||
| 358 | - | |||||||||||||||||||
| 359 | - | |||||||||||||||||||
| 360 | /*! | - | ||||||||||||||||||
| 361 | \fn void QEvent::ignore() | - | ||||||||||||||||||
| 362 | - | |||||||||||||||||||
| 363 | Clears the accept flag parameter of the event object, the | - | ||||||||||||||||||
| 364 | equivalent of calling setAccepted(false). | - | ||||||||||||||||||
| 365 | - | |||||||||||||||||||
| 366 | Clearing the accept parameter indicates that the event receiver | - | ||||||||||||||||||
| 367 | does not want the event. Unwanted events might be propagated to the | - | ||||||||||||||||||
| 368 | parent widget. | - | ||||||||||||||||||
| 369 | - | |||||||||||||||||||
| 370 | \sa accept() | - | ||||||||||||||||||
| 371 | */ | - | ||||||||||||||||||
| 372 | - | |||||||||||||||||||
| 373 | - | |||||||||||||||||||
| 374 | /*! | - | ||||||||||||||||||
| 375 | \fn QEvent::Type QEvent::type() const | - | ||||||||||||||||||
| 376 | - | |||||||||||||||||||
| 377 | Returns the event type. | - | ||||||||||||||||||
| 378 | */ | - | ||||||||||||||||||
| 379 | - | |||||||||||||||||||
| 380 | /*! | - | ||||||||||||||||||
| 381 | \fn bool QEvent::spontaneous() const | - | ||||||||||||||||||
| 382 | - | |||||||||||||||||||
| 383 | Returns \c true if the event originated outside the application (a | - | ||||||||||||||||||
| 384 | system event); otherwise returns \c false. | - | ||||||||||||||||||
| 385 | - | |||||||||||||||||||
| 386 | The return value of this function is not defined for paint events. | - | ||||||||||||||||||
| 387 | */ | - | ||||||||||||||||||
| 388 | - | |||||||||||||||||||
| 389 | namespace { | - | ||||||||||||||||||
| 390 | template <size_t N> | - | ||||||||||||||||||
| 391 | struct QBasicAtomicBitField { | - | ||||||||||||||||||
| 392 | enum { | - | ||||||||||||||||||
| 393 | BitsPerInt = std::numeric_limits<uint>::digits, | - | ||||||||||||||||||
| 394 | NumInts = (N + BitsPerInt - 1) / BitsPerInt, | - | ||||||||||||||||||
| 395 | NumBits = N | - | ||||||||||||||||||
| 396 | }; | - | ||||||||||||||||||
| 397 | - | |||||||||||||||||||
| 398 | // This atomic int points to the next (possibly) free ID saving | - | ||||||||||||||||||
| 399 | // the otherwise necessary scan through 'data': | - | ||||||||||||||||||
| 400 | QBasicAtomicInteger<uint> next; | - | ||||||||||||||||||
| 401 | QBasicAtomicInteger<uint> data[NumInts]; | - | ||||||||||||||||||
| 402 | - | |||||||||||||||||||
| 403 | bool allocateSpecific(int which) Q_DECL_NOTHROW | - | ||||||||||||||||||
| 404 | { | - | ||||||||||||||||||
| 405 | QBasicAtomicInteger<uint> &entry = data[which / BitsPerInt]; | - | ||||||||||||||||||
| 406 | const uint old = entry.load(); | - | ||||||||||||||||||
| 407 | const uint bit = 1U << (which % BitsPerInt); | - | ||||||||||||||||||
| 408 | return !(old & bit) // wasn't taken executed 129072 times by 3 tests: return !(old & bit) && entry.testAndSetRelaxed(old, old | bit);Executed by:
| 64534-129072 | ||||||||||||||||||
| 409 | && entry.testAndSetRelaxed(old, old | bit); // still wasn't taken executed 129072 times by 3 tests: return !(old & bit) && entry.testAndSetRelaxed(old, old | bit);Executed by:
| 0-129072 | ||||||||||||||||||
| 410 | - | |||||||||||||||||||
| 411 | // don't update 'next' here - it's unlikely that it will need | - | ||||||||||||||||||
| 412 | // to be updated, in the general case, and having 'next' | - | ||||||||||||||||||
| 413 | // trailing a bit is not a problem, as it is just a starting | - | ||||||||||||||||||
| 414 | // hint for allocateNext(), which, when wrong, will just | - | ||||||||||||||||||
| 415 | // result in a few more rounds through the allocateNext() | - | ||||||||||||||||||
| 416 | // loop. | - | ||||||||||||||||||
| 417 | } | - | ||||||||||||||||||
| 418 | - | |||||||||||||||||||
| 419 | int allocateNext() Q_DECL_NOTHROW | - | ||||||||||||||||||
| 420 | { | - | ||||||||||||||||||
| 421 | // Unroll loop to iterate over ints, then bits? Would save | - | ||||||||||||||||||
| 422 | // potentially a lot of cmpxchgs, because we can scan the | - | ||||||||||||||||||
| 423 | // whole int before having to load it again. | - | ||||||||||||||||||
| 424 | - | |||||||||||||||||||
| 425 | // Then again, this should never execute many iterations, so | - | ||||||||||||||||||
| 426 | // leave like this for now: | - | ||||||||||||||||||
| 427 | for (uint i = next.load(); i < NumBits; ++i) {
| 1-64538 | ||||||||||||||||||
| 428 | if (allocateSpecific(i)) {
| 7-64531 | ||||||||||||||||||
| 429 | // remember next (possibly) free id: | - | ||||||||||||||||||
| 430 | const uint oldNext = next.load(); | - | ||||||||||||||||||
| 431 | next.testAndSetRelaxed(oldNext, qMax(i + 1, oldNext)); | - | ||||||||||||||||||
| 432 | return i; executed 7 times by 3 tests: return i;Executed by:
| 7 | ||||||||||||||||||
| 433 | } | - | ||||||||||||||||||
| 434 | } executed 64531 times by 1 test: end of blockExecuted by:
| 64531 | ||||||||||||||||||
| 435 | return -1; executed 1 time by 1 test: return -1;Executed by:
| 1 | ||||||||||||||||||
| 436 | } | - | ||||||||||||||||||
| 437 | }; | - | ||||||||||||||||||
| 438 | - | |||||||||||||||||||
| 439 | } // unnamed namespace | - | ||||||||||||||||||
| 440 | - | |||||||||||||||||||
| 441 | typedef QBasicAtomicBitField<QEvent::MaxUser - QEvent::User + 1> UserEventTypeRegistry; | - | ||||||||||||||||||
| 442 | - | |||||||||||||||||||
| 443 | static UserEventTypeRegistry userEventTypeRegistry; | - | ||||||||||||||||||
| 444 | - | |||||||||||||||||||
| 445 | static inline int registerEventTypeZeroBased(int id) Q_DECL_NOTHROW | - | ||||||||||||||||||
| 446 | { | - | ||||||||||||||||||
| 447 | // if the type hint hasn't been registered yet, take it: | - | ||||||||||||||||||
| 448 | if (id < UserEventTypeRegistry::NumBits && id >= 0 && userEventTypeRegistry.allocateSpecific(id))
| 1-64535 | ||||||||||||||||||
| 449 | return id; executed 64531 times by 1 test: return id;Executed by:
| 64531 | ||||||||||||||||||
| 450 | - | |||||||||||||||||||
| 451 | // otherwise, ignore hint: | - | ||||||||||||||||||
| 452 | return userEventTypeRegistry.allocateNext(); executed 8 times by 3 tests: return userEventTypeRegistry.allocateNext();Executed by:
| 8 | ||||||||||||||||||
| 453 | } | - | ||||||||||||||||||
| 454 | - | |||||||||||||||||||
| 455 | /*! | - | ||||||||||||||||||
| 456 | \since 4.4 | - | ||||||||||||||||||
| 457 | \threadsafe | - | ||||||||||||||||||
| 458 | - | |||||||||||||||||||
| 459 | Registers and returns a custom event type. The \a hint provided | - | ||||||||||||||||||
| 460 | will be used if it is available, otherwise it will return a value | - | ||||||||||||||||||
| 461 | between QEvent::User and QEvent::MaxUser that has not yet been | - | ||||||||||||||||||
| 462 | registered. The \a hint is ignored if its value is not between | - | ||||||||||||||||||
| 463 | QEvent::User and QEvent::MaxUser. | - | ||||||||||||||||||
| 464 | - | |||||||||||||||||||
| 465 | Returns -1 if all available values are already taken or the | - | ||||||||||||||||||
| 466 | program is shutting down. | - | ||||||||||||||||||
| 467 | */ | - | ||||||||||||||||||
| 468 | int QEvent::registerEventType(int hint) Q_DECL_NOTHROW | - | ||||||||||||||||||
| 469 | { | - | ||||||||||||||||||
| 470 | const int result = registerEventTypeZeroBased(QEvent::MaxUser - hint); | - | ||||||||||||||||||
| 471 | return result < 0 ? -1 : QEvent::MaxUser - result ; executed 64539 times by 3 tests: return result < 0 ? -1 : QEvent::MaxUser - result ;Executed by:
| 1-64539 | ||||||||||||||||||
| 472 | } | - | ||||||||||||||||||
| 473 | - | |||||||||||||||||||
| 474 | /*! | - | ||||||||||||||||||
| 475 | \class QTimerEvent | - | ||||||||||||||||||
| 476 | \inmodule QtCore | - | ||||||||||||||||||
| 477 | \brief The QTimerEvent class contains parameters that describe a | - | ||||||||||||||||||
| 478 | timer event. | - | ||||||||||||||||||
| 479 | - | |||||||||||||||||||
| 480 | \ingroup events | - | ||||||||||||||||||
| 481 | - | |||||||||||||||||||
| 482 | Timer events are sent at regular intervals to objects that have | - | ||||||||||||||||||
| 483 | started one or more timers. Each timer has a unique identifier. A | - | ||||||||||||||||||
| 484 | timer is started with QObject::startTimer(). | - | ||||||||||||||||||
| 485 | - | |||||||||||||||||||
| 486 | The QTimer class provides a high-level programming interface that | - | ||||||||||||||||||
| 487 | uses signals instead of events. It also provides single-shot timers. | - | ||||||||||||||||||
| 488 | - | |||||||||||||||||||
| 489 | The event handler QObject::timerEvent() receives timer events. | - | ||||||||||||||||||
| 490 | - | |||||||||||||||||||
| 491 | \sa QTimer, QObject::timerEvent(), QObject::startTimer(), | - | ||||||||||||||||||
| 492 | QObject::killTimer() | - | ||||||||||||||||||
| 493 | */ | - | ||||||||||||||||||
| 494 | - | |||||||||||||||||||
| 495 | /*! | - | ||||||||||||||||||
| 496 | Constructs a timer event object with the timer identifier set to | - | ||||||||||||||||||
| 497 | \a timerId. | - | ||||||||||||||||||
| 498 | */ | - | ||||||||||||||||||
| 499 | QTimerEvent::QTimerEvent(int timerId) | - | ||||||||||||||||||
| 500 | : QEvent(Timer), id(timerId) | - | ||||||||||||||||||
| 501 | {} executed 50431 times by 114 tests: end of blockExecuted by:
| 50431 | ||||||||||||||||||
| 502 | - | |||||||||||||||||||
| 503 | /*! | - | ||||||||||||||||||
| 504 | \internal | - | ||||||||||||||||||
| 505 | */ | - | ||||||||||||||||||
| 506 | QTimerEvent::~QTimerEvent() | - | ||||||||||||||||||
| 507 | { | - | ||||||||||||||||||
| 508 | } | - | ||||||||||||||||||
| 509 | - | |||||||||||||||||||
| 510 | /*! | - | ||||||||||||||||||
| 511 | \fn int QTimerEvent::timerId() const | - | ||||||||||||||||||
| 512 | - | |||||||||||||||||||
| 513 | Returns the unique timer identifier, which is the same identifier | - | ||||||||||||||||||
| 514 | as returned from QObject::startTimer(). | - | ||||||||||||||||||
| 515 | */ | - | ||||||||||||||||||
| 516 | - | |||||||||||||||||||
| 517 | /*! | - | ||||||||||||||||||
| 518 | \class QChildEvent | - | ||||||||||||||||||
| 519 | \inmodule QtCore | - | ||||||||||||||||||
| 520 | \brief The QChildEvent class contains event parameters for child object | - | ||||||||||||||||||
| 521 | events. | - | ||||||||||||||||||
| 522 | - | |||||||||||||||||||
| 523 | \ingroup events | - | ||||||||||||||||||
| 524 | - | |||||||||||||||||||
| 525 | Child events are sent immediately to objects when children are | - | ||||||||||||||||||
| 526 | added or removed. | - | ||||||||||||||||||
| 527 | - | |||||||||||||||||||
| 528 | In both cases you can only rely on the child being a QObject (or, | - | ||||||||||||||||||
| 529 | if QObject::isWidgetType() returns \c true, a QWidget). This is | - | ||||||||||||||||||
| 530 | because in the QEvent::ChildAdded case the child is not yet fully | - | ||||||||||||||||||
| 531 | constructed; in the QEvent::ChildRemoved case it might have | - | ||||||||||||||||||
| 532 | already been destructed. | - | ||||||||||||||||||
| 533 | - | |||||||||||||||||||
| 534 | The handler for these events is QObject::childEvent(). | - | ||||||||||||||||||
| 535 | */ | - | ||||||||||||||||||
| 536 | - | |||||||||||||||||||
| 537 | /*! | - | ||||||||||||||||||
| 538 | Constructs a child event object of a particular \a type for the | - | ||||||||||||||||||
| 539 | \a child. | - | ||||||||||||||||||
| 540 | - | |||||||||||||||||||
| 541 | \a type can be QEvent::ChildAdded, QEvent::ChildRemoved, | - | ||||||||||||||||||
| 542 | or QEvent::ChildPolished. | - | ||||||||||||||||||
| 543 | - | |||||||||||||||||||
| 544 | \sa child() | - | ||||||||||||||||||
| 545 | */ | - | ||||||||||||||||||
| 546 | QChildEvent::QChildEvent(Type type, QObject *child) | - | ||||||||||||||||||
| 547 | : QEvent(type), c(child) | - | ||||||||||||||||||
| 548 | {} executed 322288 times by 502 tests: end of blockExecuted by:
| 322288 | ||||||||||||||||||
| 549 | - | |||||||||||||||||||
| 550 | /*! | - | ||||||||||||||||||
| 551 | \internal | - | ||||||||||||||||||
| 552 | */ | - | ||||||||||||||||||
| 553 | QChildEvent::~QChildEvent() | - | ||||||||||||||||||
| 554 | { | - | ||||||||||||||||||
| 555 | } | - | ||||||||||||||||||
| 556 | - | |||||||||||||||||||
| 557 | /*! | - | ||||||||||||||||||
| 558 | \fn QObject *QChildEvent::child() const | - | ||||||||||||||||||
| 559 | - | |||||||||||||||||||
| 560 | Returns the child object that was added or removed. | - | ||||||||||||||||||
| 561 | */ | - | ||||||||||||||||||
| 562 | - | |||||||||||||||||||
| 563 | /*! | - | ||||||||||||||||||
| 564 | \fn bool QChildEvent::added() const | - | ||||||||||||||||||
| 565 | - | |||||||||||||||||||
| 566 | Returns \c true if type() is QEvent::ChildAdded; otherwise returns | - | ||||||||||||||||||
| 567 | false. | - | ||||||||||||||||||
| 568 | */ | - | ||||||||||||||||||
| 569 | - | |||||||||||||||||||
| 570 | /*! | - | ||||||||||||||||||
| 571 | \fn bool QChildEvent::removed() const | - | ||||||||||||||||||
| 572 | - | |||||||||||||||||||
| 573 | Returns \c true if type() is QEvent::ChildRemoved; otherwise returns | - | ||||||||||||||||||
| 574 | false. | - | ||||||||||||||||||
| 575 | */ | - | ||||||||||||||||||
| 576 | - | |||||||||||||||||||
| 577 | /*! | - | ||||||||||||||||||
| 578 | \fn bool QChildEvent::polished() const | - | ||||||||||||||||||
| 579 | - | |||||||||||||||||||
| 580 | Returns \c true if type() is QEvent::ChildPolished; otherwise returns | - | ||||||||||||||||||
| 581 | false. | - | ||||||||||||||||||
| 582 | */ | - | ||||||||||||||||||
| 583 | - | |||||||||||||||||||
| 584 | - | |||||||||||||||||||
| 585 | /*! | - | ||||||||||||||||||
| 586 | \class QDynamicPropertyChangeEvent | - | ||||||||||||||||||
| 587 | \inmodule QtCore | - | ||||||||||||||||||
| 588 | \since 4.2 | - | ||||||||||||||||||
| 589 | \brief The QDynamicPropertyChangeEvent class contains event parameters for dynamic | - | ||||||||||||||||||
| 590 | property change events. | - | ||||||||||||||||||
| 591 | - | |||||||||||||||||||
| 592 | \ingroup events | - | ||||||||||||||||||
| 593 | - | |||||||||||||||||||
| 594 | Dynamic property change events are sent to objects when properties are | - | ||||||||||||||||||
| 595 | dynamically added, changed or removed using QObject::setProperty(). | - | ||||||||||||||||||
| 596 | */ | - | ||||||||||||||||||
| 597 | - | |||||||||||||||||||
| 598 | /*! | - | ||||||||||||||||||
| 599 | Constructs a dynamic property change event object with the property name set to | - | ||||||||||||||||||
| 600 | \a name. | - | ||||||||||||||||||
| 601 | */ | - | ||||||||||||||||||
| 602 | QDynamicPropertyChangeEvent::QDynamicPropertyChangeEvent(const QByteArray &name) | - | ||||||||||||||||||
| 603 | : QEvent(QEvent::DynamicPropertyChange), n(name) | - | ||||||||||||||||||
| 604 | { | - | ||||||||||||||||||
| 605 | } executed 10431 times by 69 tests: end of blockExecuted by:
| 10431 | ||||||||||||||||||
| 606 | - | |||||||||||||||||||
| 607 | /*! | - | ||||||||||||||||||
| 608 | \internal | - | ||||||||||||||||||
| 609 | */ | - | ||||||||||||||||||
| 610 | QDynamicPropertyChangeEvent::~QDynamicPropertyChangeEvent() | - | ||||||||||||||||||
| 611 | { | - | ||||||||||||||||||
| 612 | } | - | ||||||||||||||||||
| 613 | - | |||||||||||||||||||
| 614 | /*! | - | ||||||||||||||||||
| 615 | \fn QByteArray QDynamicPropertyChangeEvent::propertyName() const | - | ||||||||||||||||||
| 616 | - | |||||||||||||||||||
| 617 | Returns the name of the dynamic property that was added, changed or | - | ||||||||||||||||||
| 618 | removed. | - | ||||||||||||||||||
| 619 | - | |||||||||||||||||||
| 620 | \sa QObject::setProperty(), QObject::dynamicPropertyNames() | - | ||||||||||||||||||
| 621 | */ | - | ||||||||||||||||||
| 622 | - | |||||||||||||||||||
| 623 | /*! | - | ||||||||||||||||||
| 624 | Constructs a deferred delete event with an initial loopLevel() of zero. | - | ||||||||||||||||||
| 625 | */ | - | ||||||||||||||||||
| 626 | QDeferredDeleteEvent::QDeferredDeleteEvent() | - | ||||||||||||||||||
| 627 | : QEvent(QEvent::DeferredDelete) | - | ||||||||||||||||||
| 628 | , level(0) | - | ||||||||||||||||||
| 629 | { executed 11212 times by 213 tests: }end of blockExecuted by:
executed 11212 times by 213 tests: end of blockExecuted by:
| 11212 | ||||||||||||||||||
| 630 | - | |||||||||||||||||||
| 631 | /*! | - | ||||||||||||||||||
| 632 | \internal | - | ||||||||||||||||||
| 633 | */ | - | ||||||||||||||||||
| 634 | QDeferredDeleteEvent::~QDeferredDeleteEvent() | - | ||||||||||||||||||
| 635 | { } | - | ||||||||||||||||||
| 636 | - | |||||||||||||||||||
| 637 | /*! \fn int QDeferredDeleteEvent::loopLevel() const | - | ||||||||||||||||||
| 638 | - | |||||||||||||||||||
| 639 | Returns the loop-level in which the event was posted. The | - | ||||||||||||||||||
| 640 | loop-level is set by QCoreApplication::postEvent(). | - | ||||||||||||||||||
| 641 | - | |||||||||||||||||||
| 642 | \sa QObject::deleteLater() | - | ||||||||||||||||||
| 643 | */ | - | ||||||||||||||||||
| 644 | - | |||||||||||||||||||
| 645 | QT_END_NAMESPACE | - | ||||||||||||||||||
| Source code | Switch to Preprocessed file |