On Tue, 26 Jan 2021, 7:26 am Benjam901, <[email protected]> wrote:
> Holy crap I got it... > > Turns out... windows requires this little addition to the beginning of any > fixed filepath in the system in order for drag and drop to work: > > *file:///*C:/Users/Ben/Music/wildchars/Venda - 1.2 [pământ].wav > > Which can be easily obtained via: *QUrl.fromLocalFile(file_path)* > > I will update the other thread with a detailed answer for whomever may be > struggling with this in the future too > Nice find! > On Friday, 15 January 2021 at 09:37:35 UTC+1 Benjam901 wrote: > >> I was thinking a little about that avenue of testing but was unsure the >> fruitfulness. I will do this with an additional Qt simple window and get >> back to you. >> >> I created a dedicated thread for this topic btw for anyone searching >> later to easily find it so I will move our conversation over there: >> https://groups.google.com/g/python_inside_maya/c/LABXVlNxZNc >> >> On Friday, 15 January 2021 at 04:57:36 UTC+1 [email protected] wrote: >> >>> 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/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 Fri, Jan 15, 2021 at 10:26 AM Benjam901 <[email protected]> wrote: >>> >>>> Hello again, >>>> >>>> So after some tinkering I still cannot get windows applications to >>>> accept drag mime data from my SqlTableModel. I have tried the following >>>> with various commented out etc.: >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> *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 >>>> >>>> Do you see the same behaviour if you implement these mine data types? >>>> >>>> // Ben >>>> >>> >>>> On Tuesday, 12 January 2021 at 14:37:52 UTC+1 Benjam901 wrote: >>>> >>>>> Its not super slow no, a few seconds only, perhaps that just has to be >>>>> the limitation for the time being... >>>>> >>>>> On Tuesday, 12 January 2021 at 10:32:56 UTC+1 [email protected] >>>>> wrote: >>>>> >>>>>> >>>>>> >>>>>> On Tue, 12 Jan 2021, 10:11 pm Benjam901, <[email protected]> >>>>>> wrote: >>>>>> >>>>>>> I will experiment with changing the mime type depending on platform >>>>>>> and see where that leads me. >>>>>> >>>>>> >>>>>> You can likely set both and the target will choose which mimetype it >>>>>> wants. >>>>>> >>>>>> >>>>>>> Packaging as a dmg did the trick. Zip for mac OS has always been a >>>>>>> bit funny. >>>>>>> >>>>>>> Some feedback I got from pyinstaller is the wait time when it >>>>>>> unpacks to opening time can be a few seconds. With no immediate console >>>>>>> or >>>>>>> logo etc. some users first thought is that it is broken. I dug around >>>>>>> and >>>>>>> it appears --windowed can not be used in conjuction with --console >>>>>>> which to >>>>>>> me strikes a bit odd. >>>>>>> >>>>>>> Do you know if there is a solution? >>>>>>> >>>>>> >>>>>> I really don't have any ideas. It's been years since I even used >>>>>> py2app. Is it slow to load on windows? I think a windows exe will need to >>>>>> decompress to a temp before launching whereas the osx app is like a >>>>>> folder >>>>>> already. >>>>>> >>>>>> I considered launching the .app/.exe through an intial much smaller >>>>>>> file that should unpack quicker (hopefully) but that it a HELL of a >>>>>>> hack to >>>>>>> get around it... >>>>>>> >>>>>>> On Monday, 11 January 2021 at 18:57:27 UTC+1 [email protected] >>>>>>> wrote: >>>>>>> >>>>>>>> On Mon, Jan 11, 2021 at 11:24 PM Benjam901 <[email protected]> >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Hello Justin, Thanks for the quick response! >>>>>>>>> >>>>>>>>> My mime data setup looks like this: >>>>>>>>> https://gist.github.com/ben-hearn-sb/038da0d75d6887205e7333147ae9f0d9 >>>>>>>>> >>>>>>>>> Windows perhaps needs something other than setUrls for its mime >>>>>>>>> type? >>>>>>>>> >>>>>>>> >>>>>>>> So that implies that your windows drop target isn't accepting >>>>>>>> "text/uri-list" mimetype. Try additionally using setText() so that >>>>>>>> there is >>>>>>>> a "text/plain" mimetype as well. The text type will likely be the last >>>>>>>> type >>>>>>>> that gets checked, but that depends on the target. >>>>>>>> >>>>>>>> >>>>>>>>> *Distribution:* >>>>>>>>> I am distributing to the closed beta list as a zip which includes >>>>>>>>> the .app file inside. Once unzipped you should be able to launch from >>>>>>>>> anywhere. Should I consider packing as a .pkg or .dmg file perhaps? I >>>>>>>>> am a >>>>>>>>> bit unfamiliar with official protocols for distributing standalone >>>>>>>>> apps on >>>>>>>>> Mac at the moment. >>>>>>>>> >>>>>>>>> Some users have no problems while others require to chmod which is >>>>>>>>> not great for a regular user who has no idea what chmod is. >>>>>>>>> >>>>>>>> >>>>>>>> I'm not really certain what the best approach should be. I never >>>>>>>> had to publicly distribute mac app files. 8 years ago when I was >>>>>>>> building >>>>>>>> app files (with py2app) I was doing it for internal distribution >>>>>>>> directly >>>>>>>> as the app. pkg or dmg is probably more likely to retain the proper >>>>>>>> execution bits since their purpose is to handle installation. There are >>>>>>>> tools on osx for bundling into dmg. >>>>>>>> You could also try compressing as .tar.gz incase the issue is that >>>>>>>> a zip archive is stripping the execution bit for some users when they >>>>>>>> decompress. >>>>>>>> >>>>>>>> >>>>>>>>> >>>>>>>>> Thanks for the manifest pointer, I will try and muddle through to >>>>>>>>> get the permissions setup correctly. Have you ever set one up before? >>>>>>>>> >>>>>>>>> // Ben >>>>>>>>> >>>>>>>>> On Monday, 11 January 2021 at 11:06:07 UTC+1 [email protected] >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Mon, 11 Jan 2021, 10:49 pm Benjam901, <[email protected]> >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> Hello! >>>>>>>>>>> >>>>>>>>>>> I have finally got my side project out for a closed beta and >>>>>>>>>>> there are some issues for some users on both Mac & Windows. >>>>>>>>>>> >>>>>>>>>>> *Drag & Drop issue:* >>>>>>>>>>> Firstly, you can drag & drop from the qsqltablemodel into an >>>>>>>>>>> external program and that works ok on Mac but Windows you simply >>>>>>>>>>> get a red >>>>>>>>>>> no entry symbol and it fails to operate as it should. Is this an app >>>>>>>>>>> permissions issue perhaps or a deeper windows bug? >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> The drag and drop system is kind of this application agnostic >>>>>>>>>> protocol so that two completely unrelated apps can act as the drag >>>>>>>>>> source >>>>>>>>>> and drop target. The drag source would indicate the mine types >>>>>>>>>> provided in >>>>>>>>>> the drag event, and the drop target has the ability to choose what it >>>>>>>>>> accepts. >>>>>>>>>> If I saw that red indicator on Mac or Linux (of which I am more >>>>>>>>>> familiar) I would assume it is because the drag source is not >>>>>>>>>> specifying a >>>>>>>>>> mine type that the drop target wants. >>>>>>>>>> >>>>>>>>>> Which leads me to my next query. >>>>>>>>>>> >>>>>>>>>>> *Permissions issues:* >>>>>>>>>>> Some users on Mac have had to chmod -x their .app files in order >>>>>>>>>>> to run, I googled and some forums say I need to include a custom >>>>>>>>>>> manifest >>>>>>>>>>> file in order to elevate the app up to a level where this is not >>>>>>>>>>> required. >>>>>>>>>>> >>>>>>>>>>> However I am unfamiliar with what a manifest file is and what it >>>>>>>>>>> should include to solve these issues? >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Maybe this is what you are after? >>>>>>>>>> >>>>>>>>>> https://support.apple.com/en-nz/guide/deployment-reference-macos/ior5df10f73a/web >>>>>>>>>> >>>>>>>>>> How are you distributing the mac app after it is built? If you >>>>>>>>>> are keeping it as just the app then maybe you are causing it to lose >>>>>>>>>> the >>>>>>>>>> execution mode if you happen to be copying it around in windows? If >>>>>>>>>> that is >>>>>>>>>> the case maybe compressing it with zip or tar.gz on the Mac and >>>>>>>>>> transferring that around would be a better idea? >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> Would this manifest elevation perhaps solve the above drag & >>>>>>>>>>> drop issue on windows too? >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> It doesn't seem like your drag and drop problem in windows is >>>>>>>>>> related to the execution mode issue of your Mac app. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> *My pyinstaller build code looks like this for Mac:* >>>>>>>>>>> https://gist.github.com/4bea2a9975455e7c7e71aedc41b8c867 >>>>>>>>>>> >>>>>>>>>>> *And like this for Windows:* >>>>>>>>>>> >>>>>>>>>>> https://gist.github.com/ben-hearn-sb/62763a3eac6cccd2c03478d913afd43c >>>>>>>>>>> >>>>>>>>>>> I am certain I am missing something crucial here. If anyone >>>>>>>>>>> could help with this it would be much appreciated! >>>>>>>>>>> >>>>>>>>>>> // 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/f8d96aaf-ce24-46f8-a679-a00a7b1503e8n%40googlegroups.com >>>>>>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/f8d96aaf-ce24-46f8-a679-a00a7b1503e8n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>>>>>> . >>>>>>>>>>> >>>>>>>>>> -- >>>>>>>>> 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/f23abfff-cb4f-4069-9130-8aac69231adfn%40googlegroups.com >>>>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/f23abfff-cb4f-4069-9130-8aac69231adfn%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>>>> . >>>>>>>>> >>>>>>>> -- >>>>>>> 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/ad1163f9-911c-4016-bc7a-b86ad9eb1311n%40googlegroups.com >>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/ad1163f9-911c-4016-bc7a-b86ad9eb1311n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>> . >>>>>>> >>>>>> -- >>>> 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/2a4b6145-fa7e-4649-a8de-66f0167212c5n%40googlegroups.com >>>> <https://groups.google.com/d/msgid/python_inside_maya/2a4b6145-fa7e-4649-a8de-66f0167212c5n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- > 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/9fc2cc97-d995-4478-82aa-52be9500c0c0n%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/9fc2cc97-d995-4478-82aa-52be9500c0c0n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAPGFgA3nTX9CyNRJOZ_jVrGCmiP1hZ_DLR2dpP4PP%2BgZ-6vMXw%40mail.gmail.com.
