6#include "RenderState.h"
13class Q_DECL_HIDDEN RenderState::Private
18 RenderStatus m_status;
21 RenderStatus
status()
const;
22 static RenderStatus minimumStatus(RenderStatus a, RenderStatus b);
26RenderState::RenderState(
const QString &name, RenderStatus
status)
32RenderState::RenderState(
const RenderState &other)
38RenderState &RenderState::operator=(
const RenderState &other)
44RenderState::~RenderState()
49RenderStatus RenderState::status()
const
54QString RenderState::name()
const
59int RenderState::children()
const
61 return d->m_children.
size();
64RenderState RenderState::childAt(
int index)
const
66 return d->m_children.at(index);
69void RenderState::addChild(
const RenderState &child)
71 d->m_children.push_back(child);
74RenderState::operator
QString()
const
76 return d->toString(*
this, 0);
79RenderState::Private::Private(
const QString &name, RenderStatus
status)
86RenderStatus RenderState::Private::status()
const
89 for (
const RenderState &child : m_children) {
92 return minimumStatus(
status, m_status);
95RenderStatus RenderState::Private::minimumStatus(RenderStatus a, RenderStatus b)
97 if (a == Incomplete || b == Incomplete) {
100 if (a == WaitingForData || b == WaitingForData) {
103 if (a == WaitingForUpdate || b == WaitingForUpdate) {
107 Q_ASSERT(a == Complete || b == Complete);
111QString RenderState::Private::toString(
const RenderState &state,
int level)
const
116 switch (state.status()) {
121 status =
"Waiting for update";
124 status =
"Waiting for data";
130 QString const name = (state.name().isEmpty() ?
"Anonymous renderer" : state.name());
131 QString result = QStringLiteral(
"%1%2%3: %4").
arg(prefix, indent, name,
status);
133 for (
const RenderState &child : state.d->m_children) {
134 result +=
toString(child, level + 1);
Q_SCRIPTABLE CaptureState status()
char * toString(const EngineQuery &query)
QStringView level(QStringView ifopt)
QString name(StandardAction id)
Binds a QML item to a specific geodetic location in screen coordinates.
@ Incomplete
Data is missing and some error occurred when trying to retrieve it (e.g. network failure)
@ WaitingForData
Rendering is based on no or partial data, more data was requested (e.g. pending network queries)
@ Complete
All data is there and up to date.
@ WaitingForUpdate
Rendering is based on complete, but outdated data, data update was requested.
QString arg(Args &&... args) const const
qsizetype size() const const