1// qcursor.sip generated by MetaSIP 2// 3// This file is part of the QtGui Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QCursor /TypeHintIn="Union[QCursor, Qt.CursorShape]"/ 24{ 25%TypeHeaderCode 26#include <qcursor.h> 27%End 28 29%ConvertToTypeCode 30// SIP doesn't support automatic type convertors so we explicitly allow a 31// Qt::CursorShape to be used whenever a QCursor is expected. 32 33if (sipIsErr == NULL) 34 return (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_Qt_CursorShape)) || 35 sipCanConvertToType(sipPy, sipType_QCursor, SIP_NO_CONVERTORS)); 36 37if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_Qt_CursorShape))) 38{ 39 *sipCppPtr = new QCursor((Qt::CursorShape)SIPLong_AsLong(sipPy)); 40 41 return sipGetState(sipTransferObj); 42} 43 44*sipCppPtr = reinterpret_cast<QCursor *>(sipConvertToType(sipPy, sipType_QCursor, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr)); 45 46return 0; 47%End 48 49public: 50 QCursor(); 51 QCursor(const QBitmap &bitmap, const QBitmap &mask, int hotX = -1, int hotY = -1); 52 QCursor(const QPixmap &pixmap, int hotX = -1, int hotY = -1); 53 QCursor(const QCursor &cursor); 54 QCursor(const QVariant &variant /GetWrapper/) /NoDerived/; 55%MethodCode 56 if (a0->canConvert<QCursor>()) 57 sipCpp = new QCursor(a0->value<QCursor>()); 58 else 59 sipError = sipBadCallableArg(0, a0Wrapper); 60%End 61 62 ~QCursor(); 63 Qt::CursorShape shape() const; 64 void setShape(Qt::CursorShape newShape); 65 const QBitmap *bitmap() const; 66 const QBitmap *mask() const; 67 QPixmap pixmap() const; 68 QPoint hotSpot() const; 69 static QPoint pos(); 70 static void setPos(int x, int y); 71 static void setPos(const QPoint &p); 72 static QPoint pos(const QScreen *screen); 73 static void setPos(QScreen *screen, int x, int y); 74 static void setPos(QScreen *screen, const QPoint &p); 75%If (Qt_5_7_0 -) 76 void swap(QCursor &other); 77%End 78}; 79 80QDataStream &operator<<(QDataStream &outS, const QCursor &cursor /Constrained/) /ReleaseGIL/; 81QDataStream &operator>>(QDataStream &inS, QCursor &cursor /Constrained/) /ReleaseGIL/; 82%If (Qt_5_10_0 -) 83bool operator==(const QCursor &lhs, const QCursor &rhs); 84%End 85%If (Qt_5_10_0 -) 86bool operator!=(const QCursor &lhs, const QCursor &rhs); 87%End 88