question

Kevin Windrem avatar image
Kevin Windrem asked

Bug: Hiding GUI objects not working

This appears to be a bug:

v3.00~14 requires a QML code change from using the show: property to the visible: property. This appears be true only for items inside VisualItemModel or VisibleItemModel.

This change breaks cycling through objects with the cursor hard buttons (or arrow buttons on a keyboard). All goes well until an object that is not visible is reached, then all controls lock up.

If I go back to Venus OS 2.92 and replace visible: with show: everything works fine.

I tried switching to VisibleItemModel but the same lockup occurs.

I added the enable: property to each object equal to visible and this prevents lockups but the invisible items are not skipped in the cycle through parameters. In previous OS versions, the objects with show: false are skipped.

The example I'm currently playing with is in Setup Helper's PageSettingsPackageEdit.qml but there are other places where I'm seeing the lockup.

The show: parameter is working in qml code Victron has included in the v3.00~14 release but not in my qml code.

I'm using PageSettings.qml as a reference and am nesting objects in the same way:

                    
  1. MbPage {
  2.   model: VisualItemModel {
  3.     MbSubmenu {
  4.       show: blah ....

with this structure, the objects do not hide and I am not receiving an error message.

As mentioned above I've tried other things such as replacing show: with visible: and using VisibleItemModel but these have other issues.

@Jeroen @mvader (Victron Energy) Is this a bug? If not what is the correct mechanism?


Venus OS
2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

jeroen avatar image jeroen ā™¦ commented Ā·

Thanks for making it a question. For sure you want to have a VisibleItemModel there, not an VisualItemModel. Can you make a simple project which shows the problem you are experiencing?

0 Likes 0 Ā·
Kevin Windrem avatar image Kevin Windrem jeroen ā™¦ commented Ā·
@Jeroen, what would you like in terms of a "project"? I can provide a GitHub test version of my SetupHelper where I'm seeing the problem. Or I can provide a code snippet as text here.


Thanks.

0 Likes 0 Ā·
1 Answer
Kevin Windrem avatar image
Kevin Windrem answered Ā·

I have reworked my code and got things working.

What I discovered:

MbRowSmall, MbTextBlock and Text objects do not support the 'show' parameter. (There may be other object types but those were the ones I used that caused issues.) These objects did support show prior to v3.00~14.

Up/Down arrow cycling does not skip Text objects on the page inside VisibleItemModel. These were skipped inside VisualItemModel prior to v3.00~14. I have not found a workaround for this in v3.00~14!

The visible parameter for objects inside a VisibleItemModel causes Up/Down arrow cycling to hang.

The 'show' parameter for objects inside a VisualItemModel do not hide the item in v3.00~14 as they did in previous Venus OS versions. This is a known issue, just making readers aware.

SetupHelper v4.32 incorporates these changes and available for upgrade and/or testing:

https://github.com/kwindrem/SetupHelper

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources