mirror of
https://github.com/kusti8/proton-native.git
synced 2026-05-15 14:15:50 -06:00
Make python hello-world example comparable to proton example (#40)
This commit is contained in:
parent
c6bea3916c
commit
0e49b9c904
1 changed files with 9 additions and 27 deletions
|
|
@ -1,33 +1,15 @@
|
|||
import sys
|
||||
from PyQt5.QtWidgets import (QWidget, QToolTip,
|
||||
QPushButton, QApplication)
|
||||
from PyQt5.QtGui import QFont
|
||||
from PyQt5 import QtWidgets
|
||||
|
||||
|
||||
class Example(QWidget):
|
||||
|
||||
class Example(QtWidgets.QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.initUI()
|
||||
|
||||
def print_hello(self):
|
||||
print("Hello")
|
||||
|
||||
|
||||
def initUI(self):
|
||||
btn = QPushButton('Button', self)
|
||||
btn.clicked.connect(self.print_hello)
|
||||
btn.resize(btn.sizeHint())
|
||||
btn.move(50, 50)
|
||||
|
||||
btn = QtWidgets.QPushButton('Button', self)
|
||||
btn.clicked.connect(lambda: print('hello'))
|
||||
self.setGeometry(300, 300, 300, 200)
|
||||
self.setWindowTitle('Example')
|
||||
self.setWindowTitle('Example')
|
||||
self.show()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
ex = Example()
|
||||
sys.exit(app.exec_())
|
||||
|
||||
app = QtWidgets.QApplication([])
|
||||
ex = Example()
|
||||
sys.exit(app.exec_())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue