45 #include <QtGui/qwindowdefs.h> 46 #include <QtCore/qobject.h> 47 #include <QtGui/qregion.h> 48 #include <QtCore/qnamespace.h> 49 #include <QtCore/qstring.h> 50 #include <QtGui/qkeysequence.h> 51 #include <QtCore/qcoreevent.h> 52 #include <QtGui/qmime.h> 53 #include <QtGui/qdrag.h> 54 #include <QtCore/qvariant.h> 55 #include <QtCore/qmap.h> 56 #include <QtCore/qset.h> 57 #include <QtCore/qfile.h> 70 #ifndef QT_NO_GESTURES 79 inline Qt::KeyboardModifiers
modifiers()
const {
return modState; }
80 inline void setModifiers(Qt::KeyboardModifiers amodifiers) { modState = amodifiers; }
89 Qt::MouseButtons
buttons, Qt::KeyboardModifiers modifiers);
92 Qt::KeyboardModifiers modifiers);
97 inline int x()
const {
return p.x(); }
98 inline int y()
const {
return p.y(); }
99 inline int globalX()
const {
return g.x(); }
102 inline Qt::MouseButtons
buttons()
const {
return mouseState; }
106 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
111 QT3_SUPPORT_CONSTRUCTOR
QMouseEvent(
Type type,
const QPoint &pos, Qt::ButtonState button,
int state);
112 QT3_SUPPORT_CONSTRUCTOR QMouseEvent(
Type type,
const QPoint &pos,
const QPoint &globalPos,
113 Qt::ButtonState button,
int state);
114 inline QT3_SUPPORT Qt::ButtonState state()
const 115 {
return Qt::ButtonState((mouseState^b)|
int(
modifiers())); }
116 inline QT3_SUPPORT Qt::ButtonState stateAfter()
const 117 {
return Qt::ButtonState(
int(mouseState)|
int(
modifiers())); }
138 #ifndef QT_NO_WHEELEVENT 143 Qt::MouseButtons
buttons, Qt::KeyboardModifiers modifiers,
146 Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
153 inline int x()
const {
return p.x(); }
154 inline int y()
const {
return p.y(); }
158 inline Qt::MouseButtons
buttons()
const {
return mouseState; }
164 QT3_SUPPORT_CONSTRUCTOR QWheelEvent(
const QPoint &pos,
const QPoint& globalPos,
int delta,
int state,
166 inline QT3_SUPPORT Qt::ButtonState state()
const 178 #ifndef QT_NO_TABLETEVENT 183 XFreeEraser , RotationStylus };
186 int device,
int pointerType,
qreal pressure,
int xTilt,
int yTilt,
187 qreal tangentialPressure,
qreal rotation,
int z,
188 Qt::KeyboardModifiers keyState,
qint64 uniqueID);
194 inline int x()
const {
return mPos.x(); }
195 inline int y()
const {
return mPos.y(); }
196 inline int globalX()
const {
return mGPos.x(); }
197 inline int globalY()
const {
return mGPos.y(); }
204 inline int z()
const {
return mZ; }
207 inline int xTilt()
const {
return mXT; }
208 inline int yTilt()
const {
return mYT; }
213 int mDev, mPointerType, mXT, mYT,
mZ;
222 #endif // QT_NO_TABLETEVENT 228 bool autorep =
false,
ushort count = 1);
231 int key()
const {
return k; }
232 #ifndef QT_NO_SHORTCUT 238 inline int count()
const {
return int(
c); }
241 static QKeyEvent *createExtendedKeyEvent(
Type type,
int key, Qt::KeyboardModifiers modifiers,
247 quint32 nativeScanCode()
const;
248 quint32 nativeVirtualKey()
const;
249 quint32 nativeModifiers()
const;
252 inline QT3_SUPPORT_CONSTRUCTOR
QKeyEvent(
Type type,
int key,
int ,
254 bool autorep =
false,
ushort count = 1)
255 :
QInputEvent(type, Qt::KeyboardModifiers(modifiers & (
int)Qt::KeyButtonMask)), txt(
text), k(key),
256 c(count), autor(autorep)
261 inline QT3_SUPPORT
int ascii()
const 262 {
return (txt.length() ? txt.unicode()->toLatin1() : 0); }
264 inline QT3_SUPPORT Qt::ButtonState stateAfter()
const {
return Qt::ButtonState(
modifiers()); }
310 inline QT3_SUPPORT
bool erased()
const {
return m_erased; }
311 inline QT3_SUPPORT
void setErased(
bool b) { m_erased = b; }
395 #ifndef QT_NO_CONTEXTMENU 402 Qt::KeyboardModifiers modifiers);
407 inline int x()
const {
return p.x(); }
408 inline int y()
const {
return p.y(); }
419 QT3_SUPPORT_CONSTRUCTOR QContextMenuEvent(
Reason reason,
const QPoint &pos,
int);
421 QT3_SUPPORT Qt::ButtonState state()
const;
428 #endif // QT_NO_CONTEXTMENU 430 #ifndef QT_NO_INPUTMETHOD 452 void setCommitString(
const QString &commitString,
int replaceFrom = 0,
int replaceLength = 0);
470 #endif // QT_NO_INPUTMETHOD 472 #ifndef QT_NO_DRAGANDDROP 483 Qt::MouseButtons
buttons, Qt::KeyboardModifiers modifiers,
Type type = Drop);
501 const char*
format(
int n = 0)
const;
503 bool provides(
const char*)
const;
507 inline QT3_SUPPORT
void accept(
bool y) { setAccepted(y); }
508 inline QT3_SUPPORT
QByteArray data(
const char* f)
const {
return encodedData(f); }
510 enum Action { Copy, Link, Move, Private, UserAction = Private };
511 QT3_SUPPORT Action action()
const;
512 inline QT3_SUPPORT
void acceptAction(
bool y =
true) {
if (y) { drop_action = default_action; accept(); } }
513 inline QT3_SUPPORT
void setPoint(
const QPoint& np) { p = np; }
534 Qt::MouseButtons
buttons, Qt::KeyboardModifiers modifiers,
Type type = DragMove);
546 inline QT3_SUPPORT
void accept(
bool y) { setAccepted(y); }
559 Qt::MouseButtons
buttons, Qt::KeyboardModifiers modifiers);
583 #endif // QT_NO_DRAGANDDROP 592 inline int x()
const {
return p.x(); }
593 inline int y()
const {
return p.y(); }
605 #ifndef QT_NO_STATUSTIP 618 #ifndef QT_NO_WHATSTHIS 656 bool openFile(
QFile &file, QIODevice::OpenMode flags)
const;
661 #ifndef QT_NO_TOOLBAR 668 inline bool toggle()
const {
return tog; }
674 #ifndef QT_NO_SHORTCUT 694 #ifndef QT_NO_CLIPBOARD 712 inline Qt::WindowStates
oldState()
const {
return ostate; }
713 bool isOverride()
const;
724 QMenubarUpdatedEvent(
QMenuBar *
const menBar);
725 inline QMenuBar *menuBar() {
return m_menuBar; }
731 #ifndef QT_NO_DEBUG_STREAM 735 #ifndef QT_NO_SHORTCUT 738 #endif // QT_NO_SHORTCUT 754 bool isPrimary()
const;
765 QPointF startScreenPos()
const;
769 QPointF startNormalizedPos()
const;
770 QPointF lastNormalizedPos()
const;
774 QRectF screenRect()
const;
776 qreal pressure()
const;
780 void setState(Qt::TouchPointStates state);
781 void setPos(
const QPointF &pos);
782 void setScenePos(
const QPointF &scenePos);
783 void setScreenPos(
const QPointF &screenPos);
784 void setNormalizedPos(
const QPointF &normalizedPos);
785 void setStartPos(
const QPointF &startPos);
786 void setStartScenePos(
const QPointF &startScenePos);
787 void setStartScreenPos(
const QPointF &startScreenPos);
788 void setStartNormalizedPos(
const QPointF &startNormalizedPos);
789 void setLastPos(
const QPointF &lastPos);
790 void setLastScenePos(
const QPointF &lastScenePos);
791 void setLastScreenPos(
const QPointF &lastScreenPos);
792 void setLastNormalizedPos(
const QPointF &lastNormalizedPos);
793 void setRect(
const QRectF &rect);
794 void setSceneRect(
const QRectF &sceneRect);
795 void setScreenRect(
const QRectF &screenRect);
796 void setPressure(
qreal pressure);
813 Qt::TouchPointStates touchPointStates = 0,
825 inline void setTouchPointStates(Qt::TouchPointStates aTouchPointStates) { _touchPointStates = aTouchPointStates; }
838 #ifndef QT_NO_GESTURES 853 #ifdef Q_NO_USING_KEYWORD 879 #ifndef QT_NO_GRAPHICSVIEW 890 #endif // QT_NO_GESTURES The QVariant class acts like a union for the most common Qt data types.
TabletDevice
This enum defines what type of device is generating the event.
The QDebug class provides an output stream for debugging information.
QAction * before() const
If type() is ActionAdded , returns the action that should appear before action(). ...
void acceptProposedAction()
Sets the drop action to be the proposed action.
Qt::WindowStates oldState() const
Returns the state of the window before the change.
The QApplication class manages the GUI application's control flow and main settings.
The QKeyEvent class describes a key event.
QTouchEvent::DeviceType _deviceType
void ignore(const QRect &r)
The opposite of the accept(const QRect&) function.
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
Qt::MouseButtons mouseState
bool hasExtendedInfo() const
int y() const
Returns the y position of the device, relative to the widget that received the event.
Qt::DropActions possibleActions() const
Returns an OR-combination of possible drop actions.
int xTilt() const
Returns the angle between the device (a pen, for example) and the perpendicular in the direction of t...
The QWheelEvent class contains parameters that describe a wheel event.
Qt::TouchPointStates _touchPointStates
The QByteArray class provides an array of bytes.
qreal hiResGlobalX() const
The high precision x position of the tablet device.
The QHoverEvent class contains parameters that describe a mouse event.
void setAccepted(bool accepted)
The QPointF class defines a point in the plane using floating point precision.
static Qt::MouseButtons buttons
Qt::DropAction dropAction() const
Returns the action to be performed on the data by the target.
The QShortcutEvent class provides an event which is generated when the user presses a key combination...
static bool ignore(const char *test, const char *const *table)
void accept()
Calls QDropEvent::accept().
const QPointF & hiResGlobalPos() const
The high precision coordinates delivered from the tablet expressed.
long ASN1_INTEGER_get ASN1_INTEGER * a
StandardKey
This enum represent standard key bindings.
int globalX() const
Returns the global x position of the mouse cursor at the time of the event.
The QActionEvent class provides an event that is generated when a QAction is added, removed, or changed.
Qt::MouseButtons mouseState
int globalY() const
Returns the global y position of the tablet device at the time of the event.
const QPoint & oldPos() const
Returns the old position of the widget.
bool isAmbiguous() const
Returns true if the key sequence that triggered the event is ambiguous.
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
DeviceType
This enum represents the type of device that generated a QTouchEvent.
const QPoint & pos() const
Returns the position of the device, relative to the widget that received the event.
Qt::KeyboardModifiers keyboardModifiers() const
Returns the modifier keys that are pressed.
void setTouchPointStates(Qt::TouchPointStates aTouchPointStates)
Sets a bitwise OR of all the touch point states for this event.
The QMimeSource class is an abstraction of objects that provided formatted data of a certain MIME typ...
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
PointerType pointerType() const
Returns the type of point that generated the event.
Qt::DropAction default_action
const QPoint & oldPos() const
Returns the previous position of the mouse cursor, relative to the widget that received the event...
bool lostFocus() const
Returns true if type() is QEvent::FocusOut; otherwise returns false.
int key() const
Returns the code of the key that was pressed or released.
QString href() const
Returns the URL that was clicked by the user in the "What's This?" text.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QList< QTouchEvent::TouchPoint > _touchPoints
Qt::KeyboardModifiers modState
The QGestureEvent class provides the description of triggered gestures.
The QMoveEvent class contains event parameters for move events.
The QRectF class defines a rectangle in the plane using floating point precision. ...
int y() const
Returns the y position of the mouse cursor, relative to the widget that received the event...
QWidget * widget() const
Returns the widget on which the event occurred.
int globalX() const
Returns the global x position of the mouse pointer at the time of the event.
qint64 uniqueId() const
Returns a unique ID for the current device, making it possible to differentiate between multiple devi...
int y() const
Same as pos().
QTouchEvent::DeviceType deviceType() const
Returns the touch device Type, which is of type QTouchEvent::DeviceType {DeviceType}.
QRect answerRect() const
Returns the rectangle in the widget where the drop will occur if accepted.
bool hasExtendedInfo() const
The QHideEvent class provides an event which is sent after a widget is hidden.
QString tip() const
Returns the message to show in the status bar.
The QResizeEvent class contains event parameters for resize events.
const QRegion & region() const
Returns the region that needs to be updated.
int globalX() const
Returns the global x position of the mouse cursor at the time of the event.
int delta() const
Returns the distance that the wheel is rotated, in eighths of a degree.
static const char * data(const QByteArray &arr)
Qt::MouseButtons buttons() const
Returns the mouse state when the event occurred.
Qt::TouchPointStates touchPointStates() const
Returns a bitwise OR of all the touch point states for this event.
QAction * action() const
Returns the action that is changed, added, or removed.
const QSize & oldSize() const
Returns the old size of the widget.
int count() const
Returns the number of keys involved in this event.
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
The QRegion class specifies a clip region for a painter.
const QRegion & region() const
The QShowEvent class provides an event that is sent when a widget is shown.
The QMimeData class provides a container for data that records information about its MIME type...
Qt::DropAction proposedAction() const
Returns the proposed drop action.
Qt::Orientation orientation() const
Returns the wheel's orientation.
Qt::MouseButton button() const
Returns the button that caused the event.
The QTabletEvent class contains parameters that describe a Tablet event.
QString file() const
Returns the file that is being opened.
The QMouseEvent class contains parameters that describe a mouse event.
qreal hiResGlobalY() const
The high precision y position of the tablet device.
const QKeySequence & key()
const QPoint & pos() const
Returns the position of the mouse cursor relative to the widget that received the event...
qreal pressure() const
Returns the pressure for the device.
int shortcutId()
This is an overloaded member function, provided for convenience. It differs from the above function o...
PointerType
This enum defines what type of point is generating the event.
The QCoreApplication class provides an event loop for console Qt applications.
Qt::MouseButtons mouseButtons() const
Returns the mouse buttons that are pressed.
const QPoint & pos() const
Returns the new position of the widget.
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
Qt::MouseButtons mouseState
void accept(const QRect &r)
The same as accept(), but also notifies that future moves will also be acceptable if they remain with...
int z() const
Returns the z position of the device.
The QKeySequence class encapsulates a key sequence as used by shortcuts.
Qt::MouseButtons buttons() const
Returns the button state when the event was generated.
The QWindowStateChangeEvent class provides the window state before a window state change...
The QFile class provides an interface for reading from and writing to files.
Type
This enum type defines the valid event types in Qt.
The QGesture class represents a gesture, containing properties that describe the corresponding user i...
QString text() const
Returns the Unicode text that this key generated.
The QStatusTipEvent class provides an event that is used to show messages in a status bar...
const QSize & size() const
Returns the new size of the widget.
int y() const
Returns the y position of the mouse cursor, relative to the widget that received the event...
const QPoint & globalPos() const
Returns the global position of the device at the time of the event.
int globalY() const
Returns the global y position of the mouse cursor at the time of the event.
The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action ent...
The QWhatsThisClickedEvent class provides an event that can be used to handle hyperlinks in a "What's...
void setDeviceType(DeviceType adeviceType)
Sets the device type to deviceType, which is of type QTouchEvent::DeviceType {DeviceType}.
The QPoint class defines a point in the plane using integer precision.
const QList< QTouchEvent::TouchPoint > & touchPoints() const
Returns the list of touch points contained in the touch event.
int yTilt() const
Returns the angle between the device (a pen, for example) and the perpendicular in the direction of t...
qreal tangentialPressure() const
Returns the tangential pressure for the device.
Qt::DropAction drop_action
TouchPointState
This enum represents the state of a touch point at the time the QTouchEvent occurred.
const QPoint & globalPos() const
Returns the mouse cursor position when the event was generated in global coordinates.
QTouchEventTouchPointPrivate * d
The QRect class defines a rectangle in the plane using integer precision.
bool isAutoRepeat() const
Returns true if this event comes from an auto-repeating key; returns false if it comes from an initia...
const QPoint & globalPos() const
Returns the global position of the mouse pointer at the time of the event.
const QKeySequence & key() const
Returns the key sequence that triggered the event.
int globalY() const
Returns the global y position of the mouse cursor at the time of the event.
The TouchPoint class provides information about a touch point in a QTouchEvent.
int shortcutId() const
Returns the ID of the QShortcut object for which this event was generated.
int x() const
Returns the x position of the device, relative to the widget that received the event.
int globalX() const
Same as globalPos().
void ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
The QTouchEvent class contains parameters that describe a touch event.
The QClipboardEvent class provides the parameters used in a clipboard event.
const QMimeData * mimeData() const
Returns the data that was dropped on the widget and its associated MIME type information.
The QSize class defines the size of a two-dimensional object using integer point precision.
void setWidget(QWidget *awidget)
bool gotFocus() const
Returns true if type() is QEvent::FocusIn; otherwise returns false.
qreal rotation() const
Returns the rotation of the current device in degress.
const QRect & rect() const
Returns the rectangle that needs to be updated.
int x() const
Same as pos().
The QPaintEvent class contains event parameters for paint events.
void setTouchPoints(const QList< QTouchEvent::TouchPoint > &atouchPoints)
Sets the list of touch points for this event.
The QIconDragEvent class indicates that a main icon drag has begun.
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
const QPoint & globalPos() const
Returns the global position of the mouse cursor at the time of the event.
bool operator==(QKeyEvent *e, QKeySequence::StandardKey key)
void ignore()
Calls QDropEvent::ignore().
The QCloseEvent class contains parameters that describe a close event.
Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *)
The QFocusEvent class contains event parameters for widget focus events.
The QAction class provides an abstract user interface action that can be inserted into widgets...
bool dragAccepted() const
TabletDevice device() const
Returns the type of device that generated the event.
const QPoint & pos() const
Returns the position where the drop was made.
int x() const
Returns the x position of the mouse cursor, relative to the widget that received the event...
bool matches(QKeySequence::StandardKey key) const
Returns true if the key event matches the given standard key; otherwise returns false.
int x() const
Returns the x position of the mouse cursor, relative to the widget that received the event...
int globalY() const
Same as globalPos().
The QFileOpenEvent class provides an event that will be sent when there is a request to open a file o...
The QHelpEvent class provides an event that is used to request helpful information about a particular...
const QPoint & pos() const
Returns the mouse cursor position when the event was generated, relative to the widget to which the e...