Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
Router Class Reference

Screen navigation for the UI – the QML StackView's controller. More...

#include <router.h>

Inheritance diagram for Router:
Collaboration diagram for Router:

Public Member Functions

void changeScreen (QString name)
 Navigate to the registered screen name.
void closeScreen ()
 Close the top screen.
void manualStackPush (QString name)
 StackView-internal: push name without side effects.

Static Public Member Functions

static void loadScreens ()
 Register the app's screen set (called at boot).

Public Attributes

QString title = ""
bool homeBtnShown = true

Static Public Attributes

static QVector< Screen * > stack = QVector<Screen*>()
 The live navigation stack.
static QHash< QString, Screen * > screens = QHash<QString, Screen*>()
 The registry of named screens.

Detailed Description

Screen navigation for the UI – the QML StackView's controller.

Holds the registry of named screens and the current navigation stack. QML drives navigation through changeScreen()/closeScreen(); the Router emits signals (goHome, openModal, closeModal, ...) that the QML shell acts on. Exposed to QML as brg.router. loadScreens() registers the app's screen set at boot.

See also
Screen, Bridge.

Definition at line 73 of file router.h.

Member Function Documentation

◆ changeScreen()

void Router::changeScreen ( QString name)

Navigate to the registered screen name.

Definition at line 35 of file router.cpp.

References homeBtnShown, screens, stack, and title.

◆ closeScreen()

void Router::closeScreen ( )

Close the top screen.

Definition at line 78 of file router.cpp.

References Screen::homeBtn, homeBtnShown, Screen::modal, stack, title, and Screen::title.

◆ loadScreens()

void Router::loadScreens ( )
static

Register the app's screen set (called at boot).

Definition at line 139 of file router.cpp.

References screens.

Referenced by boot().

◆ manualStackPush()

void Router::manualStackPush ( QString name)

StackView-internal: push name without side effects.

Definition at line 114 of file router.cpp.

References homeBtnShown, screens, stack, and title.

Member Data Documentation

◆ homeBtnShown

bool Router::homeBtnShown = true
See also
homeBtnShown property.

Definition at line 99 of file router.h.

Referenced by changeScreen(), closeScreen(), and manualStackPush().

◆ screens

QHash< QString, Screen * > Router::screens = QHash<QString, Screen*>()
static

The registry of named screens.

Definition at line 104 of file router.h.

Referenced by changeScreen(), loadScreens(), and manualStackPush().

◆ stack

QVector< Screen * > Router::stack = QVector<Screen*>()
static

The live navigation stack.

Definition at line 103 of file router.h.

Referenced by changeScreen(), closeScreen(), and manualStackPush().

◆ title

QString Router::title = ""
See also
title property.

Definition at line 98 of file router.h.

Referenced by changeScreen(), closeScreen(), and manualStackPush().


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