I have got an app which is written in Pyside. I would like to use a checkbox to my app window show always on the top.
class RemoteWindow(QtGui.QMainWindow):
"""
This is the main window for the capacitiveRemote which contains the remote
itself for controlling the boxes and shortcuts to starting scripts.
"""
def __init__(self):
super(RemoteWindow, self).__init__()
self.initUI()
This is my function
def stayOnTop(self):
if self.checkBoxTop:
self.checkBoxTop.setStyleSheet("color: green")
self.QMainWindow.setWindowFlags(QMainWindow.windowFlags() | QtCore.Qt.WindowStaysOnTopHint)
This is the checkbox
#Stay on the top Checkboxes
self.checkBoxTop = QtGui.QCheckBox('Stay on top', self)
self.checkBoxTop.setMaximumWidth(90)
self.checkBoxTop.setChecked(0)
self.checkBoxTop.clicked.connect(
lambda: self.stayOnTop(),
)
Any help would be appreciated.