当前位置:网站首页>【Qt5-基础篇_1】从0开始,德天老师和你一起学习——窗口简介
【Qt5-基础篇_1】从0开始,德天老师和你一起学习——窗口简介
2022-07-01 00:41:00 【德天老师】
窗口创建
理清基本逻辑,对内容进行进一步的分层解理,对代码片断进行合理的切割,不断的切割代码,才能更好的体会代码内涵。
创建初始数据
initUi(self)—
2.1—窗口标题
2.2—窗口图标
2.3—窗口大小窗口运行
from PyQt5 import QtGui, QtCore
from PyQt5.Qt import *
import sys
class Window(QWidget):
def __init__(self):
super().__init__()
self.title = 'PyQt5 Frameless Window'
self.left = 500
self.top = 200
self.width = 300
self.height = 250
self.iconName='home.png'
self.initUi()
def initUi(self):
self.setWindowTitle(self.title) #标题
self.setWindowIcon(QtGui.QIcon(self.iconName)) #图标
self.setGeometry(self.left,self.top,self.width,self.height) # 尺寸
self.show() #显示
if __name__ =='__main__':
app = QApplication([])
win = Window()
# win.show()
边栏推荐
- 解析融合学科本质的创客教育路径
- Opencv basic operation 2 realizes label2rgb and converts gray-scale images into color images
- mustache语法
- DLS-42/6-4 DC110V双位置继电器
- 【学习笔记】构造
- 【学习笔记】简单dp
- 机器人编程的培训学科类原理
- Web compatibility testing of software testing
- The liquor and tourism sector recovers, and Yaduo continues to dream of listing. How far is it from "the first share of the new accommodation economy"?
- StrictMode卡顿与泄漏检测-StrictMode原理(2)
猜你喜欢

解决IDEA:Class ‘XXX‘ not found in module ‘XXX‘

【学习笔记】构造

Locking relay ydb-100, 100V

How to do the performance pressure test of "Health Code"

Gavin's insight on the transformer live broadcast course - rasa project's actual banking financial BOT Intelligent Business Dialogue robot system startup, language understanding, dialogue decision-mak

Kongyiji's first question: how much do you know about service communication?

Typora的使用

uniapp官方组件点击item无效,解决方案

Packing and unpacking of C #

Double position relay dls-5/2 dc220v
随机推荐
Day31-t1380-2022-02-15-not answer by yourself
About vctk datasets
Web interface testing of software testing
K210 site helmet
用recyclerReview展示Banner,很简单
[LeetCode] 爬楼梯【70】
人穷志不短,穷学生也能玩转树莓派
pull_ to_ refresh
[learning notes] double + two points
Note d'étude du DC: zéro dans le chapitre officiel - - Aperçu et introduction du processus de base
分割链表[先取next再斩断链表防止断链]
For the first time in more than 20 years! CVPR best student thesis awarded to Chinese college students!
Exploring the road of steam education innovation in the Internet Era
Practical shell knowledge
使用StrictMode-StrictMode原理(1)
None of the following candidates is applicable because of a receiver type mismatch
Kongyiji's first question: how much do you know about service communication?
uniapp官方组件点击item无效,解决方案
Principes de formation de la programmation robotique
Service grid ASM year end summary: how do end users use the service grid?