DialogWindow::showModalDialog and focus?

Must be missing something here. I've got a component created in Introjucer - the 2 edit boxes have focus orders of 1 and 2. But neither is getting focus when showModalDialog is called. What is the preferred way to handle this? Thanks.

hacked in a 'fix' with a one off check in paint() to set focus to desired control. Don't understand why dialog manager is not doing this.

 

// in ::paint()
if (!m_painted && !edUsername->hasKeyboardFocus(true) && edUsername->isVisible())
    {
        //
        edUsername->grabKeyboardFocus();
        m_painted = true;
    }