which is the best control to have password in Qt Gui? Is there any specific widget for password? that widget should not be accessed from hackers by iterating parent and child window handles.
It is "QLineEdit with its echo mode":http://qt-project.org/doc/qt-5/qlineedit.html#echoMode-prop
I guess it is more your application which may create an information leak. The widget or the dialog with the widget can be deleted immediately after the input of the password. You can inherit the class and prepare to overwrite the password before deletion. However, the widget is not the only place where you have the password in memory. IMHO you need to worry more about this.
At the point where the attacker has "infiltrated" the system and is now able to read your process' memory, you are doomed anyway. He could as well install a keylogger. Or modify the program to show the password as plain text...