summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Engvoldsen <morten.engvoldsen@nokia.com>2009-11-10 21:02:21 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2009-11-11 17:34:41 (GMT)
commit86dc11d741d74fbd2512ce7d048340937d99e184 (patch)
treeba07d602938af5cb6aee0187fd922343d384fef6
parentb746654fb9379c37c8220e2ee3a950863517a095 (diff)
downloadQt-86dc11d741d74fbd2512ce7d048340937d99e184.zip
Qt-86dc11d741d74fbd2512ce7d048340937d99e184.tar.gz
Qt-86dc11d741d74fbd2512ce7d048340937d99e184.tar.bz2
Documentation: Adding comments to QHoverEvent class
Explaining the difference between hover events and enter/leave/move events Task-number: QT-1116 Reviewed-by: Bjørn Erik Nilsen
-rw-r--r--doc/src/images/hoverevents.pngbin0 -> 3210 bytes
-rw-r--r--src/gui/kernel/qevent.cpp34
2 files changed, 34 insertions, 0 deletions
diff --git a/doc/src/images/hoverevents.png b/doc/src/images/hoverevents.png
new file mode 100644
index 0000000..ccc079b
--- /dev/null
+++ b/doc/src/images/hoverevents.png
Binary files differ
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index ff97405..c4a25e1 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -399,6 +399,40 @@ QMouseEventEx::~QMouseEventEx()
The function pos() gives the current cursor position, while oldPos() gives
the old mouse position.
+
+ There are a few similarities between the events QEvent::HoverEnter
+ and QEvent::HoverLeave, and the events QEvent::Enter and QEvent::Leave.
+ However, they are slightly different because we do an update() in the event
+ handler of HoverEnter and HoverLeave.
+
+ QEvent::HoverMove is also slightly different from QEvent::MouseMove. Let us
+ consider a top-level window A containing a child B which in turn contains a
+ child C (all with mouse tracking enabled):
+
+ \image hoverEvents.png
+
+ Now, if you move the cursor from the top to the bottom in the middle of A,
+ you will get the following QEvent::MouseMove events:
+
+ \list 1
+ \o A::MouseMove
+ \o B::MouseMove
+ \o C::MouseMove
+ \endlist
+
+ You will get the same events for QEvent::HoverMove, except that the event
+ always propagates to the top-level regardless whether the event is accepted
+ or not. It will only stop propagating with the Qt::WA_NoMousePropagation
+ attribute.
+
+ In this case the events will occur in the following way:
+
+ \list 1
+ \o A::HoverMove
+ \o A::HoverMove, B::HoverMove
+ \o A::HoverMove, B::HoverMove, C::HoverMove
+ \endlist
+
*/
/*!