Description
Hi,
If I zoom out too far, at certain zoom level, custom widgets added with add_custom_widget()
method disappear. I understand that this is normal when using QGraphicsView
in Qt. It's related to the details that can be rendered at a very small size. In such a case, some node operations, e.g. changing the layout direction, may result in an erroneous resizing. This is due to some lines in NodeItem
class definition like these:
if not widget.isVisible():
continue
These lines are present in the methods: _calc_size_horizontal()
, _calc_size_vertical()
, _align_widgets_horizontal()
and _align_widgets_vertical()
(twice).
What happens is that the widgets are not visible for certain zoom levels (very zoomed out) and, consequently, those lines of code indicate that they should not be taken into account for calculating the node size. Then, when zooming in again, the boundingRect
of the node may leave those widgets out.
For the moment, I commented those lines and everything seems to be working correctly. However, I'm not sure what side effects there may be.
NodeGraphQt version: 0.6.38
Qt.py version: 1.4.1
PyQt5 version: 5.15.10
Python version: 3.11.2
OS: Debian GNU/Linux 12 (bookworm)