Issue
I am learning the drag and drop part of pyqt5. Most files can know the path of the file when dragged to pyqt. However, the actual path cannot be found because the actual location of the Outlook mail exists in the .pst file. So, when dragging and dropping the Outlook mail to a specific layout in pyqt, I want to download the Outlook mail to a specific folder.
Is there a better way? Or can you give me advice?
Please Help me..!! (I've been up all night for 3 days because of this problem)
The code block in this part is empty, and I want to fill out the above.
def dragMoveEvent(self, event):
if event.mimeData().hasUrls() or event.mimeData().hasFormat("FileContents"):
event.setDropAction(Qt.CopyAction)
event.accept()
else:
event.ignore()
def dropEvent(self, event):
if event.mimeData().hasFormat("FileContents"):
event.setDropAction(Qt.CopyAction)
event.accept()
print(event.mimeData().text())
Solution
When you try to drag and drop from Outlook, Outlook correctly identifies the format as virtual files (CFSTR_FILEDESCRIPTORW) since the files do not exist directly on disk. Instead, they are contained in a PST file, OST file, or on an Exchange server.
Read more about the drag and drop operations in Outlook in the following articles:
Answered By - Eugene Astafiev
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.