PyQt4: stop window from focus

What I'm trying to do is make an on-screen keyboard. To do this, I need to stop the Program from focusing from other windows. Here is the code I have that holds 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: An example from the Save window at the top ) Therefore, I want to add code to stop the focus of the window.

thank

+3
source share
1 answer

Change the focus policy of the window and all its contents QWidget::setFocusPolicy

+2
source

Source: https://habr.com/ru/post/1789419/


All Articles