-1

In pyqt4, I can use setWindowFlags(Qt.SplashScreen) so the window have no title bar.

And use setWindowFlags(Qt.WindowStaysOnTopHint) to make window always stays on top.

But what if I want them both? No title bar and stays on top at the same time.

Is there a way to achieve that...?

dexter182
  • 13
  • 3

1 Answers1

2

Whenever you want to apply multiple flags, you should use the | operator, which is the binary or operator. This will allow multiple flags as @ekhumoro said, so a simple example would be:

from PyQt4.QtCore import *
from PyQt4.QtGui import *
import sys

class MyWindow(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        self.resize(640,480)
        self.setWindowFlags(Qt.SplashScreen | Qt.WindowStaysOnTopHint)

if __name__=="__main__":
    app=QApplication(sys.argv)
    win=MyWindow()
    win.show()
    sys.exit(app.exec_())
IronManMark20
  • 1,298
  • 12
  • 28