Today I fixed a bug that has been open for more than 4 years. This feels good. However, there is a reason why it took so long: kdialog contains a member winId() as you can see here, but this is not documented in our api documentation. KDE's api documentation has a list "This is the complete list of members for KDialog, including all inherited members." where winId() is missing although it is inherited from QT!
I suspect the problem is that winId() is inherited from QT and not from KDE, however, this is something for you to be aware of: The API documentation might be incomplete.