2022年6月23日
摘要:
1、 self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar)self.actional1 = QAction(MainWindow) # 声明actionself.actional1.setT
阅读全文
posted @ 2022-06-23 16:31
Lionever
阅读(1098)
推荐(0)
摘要:
一、 链接数据库呈现查询结果 def cdb(self): dbconn = sqlite3.connect('./db/database.db') # 链接数据库 cursor = dbconn.cursor() #设置游标 sqlstr ='select * from people' curso
阅读全文
posted @ 2022-06-23 16:27
Lionever
阅读(1172)
推荐(0)
2022年5月12日
摘要:
'''显示二维表数据数据源medelMVC model(数据源) view(展示视图) contrller 控制层需要创建Qtableview 实例 和数据源model 然后将两者关联'''import sysfrom PyQt5.QtWidgets import *from PyQt5.QtGui
阅读全文
posted @ 2022-05-12 13:28
Lionever
阅读(375)
推荐(0)
2022年5月8日
摘要:
方法一: from PyQt5.QtWidgets import * import sys class Main(QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("主窗口") button = QPus
阅读全文
posted @ 2022-05-08 20:57
Lionever
阅读(785)
推荐(0)
摘要:
多窗口传递数据 不使用信号及槽 D116.PY import sysfrom PyQt5.QtCore import *from PyQt5.QtGui import *from PyQt5.QtWidgets import *from D11602 import Datedialogclass m
阅读全文
posted @ 2022-05-08 11:00
Lionever
阅读(238)
推荐(0)
2022年4月23日
摘要:
1、 自定义信号与槽 import sysfrom PyQt5.QtWidgets import *class ssdemo(QWidget): def __init__(self): super(ssdemo, self).__init__() self.initUI() #槽函数 def on_
阅读全文
posted @ 2022-04-23 11:48
Lionever
阅读(308)
推荐(0)
2022年4月22日
摘要:
import sysfrom PyQt5.QtWidgets import *def on_click(): print("ok1") print("widget.x()=%d" %widget.x()) #250 窗口横坐标 print("widget.y()=%d" %widget.y()) #
阅读全文
posted @ 2022-04-22 21:15
Lionever
阅读(75)
推荐(0)
2022年4月21日
摘要:
import sys#带入系统from PyQt5.QtWidgets import *class quitapp(QMainWindow): def __init__(self,parent=None): super(quitapp,self).__init__(parent) #初始化 self
阅读全文
posted @ 2022-04-21 19:49
Lionever
阅读(160)
推荐(0)
摘要:
import sys#带入系统from PyQt5.QtWidgets import *from PyQt5.QtCore import QPointclass winc(QMainWindow): def __init__(self,parent=None): super(winc,self)._
阅读全文
posted @ 2022-04-21 19:30
Lionever
阅读(883)
推荐(0)
2022年4月4日
摘要:
QT 1、将UI文件转化为PY文件 Python - m pyqt5.uic.pyuic demo.ui - o demo.py 方法二: pyuic.exe demo.ui -o demo.py C:\Users\lion\PycharmProjects\pythonProject1\venv\S
阅读全文
posted @ 2022-04-04 18:12
Lionever
阅读(36)
推荐(0)