qevent-h.html

来自「QT 下载资料仅供参考」· HTML 代码 · 共 607 行 · 第 1/2 页

HTML
607
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/include/qevent.h:1 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta name="Translator" content="Cavendish"><meta name="Qt zh_CN Documents Website" content="http://www.qiliang.net/qt"><title>qevent.h包含文件</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; font-family: "Times New Roman" }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td valign=center> <a href="index.html"><font color="#004faf">主页</font></a> | <a href="classes.html"><font color="#004faf">所有的类</font></a> | <a href="mainclasses.html"><font color="#004faf">主要的类</font></a> | <a href="annotated.html"><font color="#004faf">注释的类</font></a> | <a href="groups.html"><font color="#004faf">分组的类</font></a> | <a href="functions.html"><font color="#004faf">函数</font></a></td><td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>qevent.h</h1><p>这里是qevent.h包含文件的所有文本,一字不差。它仅仅用来说明,版权由Trolltech保留。<hr><pre>/****************************************************************************** $Id:  qt/qevent.h   3.0.5   edited Oct 12 2001 $**** Definition of event classes**** Created : 931029**** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.**** This file is part of the kernel module of the Qt GUI Toolkit.**** This file may be distributed under the terms of the Q Public License** as defined by Trolltech AS of Norway and appearing in the file** LICENSE.QPL included in the packaging of this file.**** This file may be distributed and/or modified under the terms of the** GNU General Public License version 2 as published by the Free Software** Foundation and appearing in the file LICENSE.GPL included in the** packaging of this file.**** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition** licenses may use this file in accordance with the Qt Commercial License** Agreement provided with the Software.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.**** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for**   information about Qt Commercial License Agreements.** See http://www.trolltech.com/qpl/ for QPL licensing information.** See http://www.trolltech.com/gpl/ for GPL licensing information.**** Contact info@trolltech.com if any conditions of this licensing are** not clear to you.************************************************************************/#ifndef QEVENT_H#define QEVENT_H#ifndef QT_H#include "qwindowdefs.h"#include "qregion.h"#include "qnamespace.h"#include "qmime.h"#include "qpair.h"#endif // QT_Hclass Q_EXPORT QEvent: public Qt		// event base class{public:    enum Type {	// NOTE: if you get a strange compiler error on the line with "None",	//       it's probably because you're trying to include X11, which	//	 has a mess of #defines in it.  Put the messy X11 includes	//	 *AFTER* the nice clean Qt includes.	None = 0,				// invalid event	Timer = 1,				// timer event	MouseButtonPress = 2,			// mouse button pressed	MouseButtonRelease = 3,			// mouse button released	MouseButtonDblClick= 4,			// mouse button double click	MouseMove = 5,				// mouse move	KeyPress = 6,				// key pressed	KeyRelease = 7,				// key released	FocusIn = 8,				// keyboard focus received	FocusOut = 9,				// keyboard focus lost	Enter = 10,				// mouse enters widget	Leave = 11,				// mouse leaves widget	Paint = 12,				// paint widget	Move = 13,				// move widget	Resize = 14,				// resize widget	Create = 15,				// after object creation	Destroy = 16,				// during object destruction	Show = 17,				// widget is shown	Hide = 18,				// widget is hidden	Close = 19,				// request to close widget	Quit = 20,				// request to quit application	Reparent = 21,				// widget has been reparented	ShowMinimized = 22,		       	// widget is shown minimized	ShowNormal = 23,	       		// widget is shown normal	WindowActivate = 24,	       		// window was activated	WindowDeactivate = 25,	       		// window was deactivated	ShowToParent = 26,	       		// widget is shown to parent	HideToParent = 27,	       		// widget is hidden to parent	ShowMaximized = 28,		       	// widget is shown maximized	ShowFullScreen = 29,			// widget is shown full-screen	Accel = 30,				// accelerator event	Wheel = 31,				// wheel event	AccelAvailable = 32,			// accelerator available event	CaptionChange = 33,			// caption changed	IconChange = 34,			// icon changed	ParentFontChange = 35,			// parent font changed	ApplicationFontChange = 36,		// application font changed	ParentPaletteChange = 37,		// parent palette changed	ApplicationPaletteChange = 38,		// application palette changed	PaletteChange = 39,			// widget palette changed	Clipboard = 40,				// internal clipboard event	Speech = 42,				// reserved for speech input	SockAct = 50,				// socket activation	AccelOverride = 51,			// accelerator override event	DeferredDelete = 52,			// deferred delete event	DragEnter = 60,				// drag moves into widget	DragMove = 61,				// drag moves in widget	DragLeave = 62,				// drag leaves or is cancelled	Drop = 63,				// actual drop	DragResponse = 64,			// drag accepted/rejected	ChildInserted = 70,			// new child widget	ChildRemoved = 71,			// deleted child widget	LayoutHint = 72,			// child min/max size changed	ShowWindowRequest = 73,			// widget's window should be mapped	ActivateControl = 80,			// ActiveX activation	DeactivateControl = 81,			// ActiveX deactivation	ContextMenu = 82,                       // context popup menu	IMStart = 83,				// input method composition start	IMCompose = 84,				// input method composition	IMEnd = 85,				// input method composition end	Accessibility = 86,			// accessibility information is requested	Tablet = 87,				// Wacom Tablet Event	User = 1000,				// first user event id	MaxUser  = 65535                        // last user event id    };    QEvent( Type type ) : t(type), posted(FALSE), spont(FALSE) {}    virtual ~QEvent();    Type  type() const	{ return t; }    bool spontaneous() const 	{ return spont; }protected:    Type  t;private:    uint posted : 1;    uint spont : 1;    friend class QApplication;    friend class QBaseApplication;    friend class QETWidget;};class Q_EXPORT QTimerEvent : public QEvent{public:    QTimerEvent( int timerId )	: QEvent(Timer), id(timerId) {}    int	  timerId()	const	{ return id; }protected:    int	  id;};class Q_EXPORT QMouseEvent : public QEvent{public:    QMouseEvent( Type type, const QPoint &amp;pos, int button, int state );    QMouseEvent( Type type, const QPoint &amp;pos, const QPoint&amp;globalPos,		 int button, int state )	: QEvent(type), p(pos), g(globalPos), b((ushort)button),s((ushort)state),accpt(TRUE) {};    const QPoint &amp;pos() const	{ return p; }    const QPoint &amp;globalPos() const { return g; }    int	   x()		const	{ return p.x(); }    int	   y()		const	{ return p.y(); }    int	   globalX()	const	{ return g.x(); }    int	   globalY()	const	{ return g.y(); }    ButtonState button() const	{ return (ButtonState) b; }    ButtonState state()	const	{ return (ButtonState) s; }    ButtonState stateAfter() const;    bool   isAccepted() const	{ return accpt; }    void   accept()		{ accpt = TRUE; }    void   ignore()		{ accpt = FALSE; }protected:    QPoint p;    QPoint g;    ushort b;    ushort s;    uint   accpt:1;};#ifndef QT_NO_WHEELEVENTclass Q_EXPORT QWheelEvent : public QEvent{public:    QWheelEvent( const QPoint &amp;pos, int delta, int state, Orientation orient = Vertical );    QWheelEvent( const QPoint &amp;pos, const QPoint&amp; globalPos, int delta, int state, Orientation orient = Vertical  )	: QEvent(Wheel), p(pos), g(globalPos), d(delta), s((ushort)state),	  accpt(TRUE), o(orient) {}    int	   delta()	const	{ return d; }    const QPoint &amp;pos() const	{ return p; }    const QPoint &amp;globalPos() const	{ return g; }    int	   x()		const	{ return p.x(); }    int	   y()		const	{ return p.y(); }    int	   globalX()	const	{ return g.x(); }    int	   globalY()	const	{ return g.y(); }    ButtonState state()	const	{ return ButtonState(s); }    Orientation orientation() 	const 	{ return o; }    bool   isAccepted() const	{ return accpt; }    void   accept()		{ accpt = TRUE; }    void   ignore()		{ accpt = FALSE; }protected:    QPoint p;    QPoint g;    int d;    ushort s;    bool   accpt;    Orientation o;};#endifclass Q_EXPORT QTabletEvent : public QEvent{public:    enum TabletDevice { NoDevice = -1, Puck, Stylus, Eraser };    QTabletEvent( const QPoint &amp;pos, int device, int pressure, int xTilt,                   int yTilt, const QPair&lt;int,int&gt; &amp;uId )	: QEvent( Tablet ), mPos( pos ), mDev( device ), mPress( pressure ),	  mXT( xTilt ), mYT( yTilt ), mType( uId.first ), mPhy( uId.second )    {}    QTabletEvent( const QPoint &amp;pos, const QPoint &amp;globalPos, int device,		  int pressure, int xTilt, int yTilt, const QPair&lt;int,int&gt; &amp;uId )	: QEvent( Tablet ), mPos( pos ), mGPos( globalPos ), mDev( device ),	  mPress( pressure ), mXT( xTilt ), mYT( yTilt ), mType( uId.first ),	  mPhy( uId.second )    {}    int pressure()	const { return mPress; }    int xTilt()		const { return mXT; }    int yTilt()		const { return mYT; }    const QPoint &amp;pos()	const { return mPos; }    const QPoint &amp;globalPos() const { return mGPos; }    int x()		const { return mPos.x(); }    int y()		const { return mPos.y(); }    int globalX()	const { return mGPos.x(); }    int globalY()	const { return mGPos.y(); }    TabletDevice device() 	const { return TabletDevice(mDev); }    int isAccepted() const { return mbAcc; }    void accept() { mbAcc = TRUE; }    void ignore() { mbAcc = FALSE; }    QPair&lt;int,int&gt; uniqueId() { return QPair&lt;int,int&gt;( mType, mPhy); }protected:    QPoint mPos;    QPoint mGPos;    int mDev,        mPress,        mXT,        mYT,        mType,	mPhy;    bool mbAcc;    };class Q_EXPORT QKeyEvent : public QEvent{public:    QKeyEvent( Type type, int key, int ascii, int state,		const QString&amp; text=QString::null, bool autorep=FALSE, ushort count=1 )	: QEvent(type), txt(text), k((ushort)key), s((ushort)state),	    a((uchar)ascii), accpt(TRUE), autor(autorep), c(count) {}    int	   key()	const	{ return k; }    int	   ascii()	const	{ return a; }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?