Hi Karl
I also looked into projectWizard.prg. What I don't understand is you enable the drag&drop in the QTreeWidget (:treeSrc):
::oUI:treeSrc:setDragEnabled( .t. )
::oUI:treeSrc:setDropIndicatorShown( .t. )
::oUI:treeSrc:setAcceptDrops( .t. )
Because QTreeWidget implements drag/drop in different wan than other QWidget(s).
Please read Qt documentation. The above code enables to accept drops and also enables
drag/drop from inside of QTreeWidgetItems.
Then you connect to the drag events in the parent QFrame (:frameSrc):
::oUI:frameSrc:setAcceptDrops( .t. )
::oUI:frameSrc:connect( QEvent_DragEnter, {|p| ::execEvent( __frameSrc_dragEnterEvent__, p ) } )
::oUI:frameSrc:connect( QEvent_DragMove , {|p| ::execEvent( __frameSrc_dragMoveEvent__ , p ) } )
::oUI:frameSrc:connect( QEvent_Drop , {|p| ::execEvent( __frameSrc_dropEvent__ , p ) } )
This does not seem logical to me. But even if I try to use the same setup (adding a parent frame to my oTree) I do not get any events?
Logical or Illogical depend upon the usage. This is perfectly logical in this context.
As told earlier, QTreeWidget does not accept drops from outside of QTreeWidget controls.
So I enabled the parent to accept the drops, which in turn populate the QTreeWidget.
For example, in above code, whenever user drags sources from explorer to this
QTreeWidget, which are accpted by its parent frame, are parsed and populated to
respective nodes, i.e., .prg under node "Prg Files", and so on.
Try to have a feel of it by playing with <Projects><New Project Wizard> opened dialog.
Do not open existing .hbp as this implementation is still work-in-progress.
Thanks for sharing your usage details.
Pritpal Bedi
PS: the drop events will be captured in the parent handellers. Parent has to be
enabled for accepting the drops.