QGraphicsAnchorLayout quirks and UI bugs.
-
Hello Qt Forums. I'm currently using qt in a graphics view to create different groups of buttons, that all have a different role to play
I'm using QT PySide2 In a Maya 2022 Installation on Windows.These specific questions are about the QGraphicsAnchorLayout, which is attached to a bigger widget, and then i add a list of smaller widgets onto the anchor layout. The widget is structured like this
-Anchor Layout
-- list 1 (first element is anchored to top corner of layout)
-- list 2(first element anchored to 2nd element of first list)the lists are composed of QGraphicsWidgets, and are added to as needed. each new element is anchored to the previous one.
The problems I'm having comes when you want to add / remove and update it dynamically. when I add new ones to the list on a click event, for 1-2frames you can see the widget at the top left corner of the top widget, not even the top corner of the anchor layout.
The real other problem is how to remove elements that are in the list.
If I code it like this below, it not only removes the item and the anchors of it, it removes ALL anchors below it recursively. There's no other api that's provided to delete individual anchors on the same frame, which I need to be able to do to take an item out of the layout, then immediately anchor it to a different item.buttonto_delete #assume this is the widget i want to remove for i in range(anchorlayout.count()) value = anchorlayout.itemAt(i) if value == buttonto_delete: anchorlayout.removeAt(i)even if i extend the anchor layout class, i cannot access the private list and items that it uses to create this type of layout. There's not much info about using the anchor layout like this, and even less in pyside2.
I'm wanting to use a anchor layout because i want to make each new item in the list be connected to the other items, but not straight down or left / right from each other.
How do you extend the QGraphicsAnchorLayout to be able to instantly delete items on the same frame?
And how do you make the anchor layout update itself so when things are added they do not show up in the corner for a frame, even when anchored in the exact frame they were created
(Ps: I hate the fact that the QGraphicsAnchor class has no way to change which item its anchored to or from)
Thanks for any help.