cutelystforms 0.0.1
A Cutelyst plugin to load forms data from QML files.
Loading...
Searching...
No Matches
CutelystForms::Forms Class Reference

Provides loading and processing HTML form data written in QML. More...

#include <CutelystForms/Forms>

Public Member Functions

 Forms (Cutelyst::Application *parent)
 Constructs a new Forms plugin object with the given parent.
 ~Forms () override
 Destroys the Forms object.
void addImportPath (const QString &path)
 Adds an import path to the internal QQmlEngine.
QStringList importPaths () const noexcept
 Returns the current list of import paths used by the internal QQmlEngine.
QStringList includePaths () const noexcept
 Returns the list of include paths.
void setIncludePaths (const QStringList &paths)
 Sets the list of include paths.

Protected Member Functions

bool setup (Cutelyst::Application *app) override
 Sets the Forms plugin up to be used by app.

Detailed Description

Provides loading and processing HTML form data written in QML.

Logging

Information is logged to the cutelyst.forms logging category. Warnings from the internal QQmlEngine will also be redirected to this category.

Building and using

The plugin is linked to Cutelyst Core API, QtCore and QtQml. If the CSRFProtection plugin is enabled, it will also be linked against that. To use it in your application, link your application to Cutelyst::Forms.

The Forms plugin class.

Constructor & Destructor Documentation

◆ Forms()

Forms::Forms ( Cutelyst::Application * parent)
explicit

Constructs a new Forms plugin object with the given parent.

◆ ~Forms()

Forms::~Forms ( )
override

Destroys the Forms object.

Member Function Documentation

◆ addImportPath()

void Forms::addImportPath ( const QString & path)

Adds an import path to the internal QQmlEngine.

See also
importPaths(), QQmlEngine::addImportPath()

◆ importPaths()

QStringList Forms::importPaths ( ) const
nodiscardnoexcept

Returns the current list of import paths used by the internal QQmlEngine.

See also
addImportPath(), QQmlEngine::importPathList()

◆ includePaths()

QStringList Forms::includePaths ( ) const
nodiscardnoexcept

Returns the list of include paths.

The include paths are used to load QML files that define a HTML form.

Use setIncludePahts() to set the list of paths.

◆ setIncludePaths()

void Forms::setIncludePaths ( const QStringList & paths)

Sets the list of include paths.

The include paths are used to load QML files that define a HTML form.

Use includePaths() to return a list of currently set paths.

◆ setup()

bool Forms::setup ( Cutelyst::Application * app)
overrideprotected

Sets the Forms plugin up to be used by app.