5 #include "application.h" 6 #include "componentfactory.h" 8 #include "renderview_p.h" 12 #include <QtCore/QLoggingCategory> 14 Q_LOGGING_CATEGORY(CUTELYST_RENDERVIEW,
"cutelyst.renderview", QtWarningMsg)
60 :
Action(new RenderViewPrivate, parent)
69 const auto attributes = args.value(u
"attributes"_s).value<
ParamsMultiMap>();
70 d->view = application->
view(attributes.value(u
"View"_s));
96 quint16 status = res->
status();
97 if (status == 204 || (status >= 300 && status < 400)) {
105 }
else if (d->view) {
110 qCCritical(CUTELYST_RENDERVIEW) <<
"Could not find a view to render.";
115 #include "moc_renderview.cpp" bool doExecute(Context *c) override
Response * res() const noexcept
bool isEmpty() const const
Sensible default end action that forwards to a View.
void setContentType(const QByteArray &type)
This class represents a Cutelyst Action.
bool hasBody() const noexcept
bool forward(Component *component)
virtual bool init(Application *application, const QVariantHash &args)
The Cutelyst namespace holds all public Cutelyst API.
View * view(QStringView name={}) const
quint16 status() const noexcept
QByteArray contentType() const
bool doExecute(Cutelyst::Context *c) override
QString fromLatin1(QByteArrayView str)
Abstract View component for Cutelyst.
The Cutelyst application.
bool init(Application *application, const QVariantHash &args) override
bool isHead() const noexcept
void setStatus(quint16 status) noexcept
View * customView() const noexcept
RenderView(QObject *parent=nullptr)