add hello world pyqt example

This commit is contained in:
Andreas Zweili 2018-12-22 00:40:19 +01:00
parent 605c4b6f54
commit d254f9a0e1
4 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,30 @@
import sys
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import QMainWindow, QLabel, QGridLayout, QWidget
from PyQt5.QtCore import QSize
from PyQt5 import QtGui
class HelloWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
self.setMinimumSize(QSize(400, 400))
self.setWindowTitle("Hello world")
widget = QWidget(self)
self.setCentralWidget(widget)
gridLayout = QGridLayout(self)
widget.setLayout(gridLayout)
text = QLabel("Hello World für die IBZ Diplomarbeit", self)
text.setFont(QtGui.QFont('SansSerif', 20))
text.setAlignment(QtCore.Qt.AlignCenter)
gridLayout.addWidget(text, 0, 0)
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
mainWin = HelloWindow()
mainWin.show()
sys.exit(app.exec_())

View File

@ -0,0 +1 @@
pyqt5

View File

@ -0,0 +1 @@
./virtualenv/bin/python3 hello_world.py

View File

@ -0,0 +1,3 @@
python3 -m venv virtualenv
source virtualenv/bin/activate
pip3 install -r requirements.txt