| 12345678910111213 |
|
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d689de76-6699-41db-a808-8e3eca1fce5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
|
This email is free from viruses and malware because avast! Antivirus protection is active. |
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/8095ee58-77f0-4766-bd75-768b44e903c4%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/_6fvzObx1Ds/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da5rW8Dus%2BWgOSb888GHdtrHc7B9Y11WXAkkWbnENNS8RQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM2ybkWMi3wv6FK5cp06m5u2-Scu2FGkbY8SFKs0uWZ%2BVTE6zQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da5t_GdfYDfv%3DCfQUE7M3P1089HQ0hPy7FXA_p-VYp6Wew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM2ybkULYGu1cZfk8NxPyj5vB_pyK_706U7J307BrJNWxfQ9PA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da7kEx0qpZAC8xdvK-gvsqSYu823o%3DnmUKrHVjTpEiks0g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA38Hw2Tjs2cobPoicU_cdoL4HvMArJhc7dqJY2-H4ZKmw%40mail.gmail.com.
# Drag and drop setup inside the __init__ class using QtDesigner windows
self.uiMainWindow.uiNodeUnit.setDragEnabled(True)self.uiMainWindow.uiUnitTree.setDropIndicatorShown(True)self.uiMainWindow.uiUnitTree.setAcceptDrops(True)self.uiMainWindow.uiUnitTree.setDragEnabled(True)self.uiMainWindow.uiUnitTree.viewport().installEventFilter(self)
# TODO: Decode mime datadef eventFilter(self, source, event):if (event.type() == QtCore.QEvent.Drop):mimeData = event.mimeData()for mimeFormat in mimeData.formats():# we only want to attempt to decode QAbstractItem'sif mimeFormat != "application/x-qabstractitemmodeldatalist":continuedata = self.decodeMimeData(mimeData.data(mimeFormat))elif (event.type() == QtCore.QEvent.DragEnter):print "DRAGGING"return QtGui.QMainWindow.eventFilter(self, source, event)def decodeMimeData(self, mimeData):result = {}value = QtCore.QVariant()stream = QtCore.QDataStream(mimeData)while not stream.atEnd():# row and column for the datarow = stream.readInt32()col = stream.readInt32()item = result.setdefault(col, {})for role in range(stream.readInt32()):key = QtCore.Qt.ItemDataRole(stream.readInt32())stream >> valueitem[key] = value.toPyObject()return result[0][QtCore.Qt.DisplayRole]
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/8095ee58-77f0-4766-bd75-768b44e903c4%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/_6fvzObx1Ds/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da5rW8Dus%2BWgOSb888GHdtrHc7B9Y11WXAkkWbnENNS8RQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
--
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+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM2ybkWMi3wv6FK5cp06m5u2-Scu2FGkbY8SFKs0uWZ%2BVTE6zQ%40mail.gmail.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/_6fvzObx1Ds/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da5t_GdfYDfv%3DCfQUE7M3P1089HQ0hPy7FXA_p-VYp6Wew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
--
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+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM2ybkULYGu1cZfk8NxPyj5vB_pyK_706U7J307BrJNWxfQ9PA%40mail.gmail.com.
--
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+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da7kEx0qpZAC8xdvK-gvsqSYu823o%3DnmUKrHVjTpEiks0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
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+unsub...@googlegroups.com.
The QDataStream approach is very C++ centric. Also the particular mimetype you are handling in this example happens to be Qt's internal mimetype spec for communicating item drag and drops. That means the default drag and drop behavior does generate it's own mimetype protocol.
When you implement your own drag routine, either by implementing the high level mimeData or the lower level startDrag or the actual events themselves, you get to control how you want to talk between the drag source and the drop target. You can specify your own custom type, and send either plain text, or even json or pickle data. Qt happens to use its binary protocol to transmit serialized data.
Your code example happens to be decoding the builtin mimetype for internal drag and drops. It streams the data out of the mimetype in the expected order.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/8095ee58-77f0-4766-bd75-768b44e903c4%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/_6fvzObx1Ds/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da5rW8Dus%2BWgOSb888GHdtrHc7B9Y11WXAkkWbnENNS8RQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM2ybkWMi3wv6FK5cp06m5u2-Scu2FGkbY8SFKs0uWZ%2BVTE6zQ%40mail.gmail.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/_6fvzObx1Ds/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da5t_GdfYDfv%3DCfQUE7M3P1089HQ0hPy7FXA_p-VYp6Wew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM2ybkULYGu1cZfk8NxPyj5vB_pyK_706U7J307BrJNWxfQ9PA%40mail.gmail.com.
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAM33%3Da7kEx0qpZAC8xdvK-gvsqSYu823o%3DnmUKrHVjTpEiks0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA38Hw2Tjs2cobPoicU_cdoL4HvMArJhc7dqJY2-H4ZKmw%40mail.gmail.com.
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/3a0d36c9-f788-4234-9ec5-b6255a3750f2%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1euiwt-3yt5eB6UvmctLf%2ByUOcZSnc7UvMcvM%3DYjcVdA%40mail.gmail.com.