I have learned c++ at school but not QT so I translated the project to Java,
its still in the alpha phase. so no JTAG support yet and no save function.
it can only compile, and give you the error you have made. as a test I compiled your example code and compared the 2 outputs , the outputs were the same.
I will improve it so you could use the jtag, i might increase the number of classes to make the code more readable.
the attachment is a zip dir whit the source and a runnable jar.