I am trying to give focus to a window if the user clicks on another window.
Right now i have two windows: Window A is behind, and Window B is in front. When Window B
To get window_b to always stay on top you have to add the windowflag QtCore.Qt.WindowStaysOnTopHint. In your __init__ add the call
window_b
QtCore.Qt.WindowStaysOnTopHint
__init__
self.setWindowFlags(PyQt4.QtCore.Qt.WindowStaysOnTopHint)
I have to add that this only is a hint to the windowing manager and not guaranteed to succeed.