morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::qt_quick::Backend Class Referencefinal

ui::IViewBackend over Qt Quick: each widget is a Qt Quick item made from its kind's MorphUi component, or from the component the restyle map names for that kind. More...

#include <backend.hpp>

Inheritance diagram for morph::qt_quick::Backend:
morph::ui::IViewBackend

Public Member Functions

 Backend (QQmlEngine &engine, QQuickItem &host, BackendOptions options={})
 A backend whose roots fill host.
 ~Backend () override
 Removes the roots' column from the host.
 Backend (Backend const &)=delete
Backend & operator= (Backend const &)=delete
 Backend (Backend &&)=delete
Backend & operator= (Backend &&)=delete
std::unique_ptr< CustomWidget > createCustom (ui::ContainerWidget *parent, CustomRequest const &request) override
 Loads a custom component by name.
std::unique_ptr< ui::TextWidget > createText (ui::ContainerWidget *parent) override
 Makes read-only text.
std::unique_ptr< ui::ButtonWidget > createButton (ui::ContainerWidget *parent) override
 Makes a push button.
std::unique_ptr< ui::TextInputWidget > createTextInput (ui::ContainerWidget *parent, ui::TextInputMode mode) override
 Makes a text field.
std::unique_ptr< ui::CheckboxWidget > createCheckbox (ui::ContainerWidget *parent) override
 Makes a check box.
std::unique_ptr< ui::SelectWidget > createSelect (ui::ContainerWidget *parent, ui::SelectStyle style) override
 Makes a choice of one option.
std::unique_ptr< ui::MenuWidget > createMenu (ui::ContainerWidget *parent) override
 Makes a command list.
std::unique_ptr< ui::StackWidget > createStack (ui::ContainerWidget *parent, ui::Axis axis) override
 Makes a stack.
std::unique_ptr< ui::GridWidget > createGrid (ui::ContainerWidget *parent) override
 Makes a grid.
std::unique_ptr< ui::SpacerWidget > createSpacer (ui::ContainerWidget *parent) override
 Makes empty space.
std::unique_ptr< ui::PanelWidget > createPanel (ui::ContainerWidget *parent) override
 Makes a titled frame.
std::unique_ptr< ui::ScrollWidget > createScroll (ui::ContainerWidget *parent, ui::Axis axis) override
 Makes a scroll area.
std::unique_ptr< ui::SlotWidget > createSlot (ui::ContainerWidget *parent) override
 Makes a slot.
std::unique_ptr< ui::TabsWidget > createTabs (ui::ContainerWidget *parent) override
 Makes a tab bar.
std::unique_ptr< ui::DialogWidget > createDialog (ui::ContainerWidget *parent) override
 Makes a modal overlay.
std::unique_ptr< ui::ToastWidget > createToast (ui::ContainerWidget *parent) override
 Makes a transient message.
std::unique_ptr< ui::BusyWidget > createBusy (ui::ContainerWidget *parent) override
 Makes a progress indicator.
std::unique_ptr< ui::TableWidget > createTable (ui::ContainerWidget *parent) override
 Makes a table.
std::unique_ptr< ui::DateTimeInputWidget > createDateTimeInput (ui::ContainerWidget *parent, ui::DateMode mode, int offsetMinutes) override
 Makes a date or date-and-time field.
std::unique_ptr< ui::SliderWidget > createSlider (ui::ContainerWidget *parent) override
 Makes a slider.
std::unique_ptr< ui::FilePickerWidget > createFilePicker (ui::ContainerWidget *parent, ui::FilePickerMode mode) override
 Makes a file path field.
std::unique_ptr< ui::BannerWidget > createBanner (ui::ContainerWidget *parent) override
 Makes a banner.
std::unique_ptr< ui::BadgeWidget > createBadge (ui::ContainerWidget *parent) override
 Makes a badge.
std::unique_ptr< ui::ProgressWidget > createProgress (ui::ContainerWidget *parent) override
 Makes a progress bar.
std::unique_ptr< ui::StepsWidget > createSteps (ui::ContainerWidget *parent) override
 Makes a steps indicator.
std::unique_ptr< ui::KeyValueWidget > createKeyValue (ui::ContainerWidget *parent) override
 Makes a key-value list.
std::unique_ptr< ui::EmptyStateWidget > createEmptyState (ui::ContainerWidget *parent) override
 Makes an empty state.
