New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headers use 'slots' keyword which conflict with QT code. #19405
Comments
I think the workaround here is to compile QT with To be honest, I'm reluctant to change JIT code just because QT has bad macro hygiene. It seems quite difficult to maintain (they have also reserved |
Seems like a bad workaround as generally Qt code is written to use slots rather than Q_SLOTS. |
it is sad that QT resorted to this, and it's too much of a burden on userland to understand and regex. |
@xsacha Do you really need to recompile Qt though? For
source: https://www.boost.org/doc/libs/1_65_1/doc/html/signals/s04.html#idp523098912 Also in Qt, |
Ah I see. So it wouldn't need a recompile but still needs a text replacement. Not so bad. |
@xsacha if you don't want to do the text replacement, something like:
is apparently what the QT documentation recommends. I'll put up a PR to remove |
That's a pretty good work around I guess, I'll try it out. |
Okay, I'm going to close this out for now since it seems like we have a decent workaround. If others face this issue/feel strongly like the workaround is bad, feel free to reopen and we can discuss. |
馃悰 Bug
Many projects use QT for UI, but when compiling such code a special keyword "slots" is defined, which conflicts with the 'slots' function defined in IValue. Since IValue.h ends up being included when including Torch headers, this prevents using Torch in any code that also does QT stuff.
Even though this is not the fault of Torch, since QT is a popular cross-platform GUI library, it would probably be great for usability if that function is somehow renamed or some other smart trick is used.
To Reproduce
Steps to reproduce the behavior:
Tested with current Torch master.
The text was updated successfully, but these errors were encountered: