⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qcursor.3qt

📁 linux下GUI编程工具qt的在线连接帮助手册
💻 3QT
字号:
'\" t.TH QCursor 3qt "11 October 2001" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQCursor \- Mouse cursor with an arbitrary shape.PP\fC#include <qcursor.h>\fR.PPInherits Qt..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQCursor\fR ()".br.ti -1c.BI "\fBQCursor\fR ( int shape )".br.ti -1c.BI "\fBQCursor\fR ( const QBitmap & bitmap, const QBitmap & mask, int hotX = -1, int hotY = -1 )".br.ti -1c.BI "\fBQCursor\fR ( const QPixmap & pixmap, int hotX = -1, int hotY = -1 )".br.ti -1c.BI "\fBQCursor\fR ( const QCursor & c )".br.ti -1c.BI "\fB~QCursor\fR ()".br.ti -1c.BI "QCursor & \fBoperator=\fR ( const QCursor & c )".br.ti -1c.BI "int \fBshape\fR () const".br.ti -1c.BI "void \fBsetShape\fR ( int shape )".br.ti -1c.BI "const QBitmap * \fBbitmap\fR () const".br.ti -1c.BI "const QBitmap * \fBmask\fR () const".br.ti -1c.BI "QPoint \fBhotSpot\fR () const".br.ti -1c.BI "HCURSOR \fBhandle\fR () const".br.ti -1c.BI "\fBQCursor\fR ( HCURSOR handle )".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "QPoint \fBpos\fR ()".br.ti -1c.BI "void \fBsetPos\fR ( int x, int y )".br.ti -1c.BI "void \fBsetPos\fR ( const QPoint & )".br.ti -1c.BI "void \fBinitialize\fR ()".br.ti -1c.BI "void \fBcleanup\fR ()".br.in -1c.SH RELATED FUNCTION DOCUMENTATION.in +1c.ti -1c.BI "QDataStream & \fBoperator<<\fR ( QDataStream & s, const QCursor & c )".br.ti -1c.BI "QDataStream & \fBoperator>>\fR ( QDataStream & s, QCursor & c )".br.in -1c.SH DESCRIPTIONThe QCursor class provides a mouse cursor with an arbitrary shape..PPThis class is mainly used to create mouse cursors that are associated with particular widgets and to get and set the position of the mouse cursor..PPQt has a number of standard cursor shapes, but you can also make custom cursor shapes based on a QBitmap, a mask and a hotspot..PPTo associate a cursor with a widget, use QWidget::setCursor(). To associate a cursor with all widgets (normally for a short period of time), use QApplication::setOverrideCursor()..PPTo set a cursor shape use QCursor::setShape() or use the QCursor constructor which takes the shape as argument, or you can use one of the predefined cursors defined in the CursorShape enum..PPIf you want to create a cursor with your own bitmap, either use the QCursor constructor which takes a bitmap and a mask or the constructor which takes a pixmap as arguments..PPTo set or get the position of the mouse cursor use the static methods QCursor::pos() and QCursor::setPos()..PPSee also QWidget, GUI Design Handbook: Cursors, Widget Appearance and Style and Implicitly and Explicitly Shared Classes..SH MEMBER FUNCTION DOCUMENTATION.SH "QCursor::QCursor ()"Constructs a cursor with the default arrow shape..SH "QCursor::QCursor ( int shape )"Constructs a cursor with the specified \fIshape\fR..PPSee CursorShape for a list of shapes..PPSee also setShape()..SH "QCursor::QCursor ( const QBitmap & bitmap, const QBitmap & mask, int hotX = -1, int hotY = -1 )"Constructs a custom bitmap cursor..PP\fIbitmap\fR and \fImask\fR make up the bitmap. \fIhotX\fR and \fIhotY\fR define the hot spot of this cursor..PPIf \fIhotX\fR is negative, it is set to the \fCbitmap().width()/2\fR. If \fIhotY\fR is negative, it is set to the \fCbitmap().height()/2\fR..PPThe cursor \fIbitmap\fR (B) and \fImask\fR (M) bits are combined this way:.IP 1B=1 and M=1 gives black..IP 2B=0 and M=1 gives white..IP 3B=0 and M=0 gives transparency..IP 4B=1 and M=0 gives an undefined result..PPUse the global color \fCcolor0\fR to draw 0-pixels and \fCcolor1\fR to draw 1-pixels in the bitmaps..PPValid cursor sizes depend on the display hardware (or the underlying window system). We recommend using 32x32 cursors, because this size is supported on all platforms. Some platforms also support 16x16, 48x48 and 64x64 cursors..PPSee also QBitmap::QBitmap() and QBitmap::setMask()..SH "QCursor::QCursor ( const QPixmap & pixmap, int hotX = -1, int hotY = -1 )"Constructs a custom pixmap cursor..PP\fIpixmap\fR is the image (usually it should have a mask (set using QPixmap::setMask()) \fIhotX\fR and \fIhotY\fR define the hot spot of this cursor..PPIf \fIhotX\fR is negative, it is set to the \fCpixmap().width()/2\fR. If \fIhotY\fR is negative, it is set to the \fCpixmap().height()/2\fR..PPValid cursor sizes depend on the display hardware (or the underlying window system). We recommend using 32x32 cursors, because this size is supported on all platforms. Some platforms also support 16x16, 48x48 and 64x64 cursors..PPCurrently, only black-and-white pixmaps can be used..PPSee also QPixmap::QPixmap() and QPixmap::setMask()..SH "QCursor::QCursor ( const QCursor & c )"Constructs a copy of the cursor \fIc\fR..SH "QCursor::QCursor ( HCURSOR handle )"Creates a cursor with the specified window system handle \fIhandle\fR..PP\fBWarning:\fR Portable in principle, but if you use it you are probably about to do something non-portable. Be careful..SH "QCursor::~QCursor ()"Destroys the cursor..SH "const QBitmap * QCursor::bitmap () const"Returns the cursor bitmap, or 0 if it is one of the standard cursors..SH "void QCursor::cleanup ()\fC [static]\fR"Internal function that deinitializes the predefined cursors. This function is called from the QApplication destructor..PPSee also initialize()..SH "HCURSOR QCursor::handle () const"Returns the window system cursor handle..PP\fBWarning:\fR Portable in principle, but if you use it you are probably about to do something non-portable. Be careful..SH "QPoint QCursor::hotSpot () const"Returns the cursor hot spot, or (0,0) if it is one of the standard cursors..SH "void QCursor::initialize ()\fC [static]\fR"Internal function that initializes the predefined cursors. This function is called from the QApplication constructor..PPSee also cleanup()..SH "const QBitmap * QCursor::mask () const"Returns the cursor bitmap mask, or 0 if it is one of the standard cursors..SH "QCursor & QCursor::operator= ( const QCursor & c )"Assigns \fIc\fR to this cursor and returns a reference to this cursor..SH "QPoint QCursor::pos ()\fC [static]\fR"Returns the position of the cursor (hot spot) in global screen coordinates..PPYou can call QWidget::mapFromGlobal() to translate it to widget coordinates..PPSee also setPos(), QWidget::mapFromGlobal() and QWidget::mapToGlobal()..PPExample: fileiconview/qfileiconview.cpp..SH "void QCursor::setPos ( int x, int y )\fC [static]\fR"Moves the cursor (hot spot) to the global screen position \fIx\fR and \fIy\fR..PPYou can call QWidget::mapToGlobal() to translate widget coordinates to global screen coordinates..PPSee also pos(), QWidget::mapFromGlobal() and QWidget::mapToGlobal()..SH "void QCursor::setPos ( const QPoint & )\fC [static]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..SH "void QCursor::setShape ( int shape )"Sets the cursor to the shape identified by \fIshape\fR..PPSee CursorShape for a list of shapes..PPSee also shape()..SH "int QCursor::shape () const"Returns the cursor shape identifier. The return value is one of following values (casted to an int)..PPSee CursorShape for a list of shapes..PPSee also setShape()..SH RELATED FUNCTION DOCUMENTATION.SH "QDataStream & operator<< ( QDataStream & s, const QCursor & c )"Writes the cursor \fIc\fR to the stream \fIs\fR..PPSee also Format of the QDataStream operators..SH "QDataStream & operator>> ( QDataStream & s, QCursor & c )"Reads a cursor from the stream \fIs\fR and sets \fIc\fR to the read data..PPSee also Format of the QDataStream operators..SH "SEE ALSO".BR http://doc.trolltech.com/qcursor.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qcursor.3qt) and the Qtversion (3.0.0).

⌨️ 快捷键说明

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