FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonprogramming/pyqt5_lesson_03.py at pythonprogramming · ppattar/pythonprogramming · GitHub
ppattar
/
pythonprogramming
Public
forked from
kenwaldek/pythonprogramming
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonprogramming
/
pyqt5_lesson_03.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (32 loc) · 1.1 KB
Breadcrumbs
pythonprogramming
/
pyqt5_lesson_03.py
Copy path
File metadata and controls
40 lines (32 loc) · 1.1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#! /usr/bin/env python3
# -*- coding:utf-8 -*-
###############################################################
# kenwaldek MIT-license
# Title: PyQt5 lesson 3 Version: 1.0
# Date: 08-01-17 Language: python3
# Description: pyqt5 gui add pushButton
# pythonprogramming.net from PyQt4 to PyQt5
###############################################################
# do something
import
sys
from
PyQt5
.
QtCore
import
QCoreApplication
from
PyQt5
.
QtGui
import
*
from
PyQt5
.
QtWidgets
import
QApplication
,
QWidget
,
QMainWindow
,
QPushButton
class
window
(
QMainWindow
):
def
__init__
(
self
):
super
(
window
,
self
).
__init__
()
self
.
setGeometry
(
50
,
50
,
500
,
300
)
self
.
setWindowTitle
(
'pyqt5 Tut'
)
# self.setWindowIcon(QIcon('pic.png'))
self
.
home
()
def
home
(
self
):
btn
=
QPushButton
(
'quit'
,
self
)
btn
.
clicked
.
connect
(
QCoreApplication
.
instance
().
quit
)
btn
.
resize
(
100
,
100
)
btn
.
move
(
100
,
100
)
self
.
show
()
def
run
():
app
=
QApplication
(
sys
.
argv
)
Gui
=
window
()
sys
.
exit
(
app
.
exec_
())
run
()
Back
|
FazBrowse Home
|
New Git URL