std::unique_ptr< ui::DrawerWidget > createDrawer (ui::ContainerWidget *parent, ui::Side side) override
 Makes a drawer.
std::unique_ptr< ui::SplitterWidget > createSplitter (ui::ContainerWidget *parent, ui::Axis axis) override
 Makes a splitter.
std::unique_ptr< ui::CollapsibleWidget > createCollapsible (ui::ContainerWidget *parent) override
 Makes a collapsible section.
std::unique_ptr< ui::DropZoneWidget > createDropZone (ui::ContainerWidget *parent) override
 Makes a drop zone.
Public Member Functions inherited from morph::ui::IViewBackend
 IViewBackend (IViewBackend const &)=delete
IViewBackend & operator= (IViewBackend const &)=delete
 IViewBackend (IViewBackend &&)=delete
IViewBackend & operator= (IViewBackend &&)=delete

Static Public Member Functions

static QQuickItem * itemOf (ui::Widget const &widget) noexcept
 The Qt Quick item a widget of this backend shows.

Detailed Description

ui::IViewBackend over Qt Quick: each widget is a Qt Quick item made from its kind's MorphUi component, or from the component the restyle map names for that kind.

Every root a mount makes is appended to a column the backend adds to the host item, so several roots share it top to bottom. Neither copyable nor movable. It belongs to the thread of its engine, and every widget it makes is destroyed before it.

Definition at line 54 of file backend.hpp.

Constructor & Destructor Documentation

◆ Backend()

morph::qt_quick::Backend::Backend ( QQmlEngine & engine,
QQuickItem & host,
BackendOptions options = {} )

A backend whose roots fill host.

Parameters
engineThe engine its components are compiled in. Borrowed.
hostThe item its roots are shown in. Borrowed.
optionsThe components and the width class callback.

Member Function Documentation

◆ itemOf()

QQuickItem * morph::qt_quick::Backend::itemOf ( ui::Widget const & widget)
staticnodiscardnoexcept

The Qt Quick item a widget of this backend shows.

Parameters
widgetThe widget.
Returns
Its item; null for a widget this backend did not make.

◆ createCustom()

std::unique_ptr< CustomWidget > morph::qt_quick::Backend::createCustom ( ui::ContainerWidget * parent,
CustomRequest const & request )
nodiscardoverridevirtual

Loads a custom component by name.

A host component loads into this backend's engine; a bundle component must match its digest and compiles in the components' contained engine. A component that cannot be loaded — not registered, a host component below minVersion, a digest that does not match, a compile error, a declared prop it lacks — is reported once through the components' failure callback, and the caller shows the fallback.

Parameters
parentThe container to append it to; null makes a root.
requestThe component and the props the document declares.
Returns
The widget, or null when the fallback is shown instead.

Reimplemented from morph::ui::IViewBackend.

◆ createText()

std::unique_ptr< ui::TextWidget > morph::qt_quick::Backend::createText ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes read-only text.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createButton()

std::unique_ptr< ui::ButtonWidget > morph::qt_quick::Backend::createButton ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a push button.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createTextInput()

std::unique_ptr< ui::TextInputWidget > morph::qt_quick::Backend::createTextInput ( ui::ContainerWidget * parent,
ui::TextInputMode mode )
nodiscardoverridevirtual

Makes a text field.

Parameters
parentThe container to append to, or null for a root.
modeSingle-line, multiline or password.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createCheckbox()

std::unique_ptr< ui::CheckboxWidget > morph::qt_quick::Backend::createCheckbox ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a check box.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createSelect()

std::unique_ptr< ui::SelectWidget > morph::qt_quick::Backend::createSelect ( ui::ContainerWidget * parent,
ui::SelectStyle style )
nodiscardoverridevirtual

Makes a choice of one option.

Parameters
parentThe container to append to, or null for a root.
styleDropdown or radio.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createMenu()

std::unique_ptr< ui::MenuWidget > morph::qt_quick::Backend::createMenu ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a command list.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createStack()

std::unique_ptr< ui::StackWidget > morph::qt_quick::Backend::createStack ( ui::ContainerWidget * parent,
ui::Axis axis )
nodiscardoverridevirtual

Makes a stack.

Parameters
parentThe container to append to, or null for a root.
axisVertical (a column) or horizontal (a row).
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createGrid()

std::unique_ptr< ui::GridWidget > morph::qt_quick::Backend::createGrid ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a grid.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createSpacer()

std::unique_ptr< ui::SpacerWidget > morph::qt_quick::Backend::createSpacer ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes empty space.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createPanel()

std::unique_ptr< ui::PanelWidget > morph::qt_quick::Backend::createPanel ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a titled frame.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createScroll()

std::unique_ptr< ui::ScrollWidget > morph::qt_quick::Backend::createScroll ( ui::ContainerWidget * parent,
ui::Axis axis )
nodiscardoverridevirtual

Makes a scroll area.

Parameters
parentThe container to append to, or null for a root.
axisThe scroll direction.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createSlot()

std::unique_ptr< ui::SlotWidget > morph::qt_quick::Backend::createSlot ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a slot.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createTabs()

std::unique_ptr< ui::TabsWidget > morph::qt_quick::Backend::createTabs ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a tab bar.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createDialog()

std::unique_ptr< ui::DialogWidget > morph::qt_quick::Backend::createDialog ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a modal overlay.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createToast()

std::unique_ptr< ui::ToastWidget > morph::qt_quick::Backend::createToast ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a transient message.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createBusy()

std::unique_ptr< ui::BusyWidget > morph::qt_quick::Backend::createBusy ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a progress indicator.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createTable()

std::unique_ptr< ui::TableWidget > morph::qt_quick::Backend::createTable ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a table.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createDateTimeInput()

std::unique_ptr< ui::DateTimeInputWidget > morph::qt_quick::Backend::createDateTimeInput ( ui::ContainerWidget * parent,
ui::DateMode mode,
int offsetMinutes )
nodiscardoverridevirtual

Makes a date or date-and-time field.

Parameters
parentThe container to append to, or null for a root.
modeDate, or date and time.
offsetMinutesThe display zone's offset from UTC.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createSlider()

std::unique_ptr< ui::SliderWidget > morph::qt_quick::Backend::createSlider ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a slider.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createFilePicker()

std::unique_ptr< ui::FilePickerWidget > morph::qt_quick::Backend::createFilePicker ( ui::ContainerWidget * parent,
ui::FilePickerMode mode )
nodiscardoverridevirtual

Makes a file path field.

Parameters
parentThe container to append to, or null for a root.
modeOpen or save.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createBanner()

std::unique_ptr< ui::BannerWidget > morph::qt_quick::Backend::createBanner ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a banner.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createBadge()

std::unique_ptr< ui::BadgeWidget > morph::qt_quick::Backend::createBadge ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a badge.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createProgress()

std::unique_ptr< ui::ProgressWidget > morph::qt_quick::Backend::createProgress ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a progress bar.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createSteps()

std::unique_ptr< ui::StepsWidget > morph::qt_quick::Backend::createSteps ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a steps indicator.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createKeyValue()

std::unique_ptr< ui::KeyValueWidget > morph::qt_quick::Backend::createKeyValue ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a key-value list.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createEmptyState()

std::unique_ptr< ui::EmptyStateWidget > morph::qt_quick::Backend::createEmptyState ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes an empty state.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createDrawer()

std::unique_ptr< ui::DrawerWidget > morph::qt_quick::Backend::createDrawer ( ui::ContainerWidget * parent,
ui::Side side )
nodiscardoverridevirtual

Makes a drawer.

Parameters
parentThe container to append to, or null for a root.
sideThe edge it slides in from.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createSplitter()

std::unique_ptr< ui::SplitterWidget > morph::qt_quick::Backend::createSplitter ( ui::ContainerWidget * parent,
ui::Axis axis )
nodiscardoverridevirtual

Makes a splitter.

Parameters
parentThe container to append to, or null for a root.
axisThe axis its panes are laid out along.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createCollapsible()

std::unique_ptr< ui::CollapsibleWidget > morph::qt_quick::Backend::createCollapsible ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a collapsible section.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.

◆ createDropZone()

std::unique_ptr< ui::DropZoneWidget > morph::qt_quick::Backend::createDropZone ( ui::ContainerWidget * parent)
nodiscardoverridevirtual

Makes a drop zone.

Parameters
parentThe container to append to, or null for a root.
Returns
The widget.

Implements morph::ui::IViewBackend.


The documentation for this class was generated from the following file: