Well if you can obviously set the [ QTCLASS ] then try to move your mouse a little bit more left to hit the # then you also can set the [ CODE ] tags!

Make the dialog a children of your mainwindow, then the translation should work.