开发者

PyQt4: Stop Window from taking Focus

W开发者_C百科hat 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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