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

samuel ammonius sfammonius at gmail.com
Sun Sep 11 16:45:18 CEST 2022


> I believe it is not guaranteed at all that a pointer-to-member can validly
> be exported as extern "C", nor how the this pointer is to be passed when
you
> do that.

> And the C declaration from QT_C_EXPORT expands to:
> void QPushButton_setFlat(bool);
> which does not include a this pointer anywhere, so where does the object
on
> which to call setFlat come from?

I assumed that the C++ standard said that the first parameter of a function
would be "this". Most compilers probably do it this way, but I'm not sure
if this is
part of the standard or not.

I made a mistake in my example of QPushButton_setFlat(). the parameters
should have been (QPushButton *, bool) instead of just (bool).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20220911/5b8d9911/attachment.htm>


More information about the Development mailing list