Good Day, I am having trouble maintaining the position of the cursor on a simple login application.

A user selects to login using my interface, this opens up a QDialog window which contains two QLineEdits (username and password), and two QPushButtons (OK and cancel). The very first time this window is displayed, the cursor is present on the username line. However after logging in (either successfully or unsuccessfully) and closing the login window, upon returning to the login window the cursor will now be in position on the password line. I have verified that the cursor position upon re-entering the login window will simply be the last position that the cursor was in upon leaving the login window.

I need for the cursor to be on the username line every time this window is opened and I am having trouble getting this to occur. I feel that this will be an extremely simple thing to do, but the QT documentation on the web is not proving very useful for this.

Any help would be greatly appreciated :-)