For the drag part, you will have to implement the standard drag event, a la: http://zetcode.com/tutorials/pyqt4/dragdrop/
I don't remember off hand what the drop callback on a native maya widget will receive, but you could print the *args and see. On Thu, Mar 14, 2013 at 2:26 AM, oglop <[email protected]> wrote: > hi all , i have this qlistview in icon mode, and it shows all the icons > with QPixmap. > > and i get the following code from nathan's website: > > import sip > import maya.OpenMayaUI as apiUI > > def toQtObject(mayaName): > """ > Convert a Maya ui path to a Qt object > @param mayaName: Maya UI Path to convert (Ex: > "scriptEditorPanel1Window|TearOffPane|scriptEditorPanel1|testButton" ) > @return: PyQt representation of that object > """ > ptr = apiUI.MQtUtil.findControl(mayaName) > if ptr is None: > ptr = apiUI.MQtUtil.findLayout(mayaName) > if ptr is None: > ptr = apiUI.MQtUtil.findMenuItem(mayaName) > if ptr is not None: > return sip.wrapinstance(long(ptr), QtCore.QObject) > > and i have shelf's maya ui path > global string $gShelfTopLevel; > print $gShelfTopLevel; > $currentShelf = `tabLayout -q -st $gShelfTopLevel`; > > the question is after getting the ui name , what should i do to make the > drag and drop work ? > > ( i know how to do this in mel, by adding drag callback to source, drop > callback to destination ui) > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- 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 [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
