目前笔记还不够完善,只包含连接部分,后续可能还要补充其它内容
"sip, QtGui, QtWidgets 是pyinstaller打包时必要的模块"
import sys, sip
from PyQt5.QtSql import QSqlDatabase
from PyQt5.QtCore import QCoreApplication
from PyQt5 import QtGui
from PyQt5 import QtWidgets
"""
创建一个QCoreApplication实例,有了这个实例才能加载数据库驱动
如果程序中还用到其它GUI控件,可以使用PyQt5.QtWidgets.QApplication来代替
"""
app = QCoreApplication