Skip to content

Instantly share code, notes, and snippets.

@glenux
Created July 3, 2019 13:00
Show Gist options
  • Save glenux/450aaff671a73c8a2435c1ff6bafc723 to your computer and use it in GitHub Desktop.
Save glenux/450aaff671a73c8a2435c1ff6bafc723 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
from PySide2.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout
from PySide2.QtGui import Qt
class HelloApplication(QApplication):
def __init__(self, args):
QApplication.__init__(self, args)
self.remplir()
self.exec_()
def remplir(self):
# Premiere fenetre
self.win1 = QWidget()
self.win1.resize(500, 250)
self.win1.move(300, 50)
self.win1.setWindowTitle("Premiere fenetre")
self.label = QLabel()
self.label.setText("Hello world")
self.label.setAlignment(Qt.AlignCenter)
# on prépare le contenu de win1
self.layout = QVBoxLayout()
self.layout.addWidget(self.label)
self.win1.setLayout(self.layout)
self.label.show()
self.win1.show()
if __name__ == "__main__":
HelloApplication(sys.argv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment