CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
CaptureMoment::UI::QmlContextSetup Class Reference

Central manager for QML context setup. More...

#include <qml_context_setup.h>

Static Public Member Functions

static bool setupContext (QQmlContext *context)
 Setup complete QML context with all objects.
 
static void setSerializerController (std::unique_ptr< Serializer::SerializerController > ui_serializer_controller)
 Sets the SerializerController instance to be registered with the QML context. This must be called before setupContext.
 
static bool registerSerializerToQml (QQmlContext *context)
 Registers the SerializerController (if set) to the QML context.
 
static std::shared_ptr< Controller::ImageControllerBase > getControllerMainScene ()
 Getter for the main ImageControllerBase instance.
 
static Serializer::SerializerController * getSerializerController ()
 Getter for the UISerializerManager instance.
 

Detailed Description

Central manager for QML context setup.

Responsibilities:

  • Creates and manages core objects (controller)
  • Delegates operation model management (creation, registration, connection) to ImageControllerBase
  • Registers core objects to QML context
  • Lifetime management via shared_ptr
  • Ensures objects are correctly initialized before use

Definition at line 33 of file qml_context_setup.h.

Member Function Documentation

◆ setupContext()

bool CaptureMoment::UI::QmlContextSetup::setupContext ( QQmlContext * context)
static

Setup complete QML context with all objects.

Creates:

Registers to QML:

Parameters
contextThe QML context to setup
Returns
true if setup was successful, false otherwise.

Definition at line 23 of file qml_context_setup.cpp.

References registerSerializerToQml().

Referenced by main().

◆ setSerializerController()

void CaptureMoment::UI::QmlContextSetup::setSerializerController ( std::unique_ptr< Serializer::SerializerController > ui_serializer_controller)
static

Sets the SerializerController instance to be registered with the QML context. This must be called before setupContext.

Parameters
ui_serializer_controllerA unique pointer to the SerializerController instance.

Definition at line 112 of file qml_context_setup.cpp.

◆ registerSerializerToQml()

bool CaptureMoment::UI::QmlContextSetup::registerSerializerToQml ( QQmlContext * context)
static

Registers the SerializerController (if set) to the QML context.

Parameters
contextPointer to the QQmlContext.
Returns
true on success, false otherwise.

Definition at line 118 of file qml_context_setup.cpp.

Referenced by setupContext().

◆ getControllerMainScene()

static std::shared_ptr< Controller::ImageControllerBase > CaptureMoment::UI::QmlContextSetup::getControllerMainScene ( )
inlinestatic

Getter for the main ImageControllerBase instance.

Returns
A shared pointer to the ImageControllerBase instance.

Definition at line 67 of file qml_context_setup.h.

◆ getSerializerController()

static Serializer::SerializerController * CaptureMoment::UI::QmlContextSetup::getSerializerController ( )
inlinestatic

Getter for the UISerializerManager instance.

Returns
A pointer to the SerializerController instance.

Definition at line 73 of file qml_context_setup.h.


The documentation for this class was generated from the following files:
CaptureMoment — footer