Skip to content

Commit 1b0d767

Browse files
authored
Update hello.py to match the article's code
Remove constants to make the code match the example in the article.
1 parent 80ae531 commit 1b0d767

File tree

1 file changed

+2
-9
lines changed
  • pyqt-calculator-tutorial/examples

1 file changed

+2
-9
lines changed

pyqt-calculator-tutorial/examples/hello.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,15 @@
55
# 1. Import QApplication, and all the required widgets
66
from PyQt6.QtWidgets import QApplication, QLabel, QWidget
77

8-
WIN_X = 100
9-
WIN_Y = 100
10-
WIDTH = 280
11-
HEIGHT = 80
12-
LABEL_X = 60
13-
LABEL_Y = 15
14-
158
# 2. Create an instance of QApplication
169
app = QApplication(sys.argv)
1710

1811
# 3. Create an instance of your application's GUI
1912
window = QWidget()
2013
window.setWindowTitle("PyQt App")
21-
window.setGeometry(WIN_X, WIN_Y, WIDTH, HEIGHT)
14+
window.setGeometry(100, 100, 280, 80)
2215
helloMsg = QLabel("<h1>Hello, World!</h1>", parent=window)
23-
helloMsg.move(LABEL_X, LABEL_Y)
16+
helloMsg.move(60, 15)
2417

2518
# 4.Show your application's GUI
2619
window.show()

0 commit comments

Comments
 (0)