Detailed Description
Builds the cursors and puts them everywhere a standard shape would reach the platform: widgets, windows (QML included), the override cursor and the cursors of drag and drop.
A set of cursors is built for each scale of screen something is shown on, when first needed: the platforms show a window's cursor at the scale of the window's screen (one scale for the whole desktop on X11), and Qt resamples a pixmap made for another one. Each widget and window gets the set of its screen, again when it moves to another screen; the override cursor and the cursors of a drag get the set of the screen under the pointer.
Classes | |
| struct | Impl |
| struct | Set |
Public Member Functions | |
| void | setZoom (double zoom) |
| double | zoom () const noexcept |
| void | rebuild () |
| Rebuilds the cursors for the screens as they are now. | |
| const QCursor & | cursor (CursorArtwork a) const noexcept |
| QCursor | cursor (Qt::CursorShape s) const noexcept |
| const QCursor & | cursor (CursorArtwork a, double screenScale) const noexcept |
| The cursor of a screen scale (see cursorGeometry()), built if needed. | |
| double | screenScaleOf (const QScreen *screen) const noexcept |
| double | screenScaleOf (const QWindow &window) const noexcept |
| double | screenScaleOf (const QWidget &widget) const noexcept |
| QPixmap | dragCursor (Qt::DropAction action) const noexcept |
| QPixmap | dragCursor (Qt::DropAction action, double screenScale) const noexcept |
| void | setDragCursors (QDrag &drag) const |
| void | install () |
| bool | installed () const noexcept |
| void | fixWidget (QWidget &w) const |
| void | fixWindow (QWindow &w) const |
| CursorPlatform | platform () const noexcept |
| Geometry the cursors of the primary screen are built with. | |
| double | screenScale () const noexcept |
Static Public Member Functions | |
| static CursorTheme & | instance () |
| static void | setStartupZoom (double zoom) noexcept |
Member Function Documentation
◆ cursor() [1/2]
|
noexcept |
The cursors of the primary screen, which score's code sets: the theme swaps them for those of the screen they are shown on.
◆ cursor() [2/2]
|
noexcept |
The cursor shown for a standard shape; the shape itself for Qt::BlankCursor and for the shapes that are not standard.
◆ dragCursor()
|
noexcept |
Pixmap QDrag::setDragCursor expects for a drop action on the platform, for the primary screen or for a screen scale.
◆ fixWidget()
| void score::CursorTheme::fixWidget | ( | QWidget & | w | ) | const |
Replaces a standard cursor shape, or a cursor of score made for another zoom or screen, on one widget or window, and gives the top-level ones that have none score's pointer. Used by the filter.
◆ install()
| void score::CursorTheme::install | ( | ) |
Installs the application wide event filter, and replaces the standard cursors already set on existing widgets and windows. Needs a QGuiApplication.
◆ screenScaleOf()
|
noexcept |
The scale cursors are built at for what is shown on a screen, in a window or in a widget.
◆ setDragCursors()
| void score::CursorTheme::setDragCursors | ( | QDrag & | drag | ) | const |
Gives a drag score's cursors, for the screen the pointer is on, for every action it does not have a cursor of its own for.
◆ setStartupZoom()
|
staticnoexcept |
The zoom the cursors are built for: score's graphical zoom. Callable before the QGuiApplication exists.
◆ setZoom()
| void score::CursorTheme::setZoom | ( | double | zoom | ) |
Rebuilds the cursors for a new zoom, and puts the new ones in place of the old ones on every widget, window and graphics item.
The documentation for this class was generated from the following files:
- CursorTheme.hpp
- CursorTheme.cpp