qml: add pagePrefix propery to leaf views to statisfy PageLoader in Qt6

Qt6 raise a warning when passing an initialization value to a non-existant
property in a component. At some point we may refactor theses view to inherit
from a common base. for now we just define the property where required
This commit is contained in:
Pierre Lamot 2024-01-22 15:47:57 +01:00 committed by Steve Lhomme
parent 3e4722a08b
commit c12cb47d0a
11 changed files with 29 additions and 0 deletions

View File

@ -49,6 +49,9 @@ Widgets.StackViewExt {
// view's model
/* required */ property var model
// behave like a Page
property var pagePrefix: []
// optional, loaded when isLoading is true
property Component loadingComponent: null

View File

@ -28,6 +28,9 @@ FocusScope {
Accessible.role: Accessible.Client
Accessible.name: I18n.qtr("Home view")
//behave like a Page
property var pagePrefix: []
ColorContext {
id: theme
colorSet: ColorContext.View

View File

@ -45,6 +45,9 @@ FocusScope {
property int initialIndex: 0
property int initialAlbumIndex: 0
//behave like a page
property var pagePrefix: []
readonly property bool hasGridListMode: true
readonly property bool isSearchable: true

View File

@ -34,6 +34,8 @@ Widgets.KeyNavigableTableView {
readonly property bool isSearchable: true
property var pagePrefix: []
property alias searchPattern: rootmodel.searchPattern
property alias sortOrder: rootmodel.sortOrder
property alias sortCriteria: rootmodel.sortCriteria

View File

@ -31,6 +31,8 @@ FocusScope {
readonly property bool hasGridListMode: false
property var pagePrefix: []
property var sortModel: [
{ text: I18n.qtr("Title"), criteria: "title"},
{ text: I18n.qtr("Album"), criteria: "album_title" },

View File

@ -36,6 +36,9 @@ FocusScope {
// Properties
//behave like a Page
property var pagePrefix: []
readonly property bool hasGridListMode: false
readonly property bool isSearchable: true

View File

@ -53,6 +53,9 @@ FocusScope {
readonly property bool hasGridListMode: true
readonly property bool isSearchable: true
//behave like a Page
property var pagePrefix: []
// Aliases
property alias model: foldersSection.model

View File

@ -30,6 +30,9 @@ FocusScope {
// Properties
//behave like a Page
property var pagePrefix: []
readonly property bool hasGridListMode: false
readonly property bool isSearchable: urlListDisplay.active
&& urlListDisplay.item.isSearchable !== undefined

View File

@ -30,6 +30,8 @@ Widgets.KeyNavigableListView {
readonly property bool hasGridListMode: false
readonly property bool isSearchable: true
property var pagePrefix: []
model: ServicesDiscoveryModel {
id: discoveryModel

View File

@ -34,6 +34,8 @@ MainInterface.MainGridView {
readonly property bool hasGridListMode: false
readonly property bool isSearchable: true
property var pagePrefix: []
//signals
signal browseServiceManage(int reason)

View File

@ -37,6 +37,9 @@ FocusScope {
// Properties
//behave like a Page
property var pagePrefix: []
property bool hasEmbededVideo: MainCtx.hasEmbededVideo
readonly property int positionSliderY: controlBar.y + controlBar.sliderY