lupdate and macros. using Q_OBJECT in your own macro.
-
Hi all,
I have a C/C++ project using Qt 6.5.3 and the lupdate translation tool.
For generating the .ts translation file we run the lupdate tool over the source as required.
However a lot of the files have a custom macro MY_Q_OBJECT that expands to call Q_OBJECT.However, ( as I understand it ) the lupdate tool doesn't actually look at the expanded macro and simply uses the text as is, I'm getting a number of warning messages when doing lupdate. eg.
Folder.h:23: Class 'Folder' lacks Q_OBJECT macroIs there any way to tell lupdate that my MY_Q_OBJECT is OK, and that it is equivalent to an actual Q_OBJECT for it's processing?
I've tried messing with the
-tr-function-aliasargument, but it didn't work for me?
lupdate.exe Folder.h -ts translation.ts -tr-function-alias Q_DECLARE_TR_FUNCTIONS=MY_Q_OBJECT
I think that is suppose to provide an alias for functions in the code anyway.I've also seen some suggestion that
lupdate -D"MANAGED_OBJECT=Q_OBJECT"
might work too, but that doesn't seem to work at all - I think the-Dis a moc argument not an lupdate argumentAdding custom code to each file just to remove the lupdate warning is not a viable solution.
surely there must be some way to do this?regards,
James