bidirectional property binding
-
I have a widget that should only be visible when some other widget is visible. In GTK you would bind the two widget's visible property bidirectionally and it would do the job.
When one of the widgets is hidden both will be hidden and vice versa.
https://gtk-rs.org/gtk4-rs/stable/latest/book/g_object_properties.htmlHow do I achieve this in Qt?
-
There seems to be documentation about this but it looks very convoluted and it does not work for existing properties? https://doc.qt.io/qt-6/bindableproperties.html
-
Hi,
One way to implement what you want is to create a simple event filter and check for QShowEvent and QHideEvent for the widgets of interest and change the visible property of the other widgets accordingly.
-