Quantcast
Channel: User koan - Stack Overflow
Viewing all articles
Browse latest Browse all 40

Answer by koan for How to open a particular file with my QT application on Mac when i double click the file?

$
0
0

You need to set up your Information Property List file (Info.plist) in your application bundle to identify files that can be opened by your app. See http://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Introduction/Introduction.html

Specifically, set the CFBundleDocumentTypes key: add items, the file extension and the role of your application (does it edit, view, etc the file).

After you have done this, finder will need to reload the plist. Then you will be able to choose to open files of that type with your application.

In your application, you will need to subclass QApplication and set up a response for QEvent::FileOpen. More information on doing that was given in Qt Quarterly Issue 18.


Viewing all articles
Browse latest Browse all 40

Latest Images

Trending Articles





Latest Images