I’m trying to use the sidesheet in the new M3 theme.
I create a form based on the NavigationRailLayout, mark it as a layout and add some navigation links to the Rail. (Let’s call that ‘Main’).
I create another form that uses my new layout.
How do I toggle the sidesheet? Although the NavigationRailLayout has show_sidesheet
attribute, my Main
form does not.
What’s the intended pattern here?
Clone link:
All you need to do is go up the layout change one more time:
self.layout.layout.show_sidesheet = not self.layout.layout.show_sidesheet
in the button’s click handler.
yeah, I’d wondered about putting a property on my Main form that gets and sets the parent property.
I just wondered if I was missing something slightly nicer!
1 Like
I suppose what seems odd is that, in the designer, my Main form appears to have that property - I can see it in the properties tab and I can set its value.
I just can’t do the same via code.
Interesting, that’s odd.
I think that this basically falls under this feature request:
I think it would be nice if , when creating a form using a layout, the form inherits that layout , similar to how forms generate and inherits their templates.
This would make behavior like raising an event on the form , described here : Layout Close Button , would be smooth.
As @duncan_richards12 suggests, the correct approach here is to reference self.layout.layout.show_sidesheet
. We’ll investigate why that is showing up in the properties of your derived layout!
1 Like
OK. Thanks both. At least I know I’m not missing something blindingly obvious!
stucork
Split this topic
October 31, 2024, 5:51am
8