Mac: using Qt to write plugins disables quit for 3rd party application
Mac: using Qt to write plugins disables quit for 3rd party application

The reason is that qt_init always installs/overwrites apple event
handlers. So if the 3rd party app had already installed an event
handler for kAEQuit, then it will be removed when the Qt plugin is
loaded. This patch checks (in the carbon case) if event handlers
already exists before installing new ones, or, in the cocoa case,
avoids installing apple event handlers if the AA_MacPluginApplication
is set. In other words, handling quit etc is seen as the responsibility
of the app, and not the plugin.

Task-number: QTBUG-8087
Reviewed-by: prasanth

igor-sfdc/qt-wk,igor-sfdc/qt-wk,igor-sfdc/qt-wk,igor-sfdc/qt-wk,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt