I've used both a custom drag and drop widget implementation, and the drag
and drop teatures within a tree/list widget. However I have never used the
tree/list widget as a workaround for something suited to a custom
implementation. I've used the tree/list approach when I am actually using
the model to supply the data, and the widget as a way to represent the
data. So I can't really comment on your "trick" approach. If it works fine
and is easy to maintain and control, then I can't say its a wrong approach.
It depends on how many items you will have in the tree/list and whether you
see performance issues.

On Thu, Apr 9, 2020 at 9:38 AM vince touache <fruityfr...@gmail.com> wrote:

> hi guys,
>
>
> I'm looking at implementing a drag&drop to reorder a list of widgets in
> Qt. Turns out it's more complicated than what I expected and involves a lot
> of low-level work (
> https://stackoverflow.com/questions/18299077/dragging-a-qwidget-in-qt-5)
> Nothing crazy, but still a lot of -not obvious- code
>
> Instead, I was wondering if it wouldn't be smarter to use a QTreeWidget,
> and add my widgets as QTreeWidgetItems, and therefore benefit from the
> native QTreeWidget drag&drop mechanism.
>
> It works fine in a proof of concept, is much shorter and much more
> readable than implementing the drag&drop myself.. even works better in the
> behavior! But having it on a complete tool, in production conditions, is
> something else...
>
> Did anyone face this issue before? Which option did you go for, the brute
> force implementation, or the QTreeWidget/QListWidget trick?
>
> Thanks !
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/56569e89-0ade-4022-8372-a96e36bbb437%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/56569e89-0ade-4022-8372-a96e36bbb437%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3sne6ZzB-XXP%3DdqPBV4hp2WmJWcytfmbuqob2w_%3D_buw%40mail.gmail.com.

Reply via email to