diff options
author | Jeremy Katz <jeremy.katz@nokia.com> | 2010-02-01 12:42:56 (GMT) |
---|---|---|
committer | Jeremy Katz <jeremy.katz@nokia.com> | 2010-02-01 12:42:56 (GMT) |
commit | f4588871d38d244c83e50354da66d145ae40be8f (patch) | |
tree | 0cc6c21c87edfe35ebb50cc0dc9a115aa7782656 /src/gui/kernel/qapplication_p.h | |
parent | 6fe259f696b5cc302bda6befcefe0a94e2676325 (diff) | |
download | Qt-f4588871d38d244c83e50354da66d145ae40be8f.zip Qt-f4588871d38d244c83e50354da66d145ae40be8f.tar.gz Qt-f4588871d38d244c83e50354da66d145ae40be8f.tar.bz2 |
Change mouse, key, and wheel events to use a window id instead of a pointer to a QWidget
Diffstat (limited to 'src/gui/kernel/qapplication_p.h')
-rw-r--r-- | src/gui/kernel/qapplication_p.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 75bc5bd..d07b83b 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -570,16 +570,16 @@ public: class UserEvent { public: - UserEvent(QWidget *w, QEvent::Type t, ulong time) { tlw = w; type = t; timestamp = time; } - QWidget * tlw; + UserEvent(WId w, ulong time, QEvent::Type t) { id = w; type = t; timestamp = time; } + WId id; QEvent::Type type; unsigned long timestamp; }; class MouseEvent : public UserEvent { public: - MouseEvent(QWidget *w, ulong time, const QPoint & local, const QPoint & global, Qt::MouseButtons b) - : UserEvent(w, QEvent::MouseMove, time){ localPos = local; globalPos = global; buttons = b; } + MouseEvent(WId w, ulong time, const QPoint & local, const QPoint & global, Qt::MouseButtons b) + : UserEvent(w, time, QEvent::MouseMove){ localPos = local; globalPos = global; buttons = b; } QPoint localPos; QPoint globalPos; Qt::MouseButtons buttons; @@ -587,8 +587,8 @@ public: class WheelEvent : public UserEvent { public: - WheelEvent(QWidget *w, ulong time, const QPoint & local, const QPoint & global, int d, Qt::Orientation o) - : UserEvent(w, QEvent::Wheel, time) { localPos = local; globalPos = global; delta = d; orient = o; } + WheelEvent(WId w, ulong time, const QPoint & local, const QPoint & global, int d, Qt::Orientation o) + : UserEvent(w, time, QEvent::Wheel) { localPos = local; globalPos = global; delta = d; orient = o; } int delta; QPoint localPos; QPoint globalPos; @@ -597,8 +597,8 @@ public: class KeyEvent : public UserEvent { public: - KeyEvent(QWidget *w, QEvent::Type t, ulong time, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1) - :UserEvent(w, t, time){ key = k; unicode = text; repeat = autorep; repeatCount = count; modifiers = mods; } + KeyEvent(WId w, ulong time, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1) + :UserEvent(w, time, t){ key = k; unicode = text; repeat = autorep; repeatCount = count; modifiers = mods; } int key; QString unicode; bool repeat; @@ -606,29 +606,29 @@ public: Qt::KeyboardModifiers modifiers; }; - static void handleMouseEvent(QWidget *w, const QPoint & local, const QPoint & global, Qt::MouseButtons b) { + static void handleMouseEvent(WId w, const QPoint & local, const QPoint & global, Qt::MouseButtons b) { handleMouseEvent(w, time.elapsed(), local, global, b); } - static void handleMouseEvent(QWidget *w, ulong timestamp, const QPoint & local, const QPoint & global, Qt::MouseButtons b) { + static void handleMouseEvent(WId w, ulong timestamp, const QPoint & local, const QPoint & global, Qt::MouseButtons b) { MouseEvent * e = new MouseEvent(w, timestamp, local, global, b); queueUserEvent(e); } - static void handleKeyEvent(QWidget *w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1) { - handleKeyEvent(w, t, time.elapsed(), k, mods, text, autorep, count); + static void handleKeyEvent(WId w, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1) { + handleKeyEvent(w, time.elapsed(), t, k, mods, text, autorep, count); } - static void handleKeyEvent(QWidget *w, QEvent::Type t, ulong timestamp, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1) { - KeyEvent * e = new KeyEvent(w, t, timestamp, k, mods, text, autorep, count); + static void handleKeyEvent(WId w, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text = QString(), bool autorep = false, ushort count = 1) { + KeyEvent * e = new KeyEvent(w, timestamp, t, k, mods, text, autorep, count); queueUserEvent(e); } - static void handleWheelEvent(QWidget *w, const QPoint & local, const QPoint & global, int d, Qt::Orientation o) { + static void handleWheelEvent(WId w, const QPoint & local, const QPoint & global, int d, Qt::Orientation o) { handleWheelEvent(w, time.elapsed(), local, global, d, o); } - static void handleWheelEvent(QWidget *w, ulong timestamp, const QPoint & local, const QPoint & global, int d, Qt::Orientation o) { + static void handleWheelEvent(WId w, ulong timestamp, const QPoint & local, const QPoint & global, int d, Qt::Orientation o) { WheelEvent *e = new WheelEvent(w, timestamp, local, global, d, o); queueUserEvent(e); } |