You apparently are logged in as user, then did su to root and tried to run a graphical application as root, from the command line.
The correct procedure. As user, issue the command: xhost +localhost. Then su to root. Then run kdialog.
When you're done, exit to user prompt, then run: xhost -localhost.