1

I am making an Qt Application. And I have 2 problems that kind hard for me to figure out :

  1. I create my own file type for my application document, so let say "something.ap". I want my OSes (Windows and Mac, maybe linux), when double click those file on file explorer, it will open using my application. How to implement this on Qt in easy way? On Windows I saw we need to edit the registry, but if there is a good way that will be best thing. And I don't have idea on Mac and Linux.
  2. Related to number one. When I already open my "something.ap", and then I double click the same file ("something.ap"), I won't my application open again on new instance. So the behavior I want is to check if already file opened, it will raise the window of the application. I saw there is QtSingleApplication, but when I check the repository on gitorous can not be access.

Thank you for any help, and sorry if you can't understand my English.

jpo38
  • 20,821
  • 10
  • 70
  • 151
Apin
  • 2,558
  • 2
  • 21
  • 36
  • An alternative to QtSingleApplication is this: [SingleApplication](https://github.com/itay-grudev/SingleApplication) which works really well with Qt 5. – Itay Grudev Jul 15 '16 at 11:01

1 Answers1

1
  1. You need to register mime type. check this

  2. Singleton application is available here. It's not maintained any more :P. You can download source as zip or clone the git repository.

Community
  • 1
  • 1
sanjay
  • 735
  • 1
  • 5
  • 23
  • What about mime type on Windows and Mac? – Apin Jan 04 '16 at 09:27
  • @APin i don't have idea about windows. this might help you https://msdn.microsoft.com/en-us/library/windows/desktop/hh127451%28v=vs.85%29.aspx . – sanjay Jan 04 '16 at 09:31
  • Btw, thank you for your help. It really help me especially on number 2. I was googling to find the QtSingleApplication repository, but you point me. It save me alot. Thanks again – Apin Jan 04 '16 at 09:34