[Interest] QWindow::fromWinId - argument type on platform OS X

deDietrich Gabriel Gabriel.deDietrich at digia.com
Wed Jan 8 13:17:44 CET 2014


On Jan 7, 2014, at 10:26 PM, Roland Winklmeier <roland.m.winklmeier at gmail.com> wrote:

> Hi all,
> 
> I have a quick question about the usage of the static method QWindow::fromWinId. What exactly do I have to pass to the application to make it work? I figured it already out for windows and linux/xcb, but I'm puzzled about OS X.
> My first guess was it is the cocoa window ID, but passing it made the application crash immediatly. After that I had a look into the cocoa QPA plugin and it casts the WId to a NSView pointer. The guys in #macdev said this will probably never work.
> 
> So can anybody explain me, how this is working on OS X?


Hi Roland,

WId is NSView* in the Cocoa QPA world. This is what QCocoaWindow::winId() returns when called by QWindow::winId().

That means that, on Mac, we use NSView as the native window class, including for top-level windows.

Best regards,

Dr. Gabriel de Dietrich
Senior Software Developer
qt.digia.com





More information about the Interest mailing list