summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qevent.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r--src/gui/kernel/qevent.h176
1 files changed, 30 insertions, 146 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index a6196346a7..de0d6b3793 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -50,7 +50,6 @@
#include <QtGui/qkeysequence.h>
#include <QtCore/qcoreevent.h>
#include <QtGui/qmime.h>
-#include <QtGui/qdrag.h>
#include <QtCore/qvariant.h>
#include <QtCore/qmap.h>
#include <QtCore/qset.h>
@@ -104,15 +103,6 @@ public:
const QPointF &posF() const { return p; }
const QPointF &globalPosF() const { return g; }
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QMouseEvent(Type type, const QPoint &pos, Qt::ButtonState button, int state);
- QT3_SUPPORT_CONSTRUCTOR QMouseEvent(Type type, const QPoint &pos, const QPoint &globalPos,
- Qt::ButtonState button, int state);
- inline QT3_SUPPORT Qt::ButtonState state() const
- { return Qt::ButtonState((mouseState^b)|int(modifiers())); }
- inline QT3_SUPPORT Qt::ButtonState stateAfter() const
- { return Qt::ButtonState(int(mouseState)|int(modifiers())); }
-#endif
protected:
QPointF p, g;
Qt::MouseButton b;
@@ -161,14 +151,6 @@ public:
inline const QPointF &posF() const { return p; }
inline const QPointF &globalPosF() const { return g; }
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QWheelEvent(const QPoint &pos, int delta, int state,
- Qt::Orientation orient = Qt::Vertical);
- QT3_SUPPORT_CONSTRUCTOR QWheelEvent(const QPoint &pos, const QPoint& globalPos, int delta, int state,
- Qt::Orientation orient = Qt::Vertical);
- inline QT3_SUPPORT Qt::ButtonState state() const
- { return static_cast<Qt::ButtonState>(int(buttons())|int(modifiers())); }
-#endif
protected:
QPointF p;
QPointF g;
@@ -251,22 +233,6 @@ public:
quint32 nativeVirtualKey() const;
quint32 nativeModifiers() const;
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT_CONSTRUCTOR QKeyEvent(Type type, int key, int /*ascii*/,
- int modifiers, const QString& text = QString(),
- bool autorep = false, ushort count = 1)
- : QInputEvent(type, Qt::KeyboardModifiers(modifiers & (int)Qt::KeyButtonMask)), txt(text), k(key),
- c(count), autor(autorep)
- {
- if (key >= Qt::Key_Back && key <= Qt::Key_MediaLast)
- ignore();
- }
- inline QT3_SUPPORT int ascii() const
- { return (txt.length() ? txt.unicode()->toLatin1() : 0); }
- inline QT3_SUPPORT Qt::ButtonState state() const { return Qt::ButtonState(QInputEvent::modifiers()); }
- inline QT3_SUPPORT Qt::ButtonState stateAfter() const { return Qt::ButtonState(modifiers()); }
-#endif
-
protected:
QString txt;
int k;
@@ -284,12 +250,6 @@ public:
inline bool gotFocus() const { return type() == FocusIn; }
inline bool lostFocus() const { return type() == FocusOut; }
-#ifdef QT3_SUPPORT
- enum Reason { Mouse=Qt::MouseFocusReason, Tab=Qt::TabFocusReason,
- Backtab=Qt::BacktabFocusReason, MenuBar=Qt::MenuBarFocusReason,
- ActiveWindow=Qt::ActiveWindowFocusReason, Other=Qt::OtherFocusReason,
- Popup=Qt::PopupFocusReason, Shortcut=Qt::ShortcutFocusReason };
-#endif
Qt::FocusReason reason();
Qt::FocusReason reason() const;
@@ -308,12 +268,6 @@ public:
inline const QRect &rect() const { return m_rect; }
inline const QRegion &region() const { return m_region; }
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QPaintEvent(const QRegion &paintRegion, const QRect &paintRect);
- inline QT3_SUPPORT bool erased() const { return m_erased; }
- inline QT3_SUPPORT void setErased(bool b) { m_erased = b; }
-#endif
-
protected:
friend class QApplication;
friend class QCoreApplication;
@@ -322,7 +276,8 @@ protected:
bool m_erased;
};
-class QUpdateLaterEvent : public QEvent
+// ### Qt5: make internal
+class Q_GUI_EXPORT QUpdateLaterEvent : public QEvent
{
public:
QUpdateLaterEvent(const QRegion& paintRegion);
@@ -348,6 +303,17 @@ protected:
friend class QCoreApplication;
};
+class Q_GUI_EXPORT QExposeEvent : public QEvent
+{
+public:
+ QExposeEvent(const QRegion &rgn);
+ ~QExposeEvent();
+
+ inline const QRegion &region() const { return rgn; }
+
+protected:
+ QRegion rgn;
+};
class Q_GUI_EXPORT QResizeEvent : public QEvent
{
@@ -417,12 +383,6 @@ public:
inline Reason reason() const { return Reason(reas); }
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos, int);
- QT3_SUPPORT_CONSTRUCTOR QContextMenuEvent(Reason reason, const QPoint &pos, int);
-
- QT3_SUPPORT Qt::ButtonState state() const;
-#endif
protected:
QPoint p;
QPoint gp;
@@ -470,6 +430,22 @@ private:
int replace_from;
int replace_length;
};
+
+class Q_GUI_EXPORT QInputMethodQueryEvent : public QEvent
+{
+public:
+ QInputMethodQueryEvent(Qt::InputMethodQuery query);
+ ~QInputMethodQueryEvent();
+
+ Qt::InputMethodQuery query() const { return m_query; }
+
+ void setValue(const QVariant &v) { m_value = v; }
+ QVariant value() const { return m_value; }
+private:
+ Qt::InputMethodQuery m_query;
+ QVariant m_value;
+};
+
#endif // QT_NO_INPUTMETHOD
#ifndef QT_NO_DRAGANDDROP
@@ -497,7 +473,7 @@ public:
inline Qt::DropAction dropAction() const { return drop_action; }
void setDropAction(Qt::DropAction action);
- QWidget* source() const;
+ QObject* source() const;
inline const QMimeData *mimeData() const { return mdata; }
// QT3_SUPPORT
@@ -505,16 +481,6 @@ public:
QByteArray encodedData(const char*) const;
bool provides(const char*) const;
// END QT3_SUPPORT
-#ifdef QT3_SUPPORT
- inline void accept() { QEvent::accept(); }
- inline QT3_SUPPORT void accept(bool y) { setAccepted(y); }
- inline QT3_SUPPORT QByteArray data(const char* f) const { return encodedData(f); }
-
- enum Action { Copy, Link, Move, Private, UserAction = Private };
- QT3_SUPPORT Action action() const;
- inline QT3_SUPPORT void acceptAction(bool y = true) { if (y) { drop_action = default_action; accept(); } }
- inline QT3_SUPPORT void setPoint(const QPoint& np) { p = np; }
-#endif
protected:
@@ -545,10 +511,6 @@ public:
inline void accept(const QRect & r) { accept(); rect = r; }
inline void ignore(const QRect & r) { ignore(); rect = r; }
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT void accept(bool y) { setAccepted(y); }
-#endif
-
protected:
friend class QApplication;
QRect rect;
@@ -564,19 +526,6 @@ public:
};
-/* An internal class */
-class Q_GUI_EXPORT QDragResponseEvent : public QEvent
-{
-public:
- QDragResponseEvent(bool accepted);
- ~QDragResponseEvent();
-
- inline bool dragAccepted() const { return a; }
-protected:
- bool a;
-};
-
-
class Q_GUI_EXPORT QDragLeaveEvent : public QEvent
{
public:
@@ -719,18 +668,6 @@ private:
Qt::WindowStates ostate;
};
-#ifdef QT3_SUPPORT
-class QMenuBar;
-class Q_GUI_EXPORT QMenubarUpdatedEvent: public QEvent
-{
-public:
- QMenubarUpdatedEvent(QMenuBar * const menBar);
- inline QMenuBar *menuBar() { return m_menuBar; }
-private:
- QMenuBar *m_menuBar;
-};
-#endif
-
#ifndef QT_NO_DEBUG_STREAM
Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *);
#endif
@@ -838,59 +775,6 @@ protected:
friend class QApplicationPrivate;
};
-#ifndef QT_NO_GESTURES
-class QGesture;
-class QGestureEventPrivate;
-class Q_GUI_EXPORT QGestureEvent : public QEvent
-{
-public:
- QGestureEvent(const QList<QGesture *> &gestures);
- ~QGestureEvent();
-
- QList<QGesture *> gestures() const;
- QGesture *gesture(Qt::GestureType type) const;
-
- QList<QGesture *> activeGestures() const;
- QList<QGesture *> canceledGestures() const;
-
-#ifdef Q_NO_USING_KEYWORD
- inline void setAccepted(bool accepted) { QEvent::setAccepted(accepted); }
- inline bool isAccepted() const { return QEvent::isAccepted(); }
-
- inline void accept() { QEvent::accept(); }
- inline void ignore() { QEvent::ignore(); }
-#else
- using QEvent::setAccepted;
- using QEvent::isAccepted;
- using QEvent::accept;
- using QEvent::ignore;
-#endif
-
- void setAccepted(QGesture *, bool);
- void accept(QGesture *);
- void ignore(QGesture *);
- bool isAccepted(QGesture *) const;
-
- void setAccepted(Qt::GestureType, bool);
- void accept(Qt::GestureType);
- void ignore(Qt::GestureType);
- bool isAccepted(Qt::GestureType) const;
-
- void setWidget(QWidget *widget);
- QWidget *widget() const;
-
-#ifndef QT_NO_GRAPHICSVIEW
- QPointF mapToGraphicsScene(const QPointF &gesturePoint) const;
-#endif
-
-private:
- QGestureEventPrivate *d_func();
- const QGestureEventPrivate *d_func() const;
-
- friend class QApplication;
- friend class QGestureManager;
-};
-#endif // QT_NO_GESTURES
class QScrollPrepareEventPrivate;
class Q_GUI_EXPORT QScrollPrepareEvent : public QEvent