Skip to content
Snippets Groups Projects
Commit e20f0f11 authored by Pierre Lamot's avatar Pierre Lamot Committed by Hugo Beauzée-Luyssen
Browse files

qml: add gard property to the page model

This allows to set conditions that should be met before being allowed to load
a page
parent 78dfb346
No related branches found
No related tags found
1 merge request!607qml: improve navigation history
......@@ -79,6 +79,10 @@ StackView {
{
var model = viewModel[tab]
if (model.name === view) {
if (model.guard !== undefined && typeof model.guard === "function" && !model.guard(viewProperties)) {
continue //we're not allowed to load this page
}
//we can't use push(url, properties) as Qt interprets viewProperties
//as a second component to load
var component = undefined
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment