Warning, file /include/QtGui/qcursor.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004 #ifndef QCURSOR_H
0005 #define QCURSOR_H
0006
0007 #include <QtGui/qtguiglobal.h>
0008 #include <QtCore/qpoint.h>
0009 #include <QtGui/qwindowdefs.h>
0010 #include <QtGui/qbitmap.h>
0011
0012 QT_BEGIN_NAMESPACE
0013
0014
0015 class QVariant;
0016 class QScreen;
0017
0018
0019
0020
0021 #ifdef QT_NO_CURSOR
0022
0023 class Q_GUI_EXPORT QCursor
0024 {
0025 public:
0026 static QPoint pos();
0027 static QPoint pos(const QScreen *screen);
0028 static void setPos(int x, int y);
0029 static void setPos(QScreen *screen, int x, int y);
0030 inline static void setPos(const QPoint &p) { setPos(p.x(), p.y()); }
0031 private:
0032 QCursor();
0033 };
0034
0035 #endif
0036
0037 #ifndef QT_NO_CURSOR
0038
0039 class QCursorData;
0040 class QBitmap;
0041 class QPixmap;
0042
0043
0044 class Q_GUI_EXPORT QCursor
0045 {
0046 public:
0047 QCursor();
0048 QCursor(Qt::CursorShape shape);
0049 QCursor(const QBitmap &bitmap, const QBitmap &mask, int hotX=-1, int hotY=-1);
0050 explicit QCursor(const QPixmap &pixmap, int hotX=-1, int hotY=-1);
0051 QCursor(const QCursor &cursor);
0052 ~QCursor();
0053 QCursor &operator=(const QCursor &cursor);
0054 QCursor(QCursor &&other) noexcept : d(std::exchange(other.d, nullptr)) {}
0055 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QCursor)
0056
0057 void swap(QCursor &other) noexcept { qt_ptr_swap(d, other.d); }
0058
0059 operator QVariant() const;
0060
0061 Qt::CursorShape shape() const;
0062 void setShape(Qt::CursorShape newShape);
0063
0064 #if QT_DEPRECATED_SINCE(6, 0)
0065 QT_DEPRECATED_VERSION_X_6_0("Use the overload without argument instead.")
0066 QBitmap bitmap(Qt::ReturnByValueConstant) const { return bitmap(); }
0067 QT_DEPRECATED_VERSION_X_6_0("Use the overload without argument instead.")
0068 QBitmap mask(Qt::ReturnByValueConstant) const { return mask(); }
0069 #endif
0070 QBitmap bitmap() const;
0071 QBitmap mask() const;
0072
0073 QPixmap pixmap() const;
0074 QPoint hotSpot() const;
0075
0076 static QPoint pos();
0077 static QPoint pos(const QScreen *screen);
0078 static void setPos(int x, int y);
0079 static void setPos(QScreen *screen, int x, int y);
0080 inline static void setPos(const QPoint &p) { setPos(p.x(), p.y()); }
0081 inline static void setPos(QScreen *screen, const QPoint &p) { setPos(screen, p.x(), p.y()); }
0082
0083 private:
0084 friend Q_GUI_EXPORT bool operator==(const QCursor &lhs, const QCursor &rhs) noexcept;
0085 friend inline bool operator!=(const QCursor &lhs, const QCursor &rhs) noexcept { return !(lhs == rhs); }
0086 QCursorData *d;
0087 };
0088 Q_DECLARE_SHARED(QCursor)
0089
0090
0091
0092
0093 #ifndef QT_NO_DATASTREAM
0094 Q_GUI_EXPORT QDataStream &operator<<(QDataStream &outS, const QCursor &cursor);
0095 Q_GUI_EXPORT QDataStream &operator>>(QDataStream &inS, QCursor &cursor);
0096 #endif
0097
0098 #ifndef QT_NO_DEBUG_STREAM
0099 Q_GUI_EXPORT QDebug operator<<(QDebug, const QCursor &);
0100 #endif
0101
0102 #endif
0103
0104 QT_END_NAMESPACE
0105
0106 #endif