I think you need a negate slot and the type enum is Negate. On Mon 16. Nov 2020 at 02:24, Flower lady fancyflowerlady@users.sourceforge.net wrote: Hey folks, is there a way to support negation for my custom types, e.g., something = -my_type_instance? I have in-place subtraction implemented using the correct flags and overriding iadd in my C++ wrapper for my class, but it seems like negation is a bit different. Is there support for the negation operator using PythonQt::TypeSlots? Sent from sourceforge.net...
I looked this up, you actually need an overloaded __sub__ slot without second object, which returns a negated object. This is due to the code generator and c++, where negation and subtraction is the same -operator
Maybe qmake does not generate correct release vcxproj files for you. You could try to change the pro file to build release only. Google the qmake docs how to configure release only in a pro file. (It was like this years ago, but nowadays I thought release and debug vcxproj settings would be ok). On Fri 12. Jun 2020 at 08:56, Florian Link florianlink@users.sourceforge.net wrote: Yes, the moc required and it only generates addition cpp files that are compiled like the rest of the files. Hm, I would...
Yes, the moc required and it only generates addition cpp files that are compiled like the rest of the files. Hm, I would try to setup my installation anew, remove all tmp files, recreated vcxproj and so on, like you start on a clean machine. On Thu 11. Jun 2020 at 22:55, Flower lady fancyflowerlady@users.sourceforge.net wrote: Hi Florian, glad to hear from you! Unfortunate that you haven't run into this issue. I actually hadn't made any modifications to the MSVC solution before things stopped working....
Sorry but I really don’t know. On Thu 11. Jun 2020 at 21:04, Flower lady fancyflowerlady@users.sourceforge.net wrote: @florianlink, are you okay? You are my shining light. Release build not working Sent from sourceforge.net because you indicated interest in < https://sourceforge.net/p/pythonqt/discussion/631393/> To unsubscribe from further messages, please visit < https://sourceforge.net/auth/subscriptions/>
I mean I never had that problem before and have no idea why it happens for you. What was your last change before it stopped working? On Thu 11. Jun 2020 at 21:04, Flower lady fancyflowerlady@users.sourceforge.net wrote: @florianlink, are you okay? You are my shining light. Release build not working Sent from sourceforge.net because you indicated interest in < https://sourceforge.net/p/pythonqt/discussion/631393/> To unsubscribe from further messages, please visit < https://sourceforge.net/auth/s...
The problem is QVariant, it can only transport registered meta types. So it can transport a PyObject, a PythonQtObjectPtr and a QObject, but not a custom C++ pointer, it would take it as void* and lose type information. So you either convert it first to something that QVariant will handle, or you register its pointer as a meta type, so that QVariant does not lose the type information. On Thu 5. Mar 2020 at 04:57, Flower lady fancyflowerlady@users.sourceforge.net wrote: Hi Florian, I can confirm that...
I am the 'folks'... Well, this is not a very common use case but there are probably multiple solutions... If your CustomType was derived from QObject, you could just create a Qvariant from that pointer. But since it is a C++ only type, you need to get it through the Qvariant without losing the type information. I think you could register a CustomType POINTER meta type, probably PythonQt would then know the type by the meta type id and since it is a registered C++ class, it should know what to do....