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// Qt-Security score:significant reason:default
4#ifndef QPLATFORMCURSOR_H
5#define QPLATFORMCURSOR_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is part of the QPA API and is not meant to be used
12// in applications. Usage of this API may make your code
13// source and binary incompatible with future versions of Qt.
14//
15
16#include <QtGui/qtguiglobal.h>
17#include <QtCore/QList>
18#include <QtGui/QImage>
19#include <QtGui/QMouseEvent>
20#include <QtCore/QObject>
21#include <qpa/qplatformscreen.h>
22#include <QtGui/QCursor>
23
25
26
27// Cursor graphics management
29public:
30 QPlatformCursorImage(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY)
31 { set(data, mask, width, height, hotX, hotY); }
32 QImage * image() { return &cursorImage; }
33 QPoint hotspot() const { return hot; }
34 void set(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY);
35 void set(const QImage &image, int hx, int hy);
36 void set(Qt::CursorShape);
37private:
38 static void createSystemCursor(int id);
39 QImage cursorImage;
40 QPoint hot;
41};
42
43class Q_GUI_EXPORT QPlatformCursor : public QObject {
44public:
45 Q_DISABLE_COPY_MOVE(QPlatformCursor)
46
47 enum Capability {
48 OverrideCursor = 0x1
49 };
50 Q_DECLARE_FLAGS(Capabilities, Capability)
51
52 QPlatformCursor();
53
54 // input methods
55 virtual void pointerEvent(const QMouseEvent & event) { Q_UNUSED(event); }
56#ifndef QT_NO_CURSOR
57 virtual void changeCursor(QCursor * windowCursor, QWindow * window) = 0;
58 virtual void setOverrideCursor(const QCursor &);
59 virtual void clearOverrideCursor();
60#endif // QT_NO_CURSOR
61 virtual QPoint pos() const;
62 virtual void setPos(const QPoint &pos);
63 virtual QSize size() const;
64
65 static Capabilities capabilities() { return m_capabilities; }
66 static void setCapabilities(Capabilities c) { m_capabilities = c; }
67 static void setCapability(Capability c) { m_capabilities.setFlag(c); }
68
69private:
70 friend void qt_qpa_set_cursor(QWidget * w, bool force);
71 friend class QApplicationPrivate;
72
73 static Capabilities m_capabilities;
74};
75
76Q_DECLARE_OPERATORS_FOR_FLAGS(QPlatformCursor::Capabilities)
77
78QT_END_NAMESPACE
79
80#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[]