def set_focus(control):
    if control.focusPolicy() != QtCore.Qt.NoFocus:
        control.setFocus()
    else:
        widget = control.focusWidget()
        if widget:
            widget.setFocus()
        else:
            flags = control.windowFlags()
            control.setWindowFlags(flags | QtCore.Qt.SubWindow)
            try:
                control.focusNextChild()
            finally:
                control.setWindowFlags(flags)
Returns what number the user is in the request queue.
dataset/ETHPy150Open enthought/pyface/pyface/ui/qt4/tasks/util.py/set_focus--crossover with--dataset/ETHPy150Open andrewgodwin/lastgraph/lastgui/views.py/ajax_user_queuepos