2

I'm finding no way how to open a specific file format which can be opened by my Qt app automatically(when i double click the file).Please let me know how to do this. Thanks!

Ayyappa
  • 1,876
  • 1
  • 21
  • 41

1 Answers1

2

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.

Linville
  • 3,613
  • 1
  • 27
  • 41
koan
  • 3,596
  • 2
  • 25
  • 35
  • Thanks Koan! thanks for the intant reply :) you saved me... QMAKE_INFO_PLIST = MyInfo.plist -> this property of Qt is also helpful... – Ayyappa Jul 16 '11 at 10:04