QtCraft API C++ classes QML types Handbook

QcPreviewActivity Namespace

When a character preview draws (decision E-231). More...

Header: #include <clientcore/preview/QcPreviewActivity.h>

Classes

struct State

Types

enum class Mode { Off, Still, Animated }
enum class Window { None, Hidden, Minimised, Inactive, Active }

Functions

QcPreviewActivity::Mode mode(QcPreviewActivity::State state)
bool timerRuns(QcPreviewActivity::Mode mode, bool figureDrawn)

Detailed Description

The item reports what it knows about itself and its window; the rules are GUI-free, so they are testable.

Classes

class State

What the preview item knows about itself and its window. More...

Type Documentation

enum class QcPreviewActivity::Mode

How the preview draws.

ConstantValueDescription
QcPreviewActivity::Mode::Off0Nothing is drawn and no timer runs.
QcPreviewActivity::Mode::Still1The figure as it is: drawn until a frame shows it, then the picture stays.
QcPreviewActivity::Mode::Animated2Animated at the preview's frame rate.

enum class QcPreviewActivity::Window

The state of the window the preview lies in.

ConstantValueDescription
QcPreviewActivity::Window::None0Not in a window yet.
QcPreviewActivity::Window::Hidden1The window is hidden.
QcPreviewActivity::Window::Minimised2The window is minimised.
QcPreviewActivity::Window::Inactive3Shown, but another program has the focus (or a scripted or offscreen run).
QcPreviewActivity::Window::Active4Shown and focused.

Function Documentation

QcPreviewActivity::Mode QcPreviewActivity::mode(QcPreviewActivity::State state)

Returns how a preview in state draws: off unless it is visible with a size and a source in a shown window; still while paused or in an inactive window (unless forceActive); animated otherwise.

bool QcPreviewActivity::timerRuns(QcPreviewActivity::Mode mode, bool figureDrawn)

Returns whether the frame timer runs in mode: always while animated; while still only until a frame showed the figure (figureDrawn) (the content may still be loading).