qt icon indicating copy to clipboard operation
qt copied to clipboard

Fixing qtmoc not handling pointer to object in QT signal properly

Open StarAurryon opened this issue 4 years ago • 5 comments

The callback is returning the value of the pointer instead of the pointer.

In the change function definition if the value is an Object, we are transmitting the address of the object and if it is a pointer, we are transmitting directly the pointer.

However in the callback function, we do not make such distinction resulting in casting the value of the initial pointer to a pointer and using it for the function call instead of the initial pointer.

Happy to discuss if my code is not a good fit ^^.

Best regards,

Aurryon

StarAurryon avatar Jul 30 '20 22:07 StarAurryon

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


StarAurryon seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Jul 30 '20 22:07 CLAassistant

Hey

Thanks for the PR :) https://github.com/therecipe/qt/pull/1147/commits/6b046e6ee2f3468426cc247572e80c36fd071ffe looks good, and https://github.com/therecipe/qt/pull/1147/commits/959859c19a073282c70fcbd987eba5f9d8a83e51 should probably work as well, but I will need to do some testing.

Could you kindly sign the CLA? I will try to merge the changes asap.

therecipe avatar Aug 10 '20 10:08 therecipe

Hey,

#1147 is for me only a quick fix. I don't believe using math to generate random number is the best approach.

Regarding the CLA: this seems very weird to me to accept such thing. I am publishing my code also with LGPLv3 in my repo. I don't see why I should grant you the right to sub-licence my work outside of LGPLv3 as you wish. I truly understand that my patch are evident and there are no real copyright on this. But by principle I can't sign this.

Aurryon

StarAurryon avatar Aug 10 '20 17:08 StarAurryon

No problem, I respect that. I think that it's also possible to accept smaller changes without needing a signed CLA, but I would have to look into that first.

However, I looked into this and the effect of 959859c can also be archieved by saddling the horse the other way around and simplifying some of the code. And 6b046e6 might work (not sure if it works on the js/wasm target though), but it's not really better than just taking the unix time directly. So I changed the code to use the unix time and hopefully also fixed the problem for the js and wasm targets with https://github.com/therecipe/qt/commit/b44a7874e058487a22bdc2214f52b42872913c37 now.

therecipe avatar Aug 12 '20 14:08 therecipe

I merged it here: https://github.com/bluszcz/cutego/tree/develop

bluszcz avatar Jan 23 '23 14:01 bluszcz