<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qcursor.cpp --> <title>Qt 4.8: QCursor Class Reference</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> <li><a href="modules.html">Modules</a></li> <li><a href="qtgui.html">QtGui</a></li> <li>QCursor</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#static-public-members">Static Public Members</a></li> <li class="level1"><a href="#related-non-members">Related Non-Members</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> <li class="level2"><a href="#a-note-for-x11-users">A Note for X11 Users</a></li> </ul> </div> <h1 class="title">QCursor Class Reference</h1> <!-- $$$QCursor-brief --> <p>The QCursor class provides a mouse cursor with an arbitrary shape. <a href="#details">More...</a></p> <!-- @@@QCursor --> <pre class="cpp"> <span class="preprocessor">#include <QCursor></span></pre><ul> <li><a href="qcursor-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#QCursor">QCursor</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#QCursor-2">QCursor</a></b> ( Qt::CursorShape <i>shape</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#QCursor-3">QCursor</a></b> ( const QBitmap & <i>bitmap</i>, const QBitmap & <i>mask</i>, int <i>hotX</i> = -1, int <i>hotY</i> = -1 )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#QCursor-4">QCursor</a></b> ( const QPixmap & <i>pixmap</i>, int <i>hotX</i> = -1, int <i>hotY</i> = -1 )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#QCursor-5">QCursor</a></b> ( const QCursor & <i>c</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#QCursor-6">QCursor</a></b> ( HCURSOR <i>cursor</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#QCursor-7">QCursor</a></b> ( Qt::HANDLE <i>handle</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#dtor.QCursor">~QCursor</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const QBitmap * </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#bitmap">bitmap</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> HCURSOR_or_HANDLE </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#handle">handle</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QPoint </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#hotSpotx">hotSpot</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const QBitmap * </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#mask">mask</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#pixmap">pixmap</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#setShape">setShape</a></b> ( Qt::CursorShape <i>shape</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Qt::CursorShape </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#shape">shape</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#operator-QVariant">operator QVariant</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QCursor & </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#operator-eq">operator=</a></b> ( const QCursor & <i>c</i> )</td></tr> </table> <a name="static-public-members"></a> <h2>Static Public Members</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> QPoint </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#pos">pos</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#setPos">setPos</a></b> ( int <i>x</i>, int <i>y</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#setPos-2">setPos</a></b> ( const QPoint & <i>p</i> )</td></tr> </table> <a name="related-non-members"></a> <h2>Related Non-Members</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> QDataStream & </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#operator-lt-lt-169">operator<<</a></b> ( QDataStream & <i>stream</i>, const QCursor & <i>cursor</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QDataStream & </td><td class="memItemRight bottomAlign"><b><a href="qcursor.html#operator-gt-gt-100">operator>></a></b> ( QDataStream & <i>stream</i>, QCursor & <i>cursor</i> )</td></tr> </table> <a name="details"></a> <!-- $$$QCursor-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QCursor class provides a mouse cursor with an arbitrary shape.</p> <p>This 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.</p> <p>Qt has a number of standard cursor shapes, but you can also make custom cursor shapes based on a <a href="qbitmap.html">QBitmap</a>, a mask and a hotspot.</p> <p>To associate a cursor with a widget, use <a href="qwidget.html#cursor-prop">QWidget::setCursor</a>(). To associate a cursor with all widgets (normally for a short period of time), use <a href="qapplication.html#setOverrideCursor">QApplication::setOverrideCursor</a>().</p> <p>To set a cursor shape use <a href="qcursor.html#setShape">QCursor::setShape</a>() or use the QCursor constructor which takes the shape as argument, or you can use one of the predefined cursors defined in the <a href="qt.html#CursorShape-enum">Qt::CursorShape</a> enum.</p> <p>If 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.</p> <p>To set or get the position of the mouse cursor use the static methods <a href="qcursor.html#pos">QCursor::pos</a>() and <a href="qcursor.html#setPos">QCursor::setPos</a>().</p> <p><b>Note:</b> It is possible to create a QCursor before <a href="qapplication.html">QApplication</a>, but it is not useful except as a place-holder for a real QCursor created after <a href="qapplication.html">QApplication</a>. Attempting to use a QCursor that was created before <a href="qapplication.html">QApplication</a> will result in a crash.</p> <a name="a-note-for-x11-users"></a> <h3>A Note for X11 Users</h3> <p>On X11, Qt supports the <a href="http://www.xfree86.org/4.3.0/Xcursor.3.html">Xcursor</a> library, which allows for full color icon themes. The table below shows the cursor name used for each <a href="qt.html#CursorShape-enum">Qt::CursorShape</a> value. If a cursor cannot be found using the name shown below, a standard X11 cursor will be used instead. Note: X11 does not provide appropriate cursors for all possible <a href="qt.html#CursorShape-enum">Qt::CursorShape</a> values. It is possible that some cursors will be taken from the Xcursor theme, while others will use an internal bitmap cursor.</p> <table class="generic"> <thead><tr class="qt-style"><th >Shape</th><th ><a href="qt.html#CursorShape-enum">Qt::CursorShape</a> Value</th><th >Cursor Name</th><th >Shape</th><th ><a href="qt.html#CursorShape-enum">Qt::CursorShape</a> Value</th><th >Cursor Name</th></tr></thead> <tr valign="top" class="odd"><td ><img src="images/cursor-arrow.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::ArrowCursor</a></td><td ><tt>left_ptr</tt></td><td ><img src="images/cursor-sizev.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::SizeVerCursor</a></td><td ><tt>size_ver</tt></td></tr> <tr valign="top" class="even"><td ><img src="images/cursor-uparrow.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::UpArrowCursor</a></td><td ><tt>up_arrow</tt></td><td ><img src="images/cursor-sizeh.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::SizeHorCursor</a></td><td ><tt>size_hor</tt></td></tr> <tr valign="top" class="odd"><td ><img src="images/cursor-cross.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::CrossCursor</a></td><td ><tt>cross</tt></td><td ><img src="images/cursor-sizeb.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::SizeBDiagCursor</a></td><td ><tt>size_bdiag</tt></td></tr> <tr valign="top" class="even"><td ><img src="images/cursor-ibeam.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::IBeamCursor</a></td><td ><tt>ibeam</tt></td><td ><img src="images/cursor-sizef.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::SizeFDiagCursor</a></td><td ><tt>size_fdiag</tt></td></tr> <tr valign="top" class="odd"><td ><img src="images/cursor-wait.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::WaitCursor</a></td><td ><tt>wait</tt></td><td ><img src="images/cursor-sizeall.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::SizeAllCursor</a></td><td ><tt>size_all</tt></td></tr> <tr valign="top" class="even"><td ><img src="images/cursor-busy.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::BusyCursor</a></td><td ><tt>left_ptr_watch</tt></td><td ><img src="images/cursor-vsplit.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::SplitVCursor</a></td><td ><tt>split_v</tt></td></tr> <tr valign="top" class="odd"><td ><img src="images/cursor-forbidden.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::ForbiddenCursor</a></td><td ><tt>forbidden</tt></td><td ><img src="images/cursor-hsplit.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::SplitHCursor</a></td><td ><tt>split_h</tt></td></tr> <tr valign="top" class="even"><td ><img src="images/cursor-hand.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::PointingHandCursor</a></td><td ><tt>pointing_hand</tt></td><td ><img src="images/cursor-openhand.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::OpenHandCursor</a></td><td ><tt>openhand</tt></td></tr> <tr valign="top" class="odd"><td ><img src="images/cursor-whatsthis.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::WhatsThisCursor</a></td><td ><tt>whats_this</tt></td><td ><img src="images/cursor-closedhand.png" alt="" /></td><td ><a href="qt.html#CursorShape-enum">Qt::ClosedHandCursor</a></td><td ><tt>closedhand</tt></td></tr> <tr valign="top" class="even"><td ></td><td ><a href="qt.html#CursorShape-enum">Qt::DragMoveCursor</a></td><td ><tt>dnd-move</tt> or <tt>move</tt></td><td ></td><td ><a href="qt.html#CursorShape-enum">Qt::DragCopyCursor</a></td><td ><tt>dnd-copy</tt> or <tt>copy</tt></td></tr> <tr valign="top" class="odd"><td ></td><td ><a href="qt.html#CursorShape-enum">Qt::DragLinkCursor</a></td><td ><tt>dnd-link</tt> or <tt>link</tt></td></tr> </table> </div> <p><b>See also </b><a href="qwidget.html">QWidget</a> and <a href="guibooks.html#fowler">GUI Design Handbook: Cursors</a>.</p> <!-- @@@QCursor --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QCursor[overload1]$$$QCursor --> <h3 class="fn"><a name="QCursor"></a>QCursor::<span class="name">QCursor</span> ()</h3> <p>Constructs a cursor with the default arrow shape.</p> <!-- @@@QCursor --> <!-- $$$QCursor$$$QCursorQt::CursorShape --> <h3 class="fn"><a name="QCursor-2"></a>QCursor::<span class="name">QCursor</span> ( <span class="type"><a href="qt.html#CursorShape-enum">Qt::CursorShape</a></span> <i>shape</i> )</h3> <p>Constructs a cursor with the specified <i>shape</i>.</p> <p>See <a href="qt.html#CursorShape-enum">Qt::CursorShape</a> for a list of shapes.</p> <p><b>See also </b><a href="qcursor.html#setShape">setShape</a>().</p> <!-- @@@QCursor --> <!-- $$$QCursor$$$QCursorconstQBitmap&constQBitmap&intint --> <h3 class="fn"><a name="QCursor-3"></a>QCursor::<span class="name">QCursor</span> ( const <span class="type"><a href="qbitmap.html">QBitmap</a></span> & <i>bitmap</i>, const <span class="type"><a href="qbitmap.html">QBitmap</a></span> & <i>mask</i>, <span class="type">int</span> <i>hotX</i> = -1, <span class="type">int</span> <i>hotY</i> = -1 )</h3> <p>Constructs a custom bitmap cursor.</p> <p><i>bitmap</i> and <i>mask</i> make up the bitmap. <i>hotX</i> and <i>hotY</i> define the cursor's hot spot.</p> <p>If <i>hotX</i> is negative, it is set to the <tt>bitmap().width()/2</tt>. If <i>hotY</i> is negative, it is set to the <tt>bitmap().height()/2</tt>.</p> <p>The cursor <i>bitmap</i> (B) and <i>mask</i> (M) bits are combined like this:</p> <ul> <li>B=1 and M=1 gives black.</li> <li>B=0 and M=1 gives white.</li> <li>B=0 and M=0 gives transparent.</li> <li>B=1 and M=0 gives an XOR'd result under Windows, undefined results on all other platforms.</li> </ul> <p>Use the global Qt color <a href="qt.html#GlobalColor-enum">Qt::color0</a> to draw 0-pixels and <a href="qt.html#GlobalColor-enum">Qt::color1</a> to draw 1-pixels in the bitmaps.</p> <p>Valid cursor sizes depend on the display hardware (or the underlying window system). We recommend using 32 x 32 cursors, because this size is supported on all platforms. Some platforms also support 16 x 16, 48 x 48, and 64 x 64 cursors.</p> <p><b>Note:</b> On Windows CE, the cursor size is fixed. If the pixmap is bigger than the system size, it will be scaled.</p> <p><b>See also </b><a href="qbitmap.html#QBitmap">QBitmap::QBitmap</a>() and <a href="qpixmap.html#setMask">QBitmap::setMask</a>().</p> <!-- @@@QCursor --> <!-- $$$QCursor$$$QCursorconstQPixmap&intint --> <h3 class="fn"><a name="QCursor-4"></a>QCursor::<span class="name">QCursor</span> ( const <span class="type"><a href="qpixmap.html">QPixmap</a></span> & <i>pixmap</i>, <span class="type">int</span> <i>hotX</i> = -1, <span class="type">int</span> <i>hotY</i> = -1 )</h3> <p>Constructs a custom pixmap cursor.</p> <p><i>pixmap</i> is the image. It is usual to give it a mask (set using <a href="qpixmap.html#setMask">QPixmap::setMask</a>()). <i>hotX</i> and <i>hotY</i> define the cursor's hot spot.</p> <p>If <i>hotX</i> is negative, it is set to the <tt>pixmap().width()/2</tt>. If <i>hotY</i> is negative, it is set to the <tt>pixmap().height()/2</tt>.</p> <p>Valid cursor sizes depend on the display hardware (or the underlying window system). We recommend using 32 x 32 cursors, because this size is supported on all platforms. Some platforms also support 16 x 16, 48 x 48, and 64 x 64 cursors.</p> <p><b>Note:</b> On Windows CE, the cursor size is fixed. If the pixmap is bigger than the system size, it will be scaled.</p> <p><b>See also </b><a href="qpixmap.html#QPixmap">QPixmap::QPixmap</a>() and <a href="qpixmap.html#setMask">QPixmap::setMask</a>().</p> <!-- @@@QCursor --> <!-- $$$QCursor$$$QCursorconstQCursor& --> <h3 class="fn"><a name="QCursor-5"></a>QCursor::<span class="name">QCursor</span> ( const <span class="type">QCursor</span> & <i>c</i> )</h3> <p>Constructs a copy of the cursor <i>c</i>.</p> <!-- @@@QCursor --> <!-- $$$QCursor$$$QCursorHCURSOR --> <h3 class="fn"><a name="QCursor-6"></a>QCursor::<span class="name">QCursor</span> ( <span class="type">HCURSOR</span> <i>cursor</i> )</h3> <p>Constructs a Qt cursor from the given Windows <i>cursor</i>.</p> <p><b>Warning:</b> This function is only available on Windows.</p> <p><b>See also </b><a href="qcursor.html#handle">handle</a>().</p> <!-- @@@QCursor --> <!-- $$$QCursor$$$QCursorQt::HANDLE --> <h3 class="fn"><a name="QCursor-7"></a>QCursor::<span class="name">QCursor</span> ( <span class="type"><a href="qt.html#HANDLE-typedef">Qt::HANDLE</a></span> <i>handle</i> )</h3> <p>Constructs a Qt cursor from the given <i>handle</i>.</p> <p><b>Warning:</b> This function is only available on X11.</p> <p><b>See also </b><a href="qcursor.html#handle">handle</a>().</p> <!-- @@@QCursor --> <!-- $$$~QCursor[overload1]$$$~QCursor --> <h3 class="fn"><a name="dtor.QCursor"></a>QCursor::<span class="name">~QCursor</span> ()</h3> <p>Destroys the cursor.</p> <!-- @@@~QCursor --> <!-- $$$bitmap[overload1]$$$bitmap --> <h3 class="fn"><a name="bitmap"></a>const <span class="type"><a href="qbitmap.html">QBitmap</a></span> * QCursor::<span class="name">bitmap</span> () const</h3> <p>Returns the cursor bitmap, or 0 if it is one of the standard cursors.</p> <!-- @@@bitmap --> <!-- $$$handle[overload1]$$$handle --> <h3 class="fn"><a name="handle"></a><span class="type">HCURSOR_or_HANDLE</span> QCursor::<span class="name">handle</span> () const</h3> <p>Returns a platform-specific cursor handle. The <tt>HCURSOR_or_HANDLE</tt> type is <tt>HCURSOR</tt> on Windows and <a href="qt.html#HANDLE-typedef">Qt::HANDLE</a> on X11 and Mac OS X. On <a href="qt-embedded-linux.html">Qt for Embedded Linux</a> it is an integer.</p> <p><b>Warning:</b> Using the value returned by this function is not portable.</p> <!-- @@@handle --> <!-- $$$hotSpot[overload1]$$$hotSpot --> <h3 class="fn"><a name="hotSpotx"></a><span class="type"><a href="qpoint.html">QPoint</a></span> QCursor::<span class="name">hotSpot</span> () const</h3> <p>Returns the cursor hot spot, or (0, 0) if it is one of the standard cursors.</p> <!-- @@@hotSpot --> <!-- $$$mask[overload1]$$$mask --> <h3 class="fn"><a name="mask"></a>const <span class="type"><a href="qbitmap.html">QBitmap</a></span> * QCursor::<span class="name">mask</span> () const</h3> <p>Returns the cursor bitmap mask, or 0 if it is one of the standard cursors.</p> <!-- @@@mask --> <!-- $$$pixmap[overload1]$$$pixmap --> <h3 class="fn"><a name="pixmap"></a><span class="type"><a href="qpixmap.html">QPixmap</a></span> QCursor::<span class="name">pixmap</span> () const</h3> <p>Returns the cursor pixmap. This is only valid if the cursor is a pixmap cursor.</p> <!-- @@@pixmap --> <!-- $$$pos[overload1]$$$pos --> <h3 class="fn"><a name="pos"></a><span class="type"><a href="qpoint.html">QPoint</a></span> QCursor::<span class="name">pos</span> ()<tt> [static]</tt></h3> <p>Returns the position of the cursor (hot spot) in global screen coordinates.</p> <p>You can call <a href="qwidget.html#mapFromGlobal">QWidget::mapFromGlobal</a>() to translate it to widget coordinates.</p> <p><b>See also </b><a href="qcursor.html#setPos">setPos</a>(), <a href="qwidget.html#mapFromGlobal">QWidget::mapFromGlobal</a>(), and <a href="qwidget.html#mapToGlobal">QWidget::mapToGlobal</a>().</p> <!-- @@@pos --> <!-- $$$setPos[overload1]$$$setPosintint --> <h3 class="fn"><a name="setPos"></a><span class="type">void</span> QCursor::<span class="name">setPos</span> ( <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i> )<tt> [static]</tt></h3> <p>Moves the cursor (hot spot) to the global screen position (<i>x</i>, <i>y</i>).</p> <p>You can call <a href="qwidget.html#mapToGlobal">QWidget::mapToGlobal</a>() to translate widget coordinates to global screen coordinates.</p> <p><b>See also </b><a href="qcursor.html#pos">pos</a>(), <a href="qwidget.html#mapFromGlobal">QWidget::mapFromGlobal</a>(), and <a href="qwidget.html#mapToGlobal">QWidget::mapToGlobal</a>().</p> <!-- @@@setPos --> <!-- $$$setPos$$$setPosconstQPoint& --> <h3 class="fn"><a name="setPos-2"></a><span class="type">void</span> QCursor::<span class="name">setPos</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> & <i>p</i> )<tt> [static]</tt></h3> <p>This is an overloaded function.</p> <p>Moves the cursor (hot spot) to the global screen position at point <i>p</i>.</p> <!-- @@@setPos --> <!-- $$$setShape[overload1]$$$setShapeQt::CursorShape --> <h3 class="fn"><a name="setShape"></a><span class="type">void</span> QCursor::<span class="name">setShape</span> ( <span class="type"><a href="qt.html#CursorShape-enum">Qt::CursorShape</a></span> <i>shape</i> )</h3> <p>Sets the cursor to the shape identified by <i>shape</i>.</p> <p>See <a href="qt.html#CursorShape-enum">Qt::CursorShape</a> for the list of cursor shapes.</p> <p><b>See also </b><a href="qcursor.html#shape">shape</a>().</p> <!-- @@@setShape --> <!-- $$$shape[overload1]$$$shape --> <h3 class="fn"><a name="shape"></a><span class="type"><a href="qt.html#CursorShape-enum">Qt::CursorShape</a></span> QCursor::<span class="name">shape</span> () const</h3> <p>Returns the cursor shape identifier. The return value is one of the <a href="qt.html#CursorShape-enum">Qt::CursorShape</a> enum values (cast to an int).</p> <p><b>See also </b><a href="qcursor.html#setShape">setShape</a>().</p> <!-- @@@shape --> <!-- $$$operator QVariant[overload1]$$$operator QVariant --> <h3 class="fn"><a name="operator-QVariant"></a>QCursor::<span class="name">operator QVariant</span> () const</h3> <p>Returns the cursor as a <a href="qvariant.html">QVariant</a>.</p> <!-- @@@operator QVariant --> <!-- $$$operator=[overload1]$$$operator=constQCursor& --> <h3 class="fn"><a name="operator-eq"></a><span class="type">QCursor</span> & QCursor::<span class="name">operator=</span> ( const <span class="type">QCursor</span> & <i>c</i> )</h3> <p>Assigns <i>c</i> to this cursor and returns a reference to this cursor.</p> <!-- @@@operator= --> </div> <div class="relnonmem"> <h2>Related Non-Members</h2> <!-- $$$operator<<$$$operator<<QDataStream&constQCursor& --> <h3 class="fn"><a name="operator-lt-lt-169"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> & <span class="name">operator<<</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> & <i>stream</i>, const <span class="type">QCursor</span> & <i>cursor</i> )</h3> <p>Writes the <i>cursor</i> to the <i>stream</i>.</p> <p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p> <!-- @@@operator<< --> <!-- $$$operator>>$$$operator>>QDataStream&QCursor& --> <h3 class="fn"><a name="operator-gt-gt-100"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> & <span class="name">operator>></span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> & <i>stream</i>, <span class="type">QCursor</span> & <i>cursor</i> )</h3> <p>Reads the <i>cursor</i> from the <i>stream</i>.</p> <p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p> <!-- @@@operator>> --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its subsidiaries. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>