Algoteka
Log in to submit your own samples!

Display an empty window

Problem by oml1111
# Tech tags Title Creator Created date
1 0
PyQt5
PyQt
2023-07-09 17:19
View all samples for this language (1 verified and 0 unverified)

Short example with QMainWindow | Python | PyQt5 PyQt |

By oml1111 |
0 likes

Renders the following empty window:
PyQt5 empty window

Code

from PyQt5.QtWidgets import QApplication, QMainWindow  
  
application = QApplication([])  
application.setApplicationName("PyQt Empty Window")  
window = QMainWindow()  
window.resize(800, 600)  
window.show()  
application.exec()

Further reading

PyQt5 tutorial - build-system.fman.io
PyQt examples 2022 - github.com

References

classes
QApplication doc.qt.io
QMainWindow doc.qt.io
functions
PyQt5.QtCore.QCoreApplication.exec_ doc.qt.io
PyQt5.QtCore.QCoreApplication.setApplicationName doc.qt.io
PyQt5.QtWidgets.QWidget.resize doc.qt.io
PyQt5.QtWidgets.QWidget.show doc.qt.io
View sample discussion (0 comments)
View problem discussion (0 comments)