Skip to content

Commit 5683d36

Browse files
committed
PyQT5 Tutorial 1
Creación de ventanas en PyQT
1 parent 1451918 commit 5683d36

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

01-ventanas/icon.ico

97.3 KB
Binary file not shown.

01-ventanas/ventana.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import sys
2+
3+
from PyQt5.QtCore import QCoreApplication
4+
from PyQt5.QtGui import QIcon
5+
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton
6+
7+
8+
if __name__ == '__main__':
9+
app = QApplication(sys.argv)
10+
11+
w = QWidget()
12+
w.setWindowTitle('Ventana PyQT-5')
13+
w.setWindowIcon(QIcon('icon.ico'))
14+
15+
btn = QPushButton('Este es un Button', w)
16+
btn.setToolTip('This is a <b>QPushButton</b> widget')
17+
btn.move(150, 50)
18+
19+
btn.setIcon(QIcon('icon.ico'))
20+
btn.clicked.connect(QCoreApplication.instance().quit)
21+
22+
w.resize(1280, 720)
23+
w.show()
24+
25+
sys.exit(app.exec_())

0 commit comments

Comments
 (0)