Reputation: 41
What I am trying to do is make an on screen keyboard. To do this I need to stop the Program from taking focus away from other windows. Here is the code I have that keeps the window on top.
import sys
from PyQt4 import QtGui, QtCore, Qt
class mymainwindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self, None, QtCore.Qt.WindowStaysOnTopHint)
app = QtGui.QApplication(sys.argv)
mywindow.show()
app.exec_()
(Note: Example from Keep Window on Top) So what I want to do is add code to stop the window taking focus.
Thanks
Upvotes: 4
Views: 865
Reputation: 13140
Change focus policy of window and all of its contents QWidget::setFocusPolicy
Upvotes: 2