You can check which items are selected from within the dropEvent, right
before is about to move them:
class TreeWidget(QtGui.QTreeWidget):
...
def dropEvent(self, event):
print self.selectedItems()
super(TreeWidget, self).dropEvent(event)
On Fri, Nov 2, 2012 at 8:15 AM, rgkovach123 <[email protected]> wrote:
> I am working on a simple UI that contains a QTreeWidget. I want to be able
> to drag and drop elements within the Tree. I have everything working,
> except for one, small, important piece - I can't seem to catch or capture
> the Object that was moved. I need to know which Object moved so I can
> determine it's new parent and kick off some fix up functions.
>
> I've found various tidbits of information scattered around the web, but
> nothing that specifically explains how to catch the result of drop.
>
> I tried an eventFilter looking for removeChild event - this returns a
> generic QObject and not the QTreeWidgetItem. I tried a dropEvent looking
> for the source, this returned the TreeWidget itself.
>
> Any advice appreciated! Thanks!
>
> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe
>
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe