[Interest] #include <QtPlatformHeaders/QCocoaNativeContext>

Thiago Macieira thiago.macieira at intel.com
Mon May 4 03:09:07 CEST 2020


On Sunday, 3 May 2020 16:48:45 PDT Glenn Ramsey wrote:
> Qt is a cross platform C++ framework and presumably its users (who are C++
> developers and not necessarily platform experts) expect some sort of
> insulation from platform issues. In this case it is unavoidable so it would
> be a courtesy to those non-mac developers to mention in the documentation
> for
> QCocoaNativeContext that it is not a C++ header and can only be included in
> an Objective-C++ file.

And Qt does that, so long as you're using the Qt API. But you specifically 
included a "platform header" with "Cocoa" in the name. The module in question 
by its very name means it's not insulating you from the underlying API. If 
you'd included the GLX header, you'd have to deal with its very C-ish way of 
doing things.

They also mean you must be reading the documentation of the API in question. 
And if you're reading Cocoa documentation, you'll probably have seen all those 
extra brackets that make no sense in C or C++.

Why did you include this header?
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products





More information about the Interest mailing list