📄 qcursor.3qt
字号:
.TH QCursor 3qt "6 July 1999" "Troll Tech AS" \" -*- nroff -*-.\" Copyright 1992-1999 Troll Tech 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.SH SYNOPSIS.br.PP\fC#include <qcursor.h>\fR.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 & )".br.ti -1c.BI "\fB~QCursor\fR ()".br.ti -1c.BI "QCursor& \fBoperator=\fR ( const QCursor & )".br.ti -1c.BI "int \fBshape\fR () const".br.ti -1c.BI "void \fBsetShape\fR ( int )".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.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(Note that these are not member functions.).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 used for mainly two things; to create mouse cursors to be associated with 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 bitmap, a mask and a hotspot..PPTo associate a cursor with a widget, use QWidget::setCursor(). To associate a cursor with all widgets (maybe for a short period of time), use QApplication::setOverrideCursor()..PPThe predefined cursor objects are:.TParrowCursor : standard arrow cursor.TPupArrowCursor : upwards arrow.TPcrossCursor : crosshair.TPwaitCursor : hourglass/watch.TPibeamCursor : ibeam/text entry.TPsizeVerCursor : vertical resize.TPsizeHorCursor : horizontal resize.TPsizeBDiagCursor : diagonal resize (/).TPsizeFDiagCursor : diagonal resize (\\).TPsizeAllCursor : all directions resize.TPblankCursor : blank/invisible cursor.TPsplitVCursor :vertical splitting.TPsplitHCursor :horziontal splitting.TPpointingHandCursor : a pointing hand.PPSee also: QWidget and GUI Design Handbook: Cursors..PPExamples:.(lcursor/cursor.cpp.)l.SH MEMBER FUNCTION DOCUMENTATION.SH "QCursor::QCursor ()"Constructs a cursor with the default arrow shape..SH "QCursor::QCursor ( const QBitmap & bitmap, const QBitmap & mask, int hotX=-1, int hotY=-1 )"Constructs a custom bitmap cursor..PPArguments:.TP\fIbitmap\fR and.TP\fImask\fR make up the bitmap..TP\fIhotX\fR and.TP\fIhotY\fR define the hot spot of this cursor. If \fIhotX\fR is negative, it is set to the bitmap().width()/2. If \fIhotY\fR is negative, it is set to the bitmap().height()/2..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..PPAllowed 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..SH "QCursor::QCursor ( const QPixmap & pixmap, int hotX=-1, int hotY=-1 )"Constructs a custom pixmap cursor..PPArguments:.TP\fIpixmap\fR is the image (usually it should have a mask).TP\fIhotX\fR and.TP\fIhotY\fR define the hot spot of this cursor. If \fIhotX\fR is negative, it is set to the pixmap().width()/2. If \fIhotY\fR is negative, it is set to the pixmap().height()/2..PPAllowed 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..SH "QCursor::QCursor ( const QCursor & c )"Constructs a copy of the cursor \fIc.\fR.SH "QCursor::QCursor ( int shape )"Constructs a cursor with the specified \fIshape.\fR.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 "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()..SH "void QCursor::setPos ( int x, int y ) \fC[static]\fR"Moves the cursor (hot spot) to the global screen position \fI(x,y).\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 differs from the above function only in what argument(s) it accepts..SH "void QCursor::setShape ( int shape )"Sets the cursor to the shape identified by \fIshape.\fR.PPThe allowed shapes are: \fCArrowCursor, UpArrowCursor, CrossCursor, WaitCursor, IbeamCursor, SizeVerCursor, SizeHorCursor, SizeBDiagCursor, SizeFDiagCursor, SizeAllCursor, BlankCursor.\fR These correspond to the predefined global QCursor objects..PPSee also: shape()..SH "int QCursor::shape () const"Returns the cursor shape identifer. If a custom bitmap has been set, \fCBitmapCursor\fR is returned..PPSee also: setShape()..SH RELATED FUNCTION DOCUMENTATION.SH "QDataStream & operator<< (QDataStream & s, const QCursor & c)"Writes a cursor to the stream..SH "QDataStream & operator>> (QDataStream & s, QCursor & c)"Reads a cursor from the stream..SH "SEE ALSO".BR http://www.troll.no/qt/qcursor.html.SH COPYRIGHTCopyright 1992-1999 Troll Tech AS. See the license file included inthe distribution for a complete license statement..SH AUTHORGenerated automatically from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -