From 8304c8087d269b5b48621cc18d3ebe2bd369ebf4 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 9 Jan 2014 15:29:28 +0100 Subject: Doc: Update description of QKeyEvent class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the description on how to use the QKeyEvent pointer passed to key event handlers, and remove an outdated note about multimedia key events. Change-Id: I67a3f0054e28b84d5a0e367c02a329f4670221c7 Task-number: QTBUG-35155 Reviewed-by: Topi Reiniƶ --- src/gui/kernel/qevent.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index f99f28d6e0..a8539e8013 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -897,12 +897,11 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos, when keys are pressed or released. A key event contains a special accept flag that indicates whether - the receiver will handle the key event. You should call ignore() - if the key press or release event is not handled by your widget. - A key event is propagated up the parent widget chain until a - widget accepts it with accept() or an event filter consumes it. - Key events for multimedia keys are ignored by default. You should - call accept() if your widget handles those events. + the receiver will handle the key event. This flag is set by default, + so there is no need to call accept() when acting on a key event. + Calling ignore() on a key event will propagate it to the parent widget. + The event is propagated up the parent widget chain until a widget + accepts it or an event filter consumes it. The QWidget::setEnable() function can be used to enable or disable mouse and keyboard events for a widget. -- cgit v1.2.3