*From Justin:*

*Well if you are now setting both url and text mime types, and the target 
is still rejecting the drop, the only other thing I can think of is that it 
is looking at the drop action (copy vs move vs targetmove) and still 
rejected it.*

*https://doc.qt.io/qt-5/qt.html#DropAction-enum 
<https://doc.qt.io/qt-5/qt.html#DropAction-enum>*

*https://doc.qt.io/qt-5/qabstractitemview.html#defaultDropAction-prop 
<https://doc.qt.io/qt-5/qabstractitemview.html#defaultDropAction-prop>*

*If you create your own qt window app to accept the drop and print the 
mime, does it work? Is it even your own qt target windows that dont work, 
or just some other windows apps?*

On Thursday, 14 January 2021 at 23:16:42 UTC+1 Benjam901 wrote:

> Hello all,
>
> I am starting a dedicated thread for this in case it gets solved and 
> someone comes along and finds the solution.
>
> I have an application that sets up a QSqlTableModel with filepaths and 
> names etc. On Mac OS dragging from QSqlTableModel by simply overriding 
> mimeData() works a treat but windows is another story.
>
> I have tried the following for windows with no luck:
>
>
>
>
>
>
>
> *mime_data = 
> QMimeData()mime_data.setUrls(files[0])mime_data.setText(files[0])b = 
> bytearray()b.extend(map(ord, files[0]))mime_data.setData('text/plain', 
> QByteArray(b))*
>
> Gist of my basic sqltablemodel:
> https://gist.github.com/ben-hearn-sb/61993bf1bf8aa403c6a237d56188667f
>
> Has anyone ever gotten tis behaviour to work before? I googled around and 
> someone 12 years ago solved it using pywincom (or so they claim) but I 
> cannot get his example to work, it just kills my app wholesale:
>
> https://www.qtcentre.org/threads/16097-Dragging-to-windows-(pyqt)
>
> any help would be much appreciated on this!
>
> // Ben
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/35a2dfea-4ea1-457b-a9c5-59c3ebf62251n%40googlegroups.com.

Reply via email to