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

📄 qcursor.3qt

📁 Qt/Embedded是一个多平台的C++图形用户界面应用程序框架
💻 3QT
字号:
.TH QCursor 3qt "10 November 2000" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2000 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.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 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 use one of the \fIpredefined\fR cursors:.TP\fCarrowCursor\fR - standard arrow cursor.TP\fCupArrowCursor\fR - upwards arrow.TP\fCcrossCursor\fR - crosshair.TP\fCwaitCursor\fR - hourglass/watch.TP\fCibeamCursor\fR - ibeam/text entry.TP\fCsizeVerCursor\fR - vertical resize.TP\fCsizeHorCursor\fR - horizontal resize.TP\fCsizeBDiagCursor\fR - diagonal resize (/).TP\fCsizeFDiagCursor\fR - diagonal resize (\\).TP\fCsizeAllCursor\fR - all directions resize.TP\fCblankCursor\fR - blank/invisible cursor.TP\fCsplitVCursor\fR - vertical splitting.TP\fCsplitHCursor\fR - horziontal splitting.TP\fCpointingHandCursor\fR - a pointing hand.TP\fCforbiddenCursor\fR - a slashed circle.PPIf you want to create a cursor with an own bitmap, use either the QCursor constructor which takes a 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 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..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 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..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 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..PPSee also QPixmap::QPixmap() and QPixmap::setMask()..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.PP\fIshape\fR can be one of.TP\fCArrowCursor\fR - standard arrow cursor.TP\fCUpArrowCursor\fR - upwards arrow.TP\fCCrossCursor\fR - crosshair.TP\fCWaitCursor\fR - hourglass/watch.TP\fCIbeamCursor\fR - ibeam/text entry.TP\fCSizeVerCursor\fR - vertical resize.TP\fCSizeHorCursor\fR - horizontal resize.TP\fCSizeBDiagCursor\fR - diagonal resize (/).TP\fCSizeFDiagCursor\fR - diagonal resize (\\).TP\fCSizeAllCursor\fR - all directions resize.TP\fCBlankCursor\fR - blank/invisible cursor.TP\fCSplitVCursor\fR - vertical splitting.TP\fCSplitHCursor\fR - horziontal splitting.TP\fCPointingHandCursor\fR - a pointing hand.TP\fCBitmapCursor\fR - userdefined bitmap cursor.PPThese correspond to the predefined global QCursor objects..PPSee also setShape()..SH "QCursor::~QCursor ()"Destructs 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 \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 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.TP\fCArrowCursor\fR - standard arrow cursor.TP\fCUpArrowCursor\fR - upwards arrow.TPCrossCursor - crosshair.TP\fCWaitCursor\fR - hourglass/watch.TP\fCIbeamCursor\fR - ibeam/text entry.TP\fCSizeVerCursor\fR - vertical resize.TP\fCSizeHorCursor\fR - horizontal resize.TP\fCSizeBDiagCursor\fR - diagonal resize (/).TP\fCSizeFDiagCursor\fR - diagonal resize (\\).TP\fCSizeAllCursor\fR - all directions resize.TP\fCBlankCursor\fR - blank/invisible cursor.TP\fCSplitVCursor\fR - vertical splitting.TP\fCSplitHCursor\fR - horziontal splitting.TP\fCPointingHandCursor\fR - a pointing hand.TP\fCForbiddenCursor\fR - a slashed circle.TP\fCBitmapCursor\fR - userdefined bitmap cursor.PPThese correspond to the predefined global QCursor objects..PPSee also shape()..SH "int QCursor::shape () const"Returns the cursor shape identifer. The return value is one of following values (cast to an int).TP\fCArrowCursor\fR - standard arrow cursor.TP\fCUpArrowCursor\fR - upwards arrow.TP\fCCrossCursor\fR - crosshair.TP\fCWaitCursor\fR - hourglass/watch.TP\fCIbeamCursor\fR - ibeam/text entry.TP\fCSizeVerCursor\fR - vertical resize.TP\fCSizeHorCursor\fR - horizontal resize.TP\fCSizeBDiagCursor\fR - diagonal resize (/).TP\fCSizeFDiagCursor\fR - diagonal resize (\\).TP\fCSizeAllCursor\fR - all directions resize.TP\fCBlankCursor\fR - blank/invisible cursor.TP\fCSplitVCursor\fR - vertical splitting.TP\fCSplitHCursor\fR - horziontal splitting.TP\fCPointingHandCursor\fR - a pointing hand.TP\fCForbiddenCursor\fR - a slashed circle.TP\fCBitmapCursor\fR - userdefined bitmap cursor.PPThese correspond to the predefined global QCursor objects..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.SH COPYRIGHTCopyright 1992-2000 Trolltech AS, http://www.trolltech.com/.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

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