Use KXmlGuiWindow instead of QMainWindow
This should enable integrating the KTextEditor actions correctly.