Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VisibleItemModel #1845

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,8 @@ list(APPEND TRANSLATION_SOURCES ${VENUS_QML_MODULE_SOURCES})
list(APPEND VenusQMLModule_CPP_SOURCES
src/aggregatedevicemodel.h
src/aggregatedevicemodel.cpp
src/visibleitemmodel.h
src/visibleitemmodel.cpp
src/basedevicemodel.h
src/basedevicemodel.cpp
src/theme.h
Expand Down
6 changes: 3 additions & 3 deletions components/PageGensetModel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import QtQuick
import Victron.VenusOS

ObjectModel {
VisibleItemModel {
id: root

property string bindPrefix
Expand Down Expand Up @@ -226,7 +226,7 @@ ObjectModel {

Page {
GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListQuantity {
//% "Speed"
text: qsTrId("ac-in-genset_speed")
Expand Down Expand Up @@ -345,7 +345,7 @@ ObjectModel {

Page {
GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListSpinBox {
//% "Charge voltage"
text: qsTrId("genset_charge_voltage")
Expand Down
2 changes: 1 addition & 1 deletion components/listitems/ListChargeSchedule.qml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ ListNavigation {
id: scheduledOptionsPage

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListSwitch {
id: itemEnabled

Expand Down
2 changes: 1 addition & 1 deletion pages/ControlCardsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Page {
maximumFlickVelocity: Theme.geometry_flickable_maximumFlickVelocity
flickDeceleration: Theme.geometry_flickable_flickDeceleration

model: ObjectModel {
model: VisibleItemModel {
Loader {
active: systemType.value === "ESS" || systemType.value === "Hub-4"
width: active ? root.cardWidth : -cardsView.spacing
Expand Down
2 changes: 1 addition & 1 deletion pages/SettingsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SwipeViewPage {
id: settingsListView

clip: true
model: ObjectModel {
model: VisibleItemModel {
SettingsListNavigation {
text: CommonWords.devices
//% "All connected devices"
Expand Down
2 changes: 1 addition & 1 deletion pages/evcs/EvChargerPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Page {
title: evCharger.name

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListItemBackground {
height: phaseTable.y + phaseTable.height

Expand Down
2 changes: 1 addition & 1 deletion pages/evcs/EvChargerSetupPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Page {
required property string bindPrefix

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListEvChargerPositionRadioButtonGroup {
dataItem.uid: root.bindPrefix + "/Position"
}
Expand Down
2 changes: 1 addition & 1 deletion pages/invertercharger/OverviewInverterChargerPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Page {
}

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListItem {
id: modeListButton

Expand Down
2 changes: 1 addition & 1 deletion pages/settings/GeneratorCondition.qml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ListNavigation {

GradientListView {

model: ObjectModel {
model: VisibleItemModel {

ListSwitch {
text: root.enableDescription
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageCanbusStatus.qml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Page {
}

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListTextGroup {
id: stateGroup

Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageDeviceInfo.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Page {
GradientListView {
id: settingsListView

model: ObjectModel {
model: VisibleItemModel {
ListText {
//% "Connection"
text: qsTrId("settings_deviceinfo_connection")
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageGenerator.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Page {
}
}

ObjectModel {
VisibleItemModel {
id: startStopModel

ListSwitch {
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageGeneratorAcLoad.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Page {

GradientListView {

model: ObjectModel {
model: VisibleItemModel {

ListSwitch {
id: enableSwitch
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageGeneratorConditions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Page {
GradientListView {
id: settingsListView

model: ObjectModel {
model: VisibleItemModel {

ListRadioButtonGroup {
id: monitorService
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageGeneratorRuntimeService.qml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Page {
GradientListView {
id: settingsListView

model: ObjectModel {
model: VisibleItemModel {

ListText {
//% "Total run time"
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageGeneratorTestRun.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Page {

GradientListView {

model: ObjectModel {
model: VisibleItemModel {

ListSwitch {
id: enableSwitch
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageGps.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Page {
}

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListText {
text: CommonWords.status
secondaryText: {
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageHub4Debug.qml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Page {
}

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListSpinBox {
id: gridSetpoint

Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageRelayGenerator.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PageGenerator {

model: !relayFunction.isValid || relayFunction.value === 1 ? startStopModel : disabledModel

ObjectModel {
VisibleItemModel {
id: disabledModel

ListItem {
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsAcSystem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Page {
}

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListRadioButtonGroup {
id: acInput1

Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsAccessAndSecurity.qml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Page {
id: settingsListView

boundsBehavior: Flickable.DragOverBounds
model: ObjectModel {
model: VisibleItemModel {
ListRadioButtonGroup {
//% "Access level"
text: qsTrId("settings_access_level")
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsAlarmsAndFeedback.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Page {
GradientListView {
id: settingsListView

model: ObjectModel {
model: VisibleItemModel {
ListSwitch {
//% "Audible alarm"
text: qsTrId("settings_audible_alarm")
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsBatteries.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Page {
title: CommonWords.batteries

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListRadioButtonGroup {
id: batteryMonitorRadioButtons

Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsBatteryMeasurements.qml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Page {

Page {
GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListText {
text: root._visibleText
//% "Active battery monitor"
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsBleSensors.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Page {
}

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListSwitch {
id: enable
text: CommonWords.enable
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsBluetooth.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Page {

GradientListView {

model: ObjectModel {
model: VisibleItemModel {

ListSwitch {
id: bluetoothEnabled
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsCGwacs.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Page {
}

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListRadioButtonGroup {
text: CommonWords.ac_input_role
optionModel: Global.acInputs.roles.map(function(role) {
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsCanbus.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Page {
}

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListRadioButtonGroup {
//% "CAN-bus profile"
text: qsTrId("settings_canbus_profile")
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsConnectivity.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Page {
GradientListView {
id: settingsListView

model: ObjectModel {
model: VisibleItemModel {
ListNavigation {
//% "Ethernet"
text: qsTrId("pagesettingsconnectivity_ethernet")
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsDisplayAndAppearance.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Page {
GradientListView {
id: settingsListView

model: ObjectModel {
model: VisibleItemModel {

ListSwitch {
id: autoBrightness
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsDisplayMinMax.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Page {
id: root

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListSwitch {
//: Whether to adjust the min/max values in the range dynamically, based on the lowest and highest values observed on the system.
//% "Auto-ranging"
Expand Down
4 changes: 2 additions & 2 deletions pages/settings/PageSettingsDisplayStartPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Page {
}

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListNavigation {
id: startPageNavigation
//% "Start page"
Expand Down Expand Up @@ -99,7 +99,7 @@ Page {

Page {
GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListSwitch {
id: startPageMode
text: CommonWords.auto
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsDisplayUnits.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Page {
GradientListView {
id: settingsListView

model: ObjectModel {
model: VisibleItemModel {
ListRadioButtonGroup {
text: CommonWords.temperature
optionModel: [
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsDvcc.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Page {
GradientListView {
id: dvccSettings

model: ObjectModel {
model: VisibleItemModel {
PrimaryListLabel {
//% "<b>CAUTION:</b> Read the manual before adjusting."
text: qsTrId("settings_dvcc_instructions")
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsDynamicEss.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Page {
id: root

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListRadioButtonGroup {
id: dEssMode
text: CommonWords.mode
Expand Down
4 changes: 2 additions & 2 deletions pages/settings/PageSettingsEthernet.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Page {
model: networkServices.ready ? connectedModel : disconnectedModel
}

ObjectModel {
VisibleItemModel {
id: disconnectedModel

ListText {
Expand All @@ -27,7 +27,7 @@ Page {
}
}

ObjectModel {
VisibleItemModel {
id: connectedModel

ListText {
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsFirmware.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Page {
GradientListView {
id: settingsListView

model: ObjectModel {
model: VisibleItemModel {

ListText {
id: remotePort
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsFirmwareOffline.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Page {
GradientListView {
id: settingsListView

model: ObjectModel {
model: VisibleItemModel {

ListFirmwareCheckButton {
//% "Check for updates on SD/USB"
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsFirmwareOnline.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Page {
GradientListView {
id: settingsListView

model: ObjectModel {
model: VisibleItemModel {

ListRadioButtonGroup {
//% "Auto update"
Expand Down
2 changes: 1 addition & 1 deletion pages/settings/PageSettingsFronius.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Page {
}

GradientListView {
model: ObjectModel {
model: VisibleItemModel {
ListNavigation {
//% "Inverters"
text: qsTrId("page_settings_fronius_inverters")
Expand Down
Loading
Loading