How can I create a borderless application in Python (windows)?

后端 未结 3 1167
無奈伤痛
無奈伤痛 2020-12-16 03:49

I would like to know how to create an application in Windows that does not have the default border; particularly the title bar with minimize, maximize, and close buttons. I\

3条回答
  •  误落风尘
    2020-12-16 04:15

    Try Using QT Designer and Python (PyQT4)

    and this code

    from TestUI import Ui_MainWindow
    class testQT4(QtGui.QMainWindow):
    
        def __init__(self, parent=None):    
    
            super(testQT4, self).__init__(parent,Qt.CustomizeWindowHint)
            self.ui = Ui_MainWindow()
    
    if __name__ == "__main__":
        app = QtGui.QApplication(sys.argv)
        myapp = testQT4()
        myapp.show()
    
        sys.exit(app.exec_())
    

    TestUI is your UI file Created by using "cmd" going into your project directory (by cd[space][your path here])

    and typing this

    pyuic4 resfile.ui -o TestUI.py
    

    above will create the TestUI.py on projects folder

    resfile.ui is the file that you made on QT Designer

    Hope this helps.

提交回复
热议问题