Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qplatformcursor.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QPLATFORMCURSOR_H
4#define QPLATFORMCURSOR_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is part of the QPA API and is not meant to be used
11// in applications. Usage of this API may make your code
12// source and binary incompatible with future versions of Qt.
13//
14
15#include <QtGui/qtguiglobal.h>
16#include <QtCore/QList>
17#include <QtGui/QImage>
18#include <QtGui/QMouseEvent>
19#include <QtCore/QObject>
20#include <qpa/qplatformscreen.h>
21#include <QtGui/QCursor>
22
24
25
26// Cursor graphics management
28public:
29 QPlatformCursorImage(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY)
30 { set(data, mask, width, height, hotX, hotY); }
31 QImage * image() { return &cursorImage; }
32 QPoint hotspot() const { return hot; }
33 void set(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY);
34 void set(const QImage &image, int hx, int hy);
35 void set(Qt::CursorShape);
36private:
37 static void createSystemCursor(int id);
38 QImage cursorImage;
39 QPoint hot;
40};
41
42class Q_GUI_EXPORT QPlatformCursor : public QObject {
43public:
44 Q_DISABLE_COPY_MOVE(QPlatformCursor)
45
46 enum Capability {
47 OverrideCursor = 0x1
48 };
49 Q_DECLARE_FLAGS(Capabilities, Capability)
50
51 QPlatformCursor();
52
53 // input methods
54 virtual void pointerEvent(const QMouseEvent & event) { Q_UNUSED(event); }
55#ifndef QT_NO_CURSOR
56 virtual void changeCursor(QCursor * windowCursor, QWindow * window) = 0;
57 virtual void setOverrideCursor(const QCursor &);
58 virtual void clearOverrideCursor();
59#endif // QT_NO_CURSOR
60 virtual QPoint pos() const;
61 virtual void setPos(const QPoint &pos);
62 virtual QSize size() const;
63
64 static Capabilities capabilities() { return m_capabilities; }
65 static void setCapabilities(Capabilities c) { m_capabilities = c; }
66 static void setCapability(Capability c) { m_capabilities.setFlag(c); }
67
68private:
69 friend void qt_qpa_set_cursor(QWidget * w, bool force);
70 friend class QApplicationPrivate;
71
72 static Capabilities m_capabilities;
73};
74
75Q_DECLARE_OPERATORS_FOR_FLAGS(QPlatformCursor::Capabilities)
76
77QT_END_NAMESPACE
78
79#endif // QPLATFORMCURSOR_H
The QPlatformCursorImage class provides a set of graphics intended to be used as cursors.
The QPlatformCursor class provides information about pointer device events (movement,...
static const uchar busy_bits[]
static const uchar phandm_bits[]
static const uchar forbidden_bits[]
static const uchar busym_bits[]
static const uchar mcur_ver_bits[]
static const uchar mcur_fdiag_bits[]
static const uchar hsplit_bits[]
static const uchar closedhandm_bits[]
static const uchar cur_bdiag_bits[]
static const uchar size_all_mask_bits[]
static const uchar cur_arrow_bits[]
static const uchar wait_mask_bits[]
static const uchar whatsthis_bits[]
static const uchar openhand_bits[]
static const unsigned char cur_up_arrow_bits[]
static const uchar openhandm_bits[]
static const uchar cur_ibeam_bits[]
static const uchar cur_fdiag_bits[]
static bool systemCursorTableInit
static const unsigned char cur_cross_bits[]
static const uchar hsplitm_bits[]
static const unsigned char mcur_up_arrow_bits[]
static const uchar forbiddenm_bits[]
static const uchar mcur_arrow_bits[]
static const uchar mcur_bdiag_bits[]
static const uchar wait_data_bits[]
static const uchar vsplit_bits[]
static const uchar mcur_ibeam_bits[]
static const uchar cur_hor_bits[]
static const uchar vsplitm_bits[]
static const uchar phand_bits[]
static QPlatformCursorImage * systemCursorTable[Qt::LastCursor+1]
static const uchar closedhand_bits[]
static const uchar mcur_hor_bits[]
static const uchar cur_ver_bits[]
static const uchar whatsthism_bits[]
static const uchar size_all_data_bits[]
static const unsigned char mcur_cross_bits[]