[Development] Could support for C be added to Qt?

Thiago Macieira thiago.macieira at intel.com
Sat Sep 10 17:32:13 CEST 2022


On Saturday, 10 September 2022 07:05:46 PDT Karl Semich wrote:
> Qt has such a strong C++ basis that I personally might take the small
> performance hit of keeping C bindings more separate, to make merging
> forward easier.

What performance hit? You have to wrap ALL functions and none of them can be 
inline. That means the performance hit is the same for all functions, whether 
they are static members, non-static members, constructors or destructors, or 
even free functions, and whether that technique is done inside of Qt or 
outside.

I think the exercise of imagining what a C binding would look like is 
interesting, but I really don't think it's a useful use of our time. Using 
automated binding mechanisms like Shiboken for Python are interesting, but at 
least Python supports overloading; C doesn't. I don't see how a binding could 
be automated to C. It would require manual intervention for every overloaded 
function, of which there are many.

And what's the gain here? What does one gain from compiling as C, instead of 
using the C++ compiler that comes with the same suite?

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering





More information about the Development mailing list