QtCraft API C++ classes QML types Handbook

QcPointerRadial Class

The hotbar's radial menu with the mouse (decision E-614): while its key is held the mouse does not turn the view but moves a pointer from the centre, and the direction of the pointer picks the slot like the pad's right stick (QcHotbarRadial). More...

Header: #include <clientcore/input/QcPointerRadial.h>

Public Functions

void cancel()
std::optional<int> close()
int highlighted() const
bool isOpen() const
bool move(QPointF delta)
void open(int selectedSlot)
QPointF pointer() const

Static Public Members

const double reach

Detailed Description

The pointer stays within reach pixels of the centre, so turning back needs no more than that; the menu points at a slot once the pointer is half of reach out. State only, without a session or a window.

Member Function Documentation

void QcPointerRadial::cancel()

Closes without selecting.

std::optional<int> QcPointerRadial::close()

Closes and returns the slot to select (nullopt when it was closed already).

int QcPointerRadial::highlighted() const

Returns the highlighted slot while open (-1 while closed).

bool QcPointerRadial::isOpen() const

Returns whether the menu is open.

bool QcPointerRadial::move(QPointF delta)

The mouse moved by delta (y positive down). Returns whether the highlighted slot changed.

void QcPointerRadial::open(int selectedSlot)

Opens on the slot in the hand, selectedSlot, with the pointer in the centre.

QPointF QcPointerRadial::pointer() const

Returns the pointer's offset from the centre, in pixels.

Member Variable Documentation

const double QcPointerRadial::reach

Mouse travel (pixels of the window, before the sensitivity) for a full deflection.