Logo FluentUI

PageRouter QML Type

A route-to-component mapping registry. More...

Import Statement: import FluentUI.Controls 1.0

Properties

Methods

Detailed Description

PageRouter manages the association between route URLs and their corresponding QML components. It provides registration and resolution of routes, enabling declarative navigation where page URLs are mapped to component types.

Usage Example

 import QtQuick
 import FluentUI.Controls

 PageRouter {
     routes: {
         "home": "qrc:/page/HomePage.qml",
         "settings": "qrc:/page/SettingsPage.qml"
     }
 }

Property Documentation

routes : var

A dictionary mapping route path strings to their component URLs or Component types.

Method Documentation

void register(string route, var component)

Registers a component for the given route path. The component can be a URL string or a Component object.

var resolve(string route)

Resolves a route path to its registered component. Returns the Component or URL associated with the route, or null if not found.