QApplication and NSApplication
-
Welcome to the forum.
QApplication doesn't derive from
NSApplication(even if it made sense, it can't - C++ classes can't inherit from Objective-C classes).Qt is cross platform, and to achieve that it has an internal layer called QPA (Qt Platform Abstraction) that isolates the native windowing APIs behind a plugin interface.
On macOS, there is a Cocoa / AppKit based QPA plugin in use, which manages the global
NSApplicationbehind the scenes, and links its event loop to Qt event handling. It does so by (among other things) attaching its own application delegate.QApplication::execusually indirectly causes therunmessage to be dispatched toNSApp.NSApplicationMainis bypassed as it is irrelevant - Qt applications are by definition nibless. You shouldn't call it yourself.Hopefully this answers the question.
-
M MrZnuk has marked this topic as solved on