Create an executable file with own fileextension

iam developing an IDE for microcontrollers. When I create a new project in this application, a projectfile will be generated. Actually its a QSettings file with my suffix: .qtavr. (eg.: NewProject.qtavr)
In this file I save some information when closing the application.

Now I want to reopen the generated project by double clicking on this file. Therefor it should handover its stored information to the constructor of the mainWindow class.

Iam using a MacOs.
I've already told the OS to open files with this extension with the right app. But is it possible to do this automatically with for example an installer? Also it would be nice to give this file a special icon.

When I try to catch the input argument from QApplication::arguments(), I just get the path of the application back, but not the path of the file.qtavr.

QApplication::arguments() returns a QStringList. The path of the application I got with:

There are several ways to open a file, double click on the file, drag the file on the app icon in the Finder or in the Dock.
In all this cases you 'll receive a FileOpen event.
And no matter if your app is already launched or not.

Please read carefully what i wrote.
Moreover, it's clearly explain in the doc:

File open events will be sent to the QApplication::instance() when the operating system requests that a file or URL should be opened.
This is a high-level event that can be caused by different user actions depending on the user's desktop environment; for example, double clicking on an file icon in the Finder on OS X.