[Interest] Qt 5 and Mac App Store

Daniel Price daniel.price at fxhome.com
Fri Oct 19 17:01:54 CEST 2012

> (I for my part have still Snow Leopard on my work iMac - Mountain Lion is just for toying around on the MacBook Pro. However to be fair Apple corrected many issues they completely did wrong in their "Vista"
release of Lion: it is almost as good as Snow Leopard again ;) But I am getting OT a bit... )

I recently upgraded to ML (skipped Lion completely) and I really like it. Liking Lion to 'Vista' is a massive exaggeration however. Yes it was underwhelming, but it wasn't anywhere near *that* bad.

> Nothing. Plain and simple. (I am not sure to what APIs you are actually referring to, but let's just assume they existed).

I was referring to the security-scoped URLs.

>I disagree here: you *don't* want *every* file you ever open via QFile to be security-scoped! Just like you wouldn't place every file the process ever opens (config files, temp files, cache, ...) into the user's Recent Files menu either.

Ok I'll provide some examples. The app I was trying to get into the MAS had a completely custom File menu (which was really a widget with a listbox - think of the old MS Office menu). There were no QMenu's involved. The app didn't even have anything in the menu bar. All custom. So a pre-rolled 'recent file' menu like you get in typical Cocoa app .nib file wouldn't have helped.

This same app had the ability to import and export images to disk, using default paths (or ones that had been changed and saved in its preferences). They would all need to be security-scoped.

Another example: QtCreator's Recent Project list, or Recent Session list, or example project list...you get the idea. None of these use powerbox so all would have to use security-scoped URLs in order to access those locations between sessions should Creator ever hope to be accepted into the AppStore (not that I'm saying they should bother).

Apple have been too draconian about this. Even their own Core Data based Cocoa applications cannot be sandboxed.

> A flag when opening a file which would let you control whether to "security-scope" a given file path (read/write/security scoped) of QFile would maybe be okay. But then again you would reflect a very specific API - which currently only exists on OS X AFAIK - in a cross-platform API. It is not unprecedented, there are already flags in the Qt API which are very platform-specific... just saying.

The Genie was let out of the box long ago. That's just the nature of cross-platform development, it gets hacky. Take a look at all the mac-specific WA_ flags in Qt. They have no effect on other platforms so it's not like you have to #ifdef everything.

> However I wouldn't know why you wanted to "security-scope" a given file if the intention was *not* to place it into the Recent Files menu, too - I currently just don't see any other use case than the "Recent Files". So why not come up with a QRecentFileMenu (which would be a welcomed class anyway) which would transparently handle the appropriate platform-specific APIs for us (i.e. be "sandbox-aware")?

See my examples. It's not just recent files. It's ANY file (read or write) that user didn't select via a native choose-file dialog in that sessions of the application.

This email is confidential. It may also be privileged or otherwise protected by work product immunity or other legal rules. Errors and Omissions Excluded. If you are not the intended recipient please notify the sender. Please delete the message from all places in your computer where it is stored. You should not copy the email or use it for any purpose or disclose its contents to any other person. To do so may be unlawful. Email is an informal means of communicating and may be subject to data corruption accidentally or deliberately. For this reason it is inappropriate to rely on advice contained in an email without obtaining written confirmation of it first.

FXhome Limited is a limited company registered in England and Wales. Registered number: 04172812. Registered office: Suite 4 St Giles House, 27 St Giles Street, Norwich, Norfolk, NR2 1JN, U.K.

More information about the Interest mailing list