mirror of
https://github.com/LC044/WeChatMsg
synced 2024-11-14 05:21:41 +08:00
优化加载页面
This commit is contained in:
parent
d848a80b32
commit
efe314d5e6
288
TEST.py
288
TEST.py
@ -1,263 +1,29 @@
|
||||
from pyecharts import options as opts
|
||||
from pyecharts.charts import WordCloud
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
import time
|
||||
|
||||
words = [
|
||||
("花鸟市场", 1446),
|
||||
("汽车", 928),
|
||||
("视频", 906),
|
||||
("电视", 825),
|
||||
("Lover Boy 88", 514),
|
||||
("动漫", 486),
|
||||
("音乐", 53),
|
||||
("直播", 163),
|
||||
("广播电台", 86),
|
||||
("戏曲曲艺", 17),
|
||||
("演出票务", 6),
|
||||
("给陌生的你听", 1),
|
||||
("资讯", 1437),
|
||||
("商业财经", 422),
|
||||
("娱乐八卦", 353),
|
||||
("军事", 331),
|
||||
("科技资讯", 313),
|
||||
("社会时政", 307),
|
||||
("时尚", 43),
|
||||
("网络奇闻", 15),
|
||||
("旅游出行", 438),
|
||||
("景点类型", 957),
|
||||
("国内游", 927),
|
||||
("远途出行方式", 908),
|
||||
("酒店", 693),
|
||||
("关注景点", 611),
|
||||
("旅游网站偏好", 512),
|
||||
("出国游", 382),
|
||||
("交通票务", 312),
|
||||
("旅游方式", 187),
|
||||
("旅游主题", 163),
|
||||
("港澳台", 104),
|
||||
("本地周边游", 3),
|
||||
("小卖家", 1331),
|
||||
("全日制学校", 941),
|
||||
("基础教育科目", 585),
|
||||
("考试培训", 473),
|
||||
("语言学习", 358),
|
||||
("留学", 246),
|
||||
("K12课程培训", 207),
|
||||
("艺术培训", 194),
|
||||
("技能培训", 104),
|
||||
("IT培训", 87),
|
||||
("高等教育专业", 63),
|
||||
("家教", 48),
|
||||
("体育培训", 23),
|
||||
("职场培训", 5),
|
||||
("金融财经", 1328),
|
||||
("银行", 765),
|
||||
("股票", 452),
|
||||
("保险", 415),
|
||||
("贷款", 253),
|
||||
("基金", 211),
|
||||
("信用卡", 180),
|
||||
("外汇", 138),
|
||||
("P2P", 116),
|
||||
("贵金属", 98),
|
||||
("债券", 93),
|
||||
("网络理财", 92),
|
||||
("信托", 90),
|
||||
("征信", 76),
|
||||
("期货", 76),
|
||||
("公积金", 40),
|
||||
("银行理财", 36),
|
||||
("银行业务", 30),
|
||||
("典当", 7),
|
||||
("海外置业", 1),
|
||||
("汽车", 1309),
|
||||
("汽车档次", 965),
|
||||
("汽车品牌", 900),
|
||||
("汽车车型", 727),
|
||||
("购车阶段", 461),
|
||||
("二手车", 309),
|
||||
("汽车美容", 260),
|
||||
("新能源汽车", 173),
|
||||
("汽车维修", 155),
|
||||
("租车服务", 136),
|
||||
("车展", 121),
|
||||
("违章查询", 76),
|
||||
("汽车改装", 62),
|
||||
("汽车用品", 37),
|
||||
("路况查询", 32),
|
||||
("汽车保险", 28),
|
||||
("陪驾代驾", 4),
|
||||
("网络购物", 1275),
|
||||
("做我的猫", 1088),
|
||||
("只想要你知道", 907),
|
||||
("团购", 837),
|
||||
("比价", 201),
|
||||
("海淘", 195),
|
||||
("移动APP购物", 179),
|
||||
("支付方式", 119),
|
||||
("代购", 43),
|
||||
("体育健身", 1234),
|
||||
("体育赛事项目", 802),
|
||||
("运动项目", 405),
|
||||
("体育类赛事", 337),
|
||||
("健身项目", 199),
|
||||
("健身房健身", 78),
|
||||
("运动健身", 77),
|
||||
("家庭健身", 36),
|
||||
("健身器械", 29),
|
||||
("办公室健身", 3),
|
||||
("商务服务", 1201),
|
||||
("法律咨询", 508),
|
||||
("化工材料", 147),
|
||||
("广告服务", 125),
|
||||
("会计审计", 115),
|
||||
("人员招聘", 101),
|
||||
("印刷打印", 66),
|
||||
("知识产权", 32),
|
||||
("翻译", 22),
|
||||
("安全安保", 9),
|
||||
("公关服务", 8),
|
||||
("商旅服务", 2),
|
||||
("展会服务", 2),
|
||||
("特许经营", 1),
|
||||
("休闲爱好", 1169),
|
||||
("收藏", 412),
|
||||
("摄影", 393),
|
||||
("温泉", 230),
|
||||
("博彩彩票", 211),
|
||||
("美术", 207),
|
||||
("书法", 139),
|
||||
("DIY手工", 75),
|
||||
("舞蹈", 23),
|
||||
("钓鱼", 21),
|
||||
("棋牌桌游", 17),
|
||||
("KTV", 6),
|
||||
("密室", 5),
|
||||
("采摘", 4),
|
||||
("电玩", 1),
|
||||
("真人CS", 1),
|
||||
("轰趴", 1),
|
||||
("家电数码", 1111),
|
||||
("手机", 885),
|
||||
("电脑", 543),
|
||||
("大家电", 321),
|
||||
("家电关注品牌", 253),
|
||||
("网络设备", 162),
|
||||
("摄影器材", 149),
|
||||
("影音设备", 133),
|
||||
("办公数码设备", 113),
|
||||
("生活电器", 67),
|
||||
("厨房电器", 54),
|
||||
("智能设备", 45),
|
||||
("个人护理电器", 22),
|
||||
("服饰鞋包", 1047),
|
||||
("服装", 566),
|
||||
("饰品", 289),
|
||||
("鞋", 184),
|
||||
("箱包", 168),
|
||||
("奢侈品", 137),
|
||||
("母婴亲子", 1041),
|
||||
("孕婴保健", 505),
|
||||
("母婴社区", 299),
|
||||
("早教", 103),
|
||||
("奶粉辅食", 66),
|
||||
("童车童床", 41),
|
||||
("关注品牌", 271),
|
||||
("宝宝玩乐", 30),
|
||||
("母婴护理服务", 25),
|
||||
("纸尿裤湿巾", 16),
|
||||
("妈妈用品", 15),
|
||||
("宝宝起名", 12),
|
||||
("童装童鞋", 9),
|
||||
("胎教", 8),
|
||||
("宝宝安全", 1),
|
||||
("宝宝洗护用品", 1),
|
||||
("软件应用", 1018),
|
||||
("系统工具", 896),
|
||||
("理财购物", 440),
|
||||
("生活实用", 365),
|
||||
("影音图像", 256),
|
||||
("社交通讯", 214),
|
||||
("手机美化", 39),
|
||||
("办公学习", 28),
|
||||
("应用市场", 23),
|
||||
("母婴育儿", 14),
|
||||
("游戏", 946),
|
||||
("手机游戏", 565),
|
||||
("PC游戏", 353),
|
||||
("网页游戏", 254),
|
||||
("游戏机", 188),
|
||||
("模拟辅助", 166),
|
||||
("个护美容", 942),
|
||||
("护肤品", 177),
|
||||
("彩妆", 133),
|
||||
("美发", 80),
|
||||
("香水", 50),
|
||||
("个人护理", 46),
|
||||
("美甲", 26),
|
||||
("SPA美体", 21),
|
||||
("花鸟萌宠", 914),
|
||||
("绿植花卉", 311),
|
||||
("狗", 257),
|
||||
("其他宠物", 131),
|
||||
("水族", 125),
|
||||
("猫", 122),
|
||||
("动物", 81),
|
||||
("鸟", 67),
|
||||
("宠物用品", 41),
|
||||
("宠物服务", 26),
|
||||
("书籍阅读", 913),
|
||||
("网络小说", 483),
|
||||
("关注书籍", 128),
|
||||
("文学", 105),
|
||||
("报刊杂志", 77),
|
||||
("人文社科", 22),
|
||||
("建材家居", 907),
|
||||
("装修建材", 644),
|
||||
("家具", 273),
|
||||
("家居风格", 187),
|
||||
("家居家装关注品牌", 140),
|
||||
("家纺", 107),
|
||||
("厨具", 47),
|
||||
("灯具", 43),
|
||||
("家居饰品", 29),
|
||||
("家居日常用品", 10),
|
||||
("生活服务", 883),
|
||||
("物流配送", 536),
|
||||
("家政服务", 108),
|
||||
("摄影服务", 49),
|
||||
("搬家服务", 38),
|
||||
("物业维修", 37),
|
||||
("婚庆服务", 24),
|
||||
("二手回收", 24),
|
||||
("鲜花配送", 3),
|
||||
("维修服务", 3),
|
||||
("殡葬服务", 1),
|
||||
("求职创业", 874),
|
||||
("创业", 363),
|
||||
("目标职位", 162),
|
||||
("目标行业", 50),
|
||||
("兼职", 21),
|
||||
("期望年薪", 20),
|
||||
("实习", 16),
|
||||
("雇主类型", 10),
|
||||
("星座运势", 789),
|
||||
("星座", 316),
|
||||
("算命", 303),
|
||||
("解梦", 196),
|
||||
("风水", 93),
|
||||
("面相分析", 47),
|
||||
("手相", 32),
|
||||
("公益", 90),
|
||||
]
|
||||
class MyWindow(QtWidgets.QPushButton):
|
||||
|
||||
c = (
|
||||
WordCloud()
|
||||
.add(
|
||||
"",
|
||||
words,
|
||||
word_size_range=[20, 100],
|
||||
textstyle_opts=opts.TextStyleOpts(font_family="cursive"),
|
||||
)
|
||||
.set_global_opts(title_opts=opts.TitleOpts(title="WordCloud-自定义文字样式"))
|
||||
.render("wordcloud_custom_font_style.html")
|
||||
)
|
||||
def __init__(self):
|
||||
QtWidgets.QPushButton.__init__(self)
|
||||
self.setText("关闭窗口")
|
||||
self.clicked.connect(QtWidgets.qApp.quit)
|
||||
|
||||
def load_data(self, sp):
|
||||
for i in range(1, 11): #模拟主程序加载过程
|
||||
time.sleep(2) # 加载数据
|
||||
sp.showMessage("加载... {0}%".format(i * 10), QtCore.Qt.AlignHCenter |QtCore.Qt.AlignBottom, QtCore.Qt.black)
|
||||
QtWidgets.qApp.processEvents() # 允许主进程处理事件
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
splash = QtWidgets.QSplashScreen(QtGui.QPixmap("img.jpg"))
|
||||
splash.showMessage("加载... 0%", QtCore.Qt.AlignHCenter | QtCore.Qt.AlignBottom, QtCore.Qt.black)
|
||||
splash.show() # 显示启动界面
|
||||
QtWidgets.qApp.processEvents() # 处理主进程事件
|
||||
window = MyWindow()
|
||||
window.setWindowTitle("QSplashScreen类使用")
|
||||
window.resize(300, 30)
|
||||
window.load_data(splash) # 加载数据
|
||||
window.show()
|
||||
splash.finish(window) # 隐藏启动界面
|
@ -1,9 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@File : __init__.py
|
||||
@Author : Shuaikang Zhou
|
||||
@Time : 2022/12/25 19:53
|
||||
@IDE : Pycharm
|
||||
@Version : Python3.10
|
||||
@comment : ···
|
||||
"""
|
404
app/DB/data.py
404
app/DB/data.py
@ -1,404 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@File : data.py
|
||||
@Author : Shuaikang Zhou
|
||||
@Time : 2022/12/13 20:59
|
||||
@IDE : Pycharm
|
||||
@Version : Python3.10
|
||||
@comment : ···
|
||||
"""
|
||||
import json
|
||||
import pymysql
|
||||
import random
|
||||
import time
|
||||
import hashlib
|
||||
import datetime
|
||||
import os
|
||||
import shutil
|
||||
f = open('./app/data/config.json','r')
|
||||
config = json.loads(f.read())
|
||||
username = config['username']
|
||||
password = config['password']
|
||||
database = config['database']
|
||||
# 打开数据库连接t
|
||||
db = pymysql.connect(
|
||||
host='localhost',
|
||||
user=username,
|
||||
password=password,
|
||||
database=database,
|
||||
autocommit=True
|
||||
)
|
||||
cursor = db.cursor()
|
||||
|
||||
|
||||
def register(username, password, nickname):
|
||||
"""
|
||||
注册账号
|
||||
:param username: 用户名
|
||||
:param password: 密码
|
||||
:param nickname: 昵称
|
||||
:return:
|
||||
"""
|
||||
try:
|
||||
create = 'insert into users (username,password,createTime) values (%s,%s,%s)'
|
||||
timestamp = float(time.time())
|
||||
dt = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
cursor.execute(create, [username, password, dt])
|
||||
create = 'insert into userinfo (username,nickname) values (%s,%s)'
|
||||
cursor.execute(create, [username, nickname])
|
||||
db.commit()
|
||||
try:
|
||||
sql = f'''
|
||||
create view msg_view_{username}
|
||||
as
|
||||
select msgId,type,IsSend,createTime,content,talkerId from message
|
||||
where username = %s
|
||||
order by msgId;
|
||||
'''
|
||||
cursor.execute(sql, [username])
|
||||
sql = f'''
|
||||
create view contact_view_{username}
|
||||
as
|
||||
select contactId,conRemark,type,addTime from contact
|
||||
where username = %s;
|
||||
'''
|
||||
cursor.execute(sql, [username])
|
||||
sql = f'''
|
||||
create view group_view_{username}
|
||||
as
|
||||
select g_id,g_name,gu_nickname,gu_type,gu_time from group_users,`group`
|
||||
where gu_uid=%s and group_users.gu_gid=`group`.g_id;
|
||||
'''
|
||||
cursor.execute(sql, [username])
|
||||
db.commit()
|
||||
except pymysql.err.OperationalError:
|
||||
print('视图已经存在')
|
||||
except pymysql.err.IntegrityError:
|
||||
print('用户已存在')
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def login(username, password):
|
||||
select = 'select * from users where username = %s and password = %s'
|
||||
cursor.execute(select, [username, password])
|
||||
result = cursor.fetchall()
|
||||
if result:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def del_user(username):
|
||||
sql = 'delete from users where username = %s'
|
||||
cursor.execute(sql, [username])
|
||||
db.commit()
|
||||
return True
|
||||
|
||||
|
||||
def searchUser(username):
|
||||
select = 'select * from users where username = %s'
|
||||
cursor.execute(select, [username])
|
||||
result = cursor.fetchall()
|
||||
if result:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def add_contact(username, contactId, conRemark, _type=3):
|
||||
send = 'insert into contact (username,conRemark,type,addTime,contactId) values(%s,%s,%s,%s,%s)'
|
||||
dt = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
select = 'select * from userinfo where username = %s '
|
||||
cursor.execute(select, [username])
|
||||
result = cursor.fetchall()
|
||||
if not result:
|
||||
return False
|
||||
if not conRemark:
|
||||
conRemark = None
|
||||
try:
|
||||
if _type == 3:
|
||||
cursor.execute(send, [username, conRemark, 3, dt, contactId])
|
||||
db.commit()
|
||||
return (contactId, conRemark, 3, dt)
|
||||
except:
|
||||
return False
|
||||
|
||||
|
||||
def get_userinfo(username):
|
||||
sql = 'select * from userinfo where username = %s'
|
||||
cursor.execute(sql, [username])
|
||||
result = cursor.fetchone()
|
||||
return result[0]
|
||||
|
||||
|
||||
def online(username, socket=None):
|
||||
status = random.randint(32010, 52090)
|
||||
sql = 'update userinfo set status = %s where username=%s'
|
||||
cursor.execute(sql, [status, username])
|
||||
db.commit()
|
||||
|
||||
return status
|
||||
|
||||
|
||||
def tell_online(username, socket):
|
||||
if socket:
|
||||
contacts = get_contacts(username)
|
||||
for contact in contacts:
|
||||
contactID = contact[0]
|
||||
status = check_online(contactID)
|
||||
if status != -1:
|
||||
ta_addr = ('localhost', status)
|
||||
send_data = {
|
||||
'type': 'T',
|
||||
'username': username,
|
||||
'content': '在线0000_1'
|
||||
}
|
||||
socket.sendto(json.dumps(send_data).encode('utf-8'), ta_addr)
|
||||
|
||||
|
||||
def offline(username):
|
||||
status = -1
|
||||
sql = 'update userinfo set status = %s where username=%s'
|
||||
cursor.execute(sql, [status, username])
|
||||
db.commit()
|
||||
return status
|
||||
|
||||
|
||||
def check_online(username):
|
||||
db.commit()
|
||||
sql = 'select status from userinfo where username=%s'
|
||||
cursor.execute(sql, [username])
|
||||
db.commit()
|
||||
result = cursor.fetchone()
|
||||
# print(username, '端口号:', result)
|
||||
if result:
|
||||
return result[0]
|
||||
else:
|
||||
return -1
|
||||
|
||||
|
||||
def send_msg(IsSend, msg, ta, me, status=-1, _type=3):
|
||||
if status == -1:
|
||||
return False
|
||||
send = 'insert into message (type,isSend,createTime,content,talkerId,username) values(%s,%s,%s,%s,%s,%s)'
|
||||
dt = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
if _type == 3:
|
||||
cursor.execute(send, [_type, IsSend, dt, msg, ta, me])
|
||||
db.commit()
|
||||
return 1, _type, IsSend, datetime.datetime.now(), msg, ta
|
||||
|
||||
|
||||
def send_group_msg(gid, msg, talker, IsSend=0, _type=3):
|
||||
send = 'insert into group_message (g_id,gm_type,gm_content,gm_time,gm_talker,gm_isSend) values(%s,%s,%s,%s,%s,%s)'
|
||||
dt = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
if _type == 3:
|
||||
cursor.execute(send, [gid, _type, msg, dt, talker, IsSend])
|
||||
db.commit()
|
||||
return 1, gid, _type, msg, datetime.datetime.now(), talker, IsSend
|
||||
|
||||
|
||||
def get_group_message(g_id):
|
||||
sql = f'select * from group_message where g_id = %s order by gm_id'
|
||||
cursor.execute(sql, [g_id])
|
||||
result = cursor.fetchall()
|
||||
return result
|
||||
|
||||
|
||||
def avatar_md5(wxid):
|
||||
m = hashlib.md5()
|
||||
# 参数必须是byte类型,否则报Unicode-objects must be encoded before hashing错误
|
||||
m.update(bytes(wxid.encode('utf-8')))
|
||||
return m.hexdigest()
|
||||
|
||||
|
||||
def get_avator(wxid):
|
||||
if wxid == None:
|
||||
return
|
||||
wxid = str(wxid)
|
||||
avatar = avatar_md5(wxid)
|
||||
avatar_path = r"./data/avatar/"
|
||||
path = avatar_path + avatar[:2] + '/' + avatar[2:4]
|
||||
for root, dirs, files in os.walk(path):
|
||||
for file in files:
|
||||
if avatar in file:
|
||||
avatar = file
|
||||
break
|
||||
return path + '/' + avatar
|
||||
|
||||
|
||||
def get_contacts(username):
|
||||
sql = f'select * from contact_view_{username} '
|
||||
cursor.execute(sql)
|
||||
result = cursor.fetchall()
|
||||
return result
|
||||
|
||||
|
||||
def get_myinfo(username):
|
||||
sql = 'select * from userinfo where username = %s'
|
||||
cursor.execute(sql, [username])
|
||||
result = cursor.fetchone()
|
||||
return result
|
||||
|
||||
|
||||
def update_userinfo(userinfo):
|
||||
sql = '''
|
||||
update userinfo
|
||||
set
|
||||
nickname=%s,
|
||||
gender=%s,
|
||||
city=%s,
|
||||
province=%s,
|
||||
tel=%s,
|
||||
email=%s,
|
||||
signsture=%s
|
||||
where username=%s
|
||||
'''
|
||||
cursor.execute(sql, userinfo)
|
||||
|
||||
|
||||
def get_nickname(username):
|
||||
sql = 'select nickname from userinfo where username=%s'
|
||||
cursor.execute(sql, [username])
|
||||
result = cursor.fetchone()
|
||||
return result[0]
|
||||
|
||||
|
||||
def update_conRemark(username, contactId, new_conRemark):
|
||||
sql = 'update contact set conRemark=%s where username=%s and contactId=%s'
|
||||
cursor.execute(sql, [new_conRemark, username, contactId])
|
||||
db.commit()
|
||||
return True
|
||||
|
||||
|
||||
def delete_contact(username, contactId):
|
||||
sql = 'delete from contact where username=%s and contactId=%s'
|
||||
cursor.execute(sql, [username, contactId])
|
||||
db.commit()
|
||||
return True
|
||||
|
||||
|
||||
def delete_group(uid, gid):
|
||||
sql = 'delete from group_users where gu_uid=%s and gu_gid=%s'
|
||||
cursor.execute(sql, [uid, gid])
|
||||
db.commit()
|
||||
return True
|
||||
|
||||
|
||||
def get_remark(username, talkerId):
|
||||
sql = f'select conRemark from contact_view_{username} where contactId = %s'
|
||||
cursor.execute(sql, [talkerId])
|
||||
result = cursor.fetchone()
|
||||
return result[0]
|
||||
|
||||
|
||||
def mycopyfile(srcfile, dstpath):
|
||||
# 复制函数
|
||||
"""
|
||||
复制文件
|
||||
:param srcfile: 原路径
|
||||
:param dstpath: 新路径
|
||||
:return:
|
||||
"""
|
||||
# if 1:
|
||||
try:
|
||||
if not os.path.isfile(srcfile):
|
||||
print("%s not exist!" % (srcfile))
|
||||
return
|
||||
else:
|
||||
print(dstpath)
|
||||
if os.path.isfile(dstpath):
|
||||
os.remove(dstpath)
|
||||
fpath, fname = os.path.split(srcfile) # 分离文件名和路径
|
||||
dpath, dname = os.path.split(dstpath)
|
||||
if not os.path.exists(dpath):
|
||||
os.makedirs(dpath) # 创建路径
|
||||
# dstpath = '/'.join(dstpath.split('/')[:-1])+'/'
|
||||
|
||||
# print(dpath,dname)
|
||||
shutil.copy(srcfile, dpath) # 复制文件
|
||||
os.rename(dpath + '/' + fname, dstpath)
|
||||
# print ("copy %s -> %s"%(srcfile, dstpath + fname))
|
||||
except:
|
||||
print('文件已存在')
|
||||
|
||||
|
||||
def get_message(username, talkerId):
|
||||
sql = f'select * from msg_view_{username} where talkerId = %s order by msgId'
|
||||
cursor.execute(sql, [talkerId])
|
||||
result = cursor.fetchall()
|
||||
return result
|
||||
|
||||
|
||||
def create_group(g_name, g_admin, g_notice=None, g_intro=None):
|
||||
g_id = random.randint(10000, 99999)
|
||||
sql = '''insert into `group` (g_id,g_name,g_admin,g_notice,g_intro,g_time) values (%s, %s, %s, %s, %s, %s);'''
|
||||
dt = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
param = [g_id, g_name, g_admin, g_notice, g_intro, dt]
|
||||
print(param)
|
||||
cursor.execute(sql, param)
|
||||
sql = '''insert into `group_users` (gu_uid,gu_gid,gu_time,gu_nickname,gu_type) values (%s, %s, %s, %s, %s);'''
|
||||
param = [g_admin, g_id, dt, None, 1]
|
||||
cursor.execute(sql, param)
|
||||
db.commit()
|
||||
return g_id
|
||||
|
||||
|
||||
def add_group(username, g_id, nickname):
|
||||
group = search_group(g_id)
|
||||
if not group:
|
||||
return False
|
||||
if not nickname:
|
||||
nickname = None
|
||||
sql = 'insert into group_users (gu_uid,gu_gid,gu_time,gu_nickname,gu_type) values (%s,%s,%s,%s,%s)'
|
||||
dt = dt = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
cursor.execute(sql, [username, g_id, dt, nickname, 2])
|
||||
db.commit()
|
||||
return [g_id, dt, nickname, 2]
|
||||
|
||||
|
||||
def search_group(gid):
|
||||
sql = 'select * from `group` where g_id=%s'
|
||||
cursor.execute(sql, [gid])
|
||||
result = cursor.fetchone()
|
||||
return result
|
||||
|
||||
|
||||
def get_groups(username):
|
||||
sql = f'select * from group_view_{username}'
|
||||
cursor.execute(sql)
|
||||
result = cursor.fetchall()
|
||||
return result
|
||||
|
||||
|
||||
def get_group_users(g_id):
|
||||
db.commit()
|
||||
sql = '''
|
||||
select gu_uid,gu_gid,gu_time,gu_nickname,status
|
||||
from group_users,userinfo
|
||||
where gu_gid=%s and
|
||||
gu_uid=userinfo.username
|
||||
'''
|
||||
cursor.execute(sql, [g_id])
|
||||
db.commit()
|
||||
result = cursor.fetchall()
|
||||
return result
|
||||
|
||||
|
||||
# send_msg(3, '你好', '123456')
|
||||
if __name__ == '__main__':
|
||||
# add_contact('2020303457', '周帅康')
|
||||
# contacts = get_contacts('')
|
||||
# print(contacts)
|
||||
# messages = get_message('2020303457', '')
|
||||
# print(messages)
|
||||
# online('2020303457')
|
||||
# status = check_online('2020303457')
|
||||
# print('status:', status)
|
||||
# offline('2020303457')
|
||||
# status = check_online('2020303457')
|
||||
# print('status:', status)
|
||||
# print(get_remark('', 2020303457))
|
||||
# print(get_groups('2020303457'))
|
||||
# # print(create_group("DB实验", '2020303457', g_notice=str(12), g_intro="test"))
|
||||
# print(get_groups(''))
|
||||
# print(get_group_users(61067))
|
||||
print(get_myinfo(''))
|
@ -72,7 +72,7 @@ if os.path.exists('./app/DataBase/Msg.db'):
|
||||
# '''创建游标'''
|
||||
cursor = DB.cursor()
|
||||
if os.path.exists('./Msg.db'):
|
||||
DB = sqlite3.connect("./Msg.db")
|
||||
DB = sqlite3.connect("./Msg.db", check_same_thread=False)
|
||||
# '''创建游标'''
|
||||
cursor = DB.cursor()
|
||||
|
||||
@ -110,7 +110,7 @@ def decrypt(db, key):
|
||||
p = os.system(f"{os.path.abspath('.')}{cmd} {db} < ./app/DataBase/config.txt")
|
||||
global DB
|
||||
global cursor
|
||||
DB = sqlite3.connect("./app/DataBase/Msg.db")
|
||||
DB = sqlite3.connect("./app/DataBase/Msg.db", check_same_thread=False)
|
||||
# '''创建游标'''
|
||||
cursor = DB.cursor()
|
||||
|
||||
@ -249,9 +249,13 @@ def get_emoji(imgPath):
|
||||
from EmojiInfo
|
||||
where md5=?
|
||||
'''
|
||||
try:
|
||||
cursor.execute(sql, [imgPath])
|
||||
result = cursor.fetchone()
|
||||
download_emoji(newPath, result[0])
|
||||
except sqlite3.ProgrammingError as e:
|
||||
print(e, imgPath)
|
||||
return False
|
||||
return newPath
|
||||
|
||||
|
||||
|
@ -33,8 +33,26 @@ def time_format(timestamp):
|
||||
return time.strftime("%Y-%m-%d %H:%M:%S", time_tuple)
|
||||
|
||||
|
||||
def merge_docx(conRemark, n):
|
||||
origin_docx_path = f"{path}/{conRemark}"
|
||||
class Output(QThread):
|
||||
"""
|
||||
发送信息线程
|
||||
"""
|
||||
progressSignal = pyqtSignal(int)
|
||||
rangeSignal = pyqtSignal(int)
|
||||
okSignal = pyqtSignal(int)
|
||||
i = 1
|
||||
|
||||
def __init__(self, Me, ta_u, parent=None):
|
||||
super().__init__(parent)
|
||||
self.Me = Me
|
||||
self.sec = 2 # 默认1000秒
|
||||
self.ta_username = ta_u
|
||||
self.my_avatar = self.Me.my_avatar
|
||||
self.ta_avatar = data.get_avator(ta_u)
|
||||
self.msg_id = 0
|
||||
|
||||
def merge_docx(self, conRemark, n):
|
||||
origin_docx_path = f"{os.path.abspath('.')}/data/聊天记录/{conRemark}"
|
||||
all_word = os.listdir(origin_docx_path)
|
||||
all_file_path = []
|
||||
for i in range(n):
|
||||
@ -55,21 +73,59 @@ def merge_docx(conRemark, n):
|
||||
num = num + 1
|
||||
middle_new_docx.save(origin_docx_path + '/' + filename)
|
||||
|
||||
def progress(self, value):
|
||||
self.i += 1
|
||||
# 处理完成之后将多个文件合并
|
||||
if self.i == self.total_num:
|
||||
QThread.sleep(1)
|
||||
conRemark = data.get_conRemark(self.ta_username)
|
||||
self.progressSignal.emit(self.total_num-1)
|
||||
self.merge_docx(conRemark, self.n)
|
||||
print('ok')
|
||||
self.progressSignal.emit(self.total_num)
|
||||
self.okSignal.emit(1)
|
||||
self.progressSignal.emit(self.i)
|
||||
|
||||
class Output(QThread):
|
||||
def run(self):
|
||||
self.Child = {}
|
||||
if 1:
|
||||
conRemark = data.get_conRemark(self.ta_username)
|
||||
data.mkdir(f"{os.path.abspath('.')}/data/聊天记录/{conRemark}")
|
||||
messages = data.get_all_message(self.ta_username)
|
||||
self.total_num = len(messages)
|
||||
self.rangeSignal.emit(self.total_num)
|
||||
l = len(messages)
|
||||
self.n = 10
|
||||
for i in range(self.n):
|
||||
q = i * (l // self.n)
|
||||
p = (i + 1) * (l // self.n)
|
||||
if i == self.n - 1:
|
||||
p = l
|
||||
len_data = messages[q:p]
|
||||
# self.to_docx(len_data, i, conRemark)
|
||||
self.Child[i] = ChildThread(self.Me, self.ta_username, len_data, conRemark,i)
|
||||
self.Child[i].progressSignal.connect(self.progress)
|
||||
self.Child[i].start()
|
||||
|
||||
|
||||
class ChildThread(QThread):
|
||||
"""
|
||||
发送信息线程
|
||||
子线程,用于导出部分聊天记录
|
||||
"""
|
||||
progressSignal = pyqtSignal(int)
|
||||
successSignal = pyqtSignal(int)
|
||||
rangeSignal = pyqtSignal(int)
|
||||
i = 1
|
||||
|
||||
def __init__(self, Me, ta_u, parent=None):
|
||||
def __init__(self, Me, ta_u, message, conRemark,num, parent=None):
|
||||
super().__init__(parent)
|
||||
self.Me = Me
|
||||
self.sec = 2 # 默认1000秒
|
||||
self.ta_username = ta_u
|
||||
self.num = num
|
||||
self.my_avatar = self.Me.my_avatar
|
||||
self.ta_avatar = data.get_avator(ta_u)
|
||||
self.conRemark = conRemark
|
||||
self.message = message
|
||||
self.msg_id = 0
|
||||
|
||||
def create_table(self, doc, isSend):
|
||||
@ -268,11 +324,14 @@ class Output(QThread):
|
||||
|
||||
def to_docx(self, messages, i, conRemark):
|
||||
'''创建联系人目录'''
|
||||
data.mkdir(f"{os.path.abspath('.')}/data/聊天记录/{conRemark}")
|
||||
|
||||
filename = f"{os.path.abspath('.')}/data/聊天记录/{conRemark}/{conRemark}{i}.docx"
|
||||
doc = docx.Document()
|
||||
last_timestamp = 1601968667000
|
||||
|
||||
for message in messages:
|
||||
self.progressSignal.emit(self.i)
|
||||
self.i += 1
|
||||
msgId = message[0]
|
||||
ta_username = message[7]
|
||||
Type = int(message[2])
|
||||
@ -311,76 +370,11 @@ class Output(QThread):
|
||||
doc.save(filename)
|
||||
|
||||
def run(self):
|
||||
if 1:
|
||||
conRemark = data.get_conRemark(self.ta_username)
|
||||
messages = data.get_all_message(self.ta_username)
|
||||
# self.self_text.emit(conRemark)
|
||||
# self.self_text.emit(path)
|
||||
self.to_docx(messages, 0, conRemark)
|
||||
# l = len(user_data)
|
||||
# n = 50
|
||||
# for i in range(n):
|
||||
# q = i * (l // n)
|
||||
# p = (i + 1) * (l // n)
|
||||
# if i == n - 1:
|
||||
# p = l
|
||||
# len_data = user_data[q:p]
|
||||
# self.to_docx(len_data, i, conRemark)
|
||||
|
||||
# self.self_text.emit('\n\n\n导出进度还差一点点!!!')
|
||||
# self.bar.emit(99)
|
||||
# merge_docx(conRemark, n)
|
||||
# self.self_text.emit(f'{conRemark}聊天记录导出成功!!!')
|
||||
# self.bar.emit(100)
|
||||
|
||||
# def run(self):
|
||||
# self.ta_avatar = data.get_avator(self.ta_u)
|
||||
# messages = data.get_all_message(self.ta_u)
|
||||
# total_num = len(messages)
|
||||
# for message in messages:
|
||||
# msgId = message[0]
|
||||
# ta_username = message[7]
|
||||
# msgType = str(message[2])
|
||||
# isSend = message[4]
|
||||
# content = message[8]
|
||||
# imgPath = message[9]
|
||||
# msg_time = message[6]
|
||||
# self.check_time(msg_time)
|
||||
#
|
||||
# if msgType == '1':
|
||||
# # return
|
||||
# self.show_text(isSend, content)
|
||||
# elif msgType == '3':
|
||||
# # return
|
||||
# self.show_img(isSend, imgPath, content)
|
||||
# elif msgType == '47':
|
||||
# # return
|
||||
# self.show_emoji(isSend, imgPath, content)
|
||||
# elif msgType == '268445456':
|
||||
# self.show_recall_information(content)
|
||||
# elif msgType == '922746929':
|
||||
# self.pat_a_pat(content)
|
||||
self.to_docx(self.message, self.num, self.conRemark)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# # conRemark = '张三' #! 微信备注名
|
||||
# n = 100 # ! 分割的文件个数
|
||||
# main(conRemark, n)
|
||||
# img_self.close()
|
||||
# img_ta.close()
|
||||
me = data.Me('wxid_27hqbq7vx5hf22')
|
||||
t = Output(Me=me, ta_u='wxid_q3ozn70pweud22')
|
||||
# t.ta_info = {
|
||||
# 'wxid': 'wxid_q3ozn70pweud22',
|
||||
# 'conRemark': '小钱'
|
||||
# }
|
||||
# t.ta_info = {
|
||||
# 'wxid': 'wxid_8piw6sb4hvfm22',
|
||||
# 'conRemark': '曹雨萱'
|
||||
# }
|
||||
# # wxid_8piw6sb4hvfm22
|
||||
# t.self_info = {
|
||||
# 'wxid': 'wxid_27hqbq7vx5hf22',
|
||||
# 'conRemark': 'Shuaikang Zhou'
|
||||
# }
|
||||
t.run()
|
||||
|
@ -1,561 +0,0 @@
|
||||
import hashlib
|
||||
import os
|
||||
import re
|
||||
import threading
|
||||
import time
|
||||
import docx
|
||||
import pandas as pd
|
||||
import requests
|
||||
from docx import shared
|
||||
from docx.enum.table import WD_ALIGN_VERTICAL
|
||||
from docx.enum.text import WD_COLOR_INDEX, WD_PARAGRAPH_ALIGNMENT
|
||||
from docxcompose.composer import Composer
|
||||
import rcontact
|
||||
|
||||
import sys
|
||||
from PyQt5.QtGui import QIcon
|
||||
from PyQt5.QtWidgets import *
|
||||
from PyQt5.QtCore import *
|
||||
from PyQt5.QtGui import QPixmap
|
||||
|
||||
path = 'D:\Project\PythonProject\WeChat'
|
||||
# conRemark = '曹雨萱'
|
||||
# self_wxid = rcontact.get_self_wxid()
|
||||
# ta_wxid = rcontact.get_one_wxid(conRemark)
|
||||
|
||||
'''
|
||||
#! 创建emoji目录,存放emoji文件
|
||||
'''
|
||||
|
||||
|
||||
def mkdir(path):
|
||||
path = path.strip()
|
||||
path = path.rstrip("\\")
|
||||
if os.path.exists(path):
|
||||
return False
|
||||
os.makedirs(path)
|
||||
return True
|
||||
|
||||
|
||||
mkdir(path + '/emoji')
|
||||
# mkdir('..//db_tables')
|
||||
'''
|
||||
#! 将wxid使用MD5编码加密
|
||||
#! 加密结果是用户头像路径
|
||||
'''
|
||||
|
||||
|
||||
def avatar_md5(wxid):
|
||||
m = hashlib.md5()
|
||||
# 参数必须是byte类型,否则报Unicode-objects must be encoded before hashing错误
|
||||
m.update(bytes(wxid.encode('utf-8')))
|
||||
return m.hexdigest()
|
||||
|
||||
|
||||
'''
|
||||
#! 获取头像文件完整路径
|
||||
'''
|
||||
|
||||
|
||||
def get_avator(wxid):
|
||||
avatar = avatar_md5(wxid)
|
||||
avatar_path = path + "/avatar/"
|
||||
Path = avatar_path + avatar[:2] + '/' + avatar[2:4]
|
||||
for root, dirs, files in os.walk(path):
|
||||
for file in files:
|
||||
if avatar in file:
|
||||
avatar = file
|
||||
break
|
||||
return Path + '/' + avatar
|
||||
|
||||
|
||||
def read_csv(conRemark):
|
||||
'''
|
||||
:param conRemark: (str) 要导出的联系人备注名
|
||||
:return: pandas数据
|
||||
'''
|
||||
user_data = pd.read_csv(f'{path}/db_tables/{conRemark}.csv')
|
||||
'''将浮点数转化成字符串类型,否则会舍入影响时间结果'''
|
||||
user_data['createTime'] = user_data['createTime'].astype(str)
|
||||
# print(user_data)
|
||||
return user_data
|
||||
|
||||
|
||||
def download_emoji(content, img_path):
|
||||
'''
|
||||
#! 下载emoji文件
|
||||
#!
|
||||
#!
|
||||
'''
|
||||
# if 1:
|
||||
try:
|
||||
# print(img_path)
|
||||
url = content.split('cdnurl = "')[1].split('"')[0]
|
||||
print(url)
|
||||
url = ':'.join(url.split('*#*'))
|
||||
if 'amp;' in url:
|
||||
url = ''.join(url.split('amp;'))
|
||||
print('emoji downloading!!!')
|
||||
resp = requests.get(url)
|
||||
with open(f'{path}/emoji/{img_path}', 'wb') as f:
|
||||
f.write(resp.content)
|
||||
except Exception:
|
||||
print("emoji download error")
|
||||
|
||||
|
||||
def time_format(timestamp):
|
||||
'''
|
||||
#! 将字符串类型的时间戳转换成日期
|
||||
#! 返回格式化的时间字符串
|
||||
#! %Y-%m-%d %H:%M:%S
|
||||
'''
|
||||
# print(timestamp)
|
||||
# timestamp = timestamp[:-5]
|
||||
timestamp = float(timestamp[:-3] + '.' + timestamp[-3:])
|
||||
# print(timestamp)
|
||||
time_tuple = time.localtime(timestamp)
|
||||
# print(time.strftime("%Y-%m-%d %H:%M:%S", time_tuple))
|
||||
# quit()
|
||||
return time.strftime("%Y-%m-%d %H:%M:%S", time_tuple)
|
||||
|
||||
|
||||
def IS_5_min(last_m, now_m):
|
||||
'''
|
||||
#! 判断两次聊天时间是不是大于五分钟
|
||||
#! 若大于五分钟则显示时间
|
||||
#! 否则不显示
|
||||
'''
|
||||
last_m = last_m[:-5]
|
||||
last_m = float(last_m + '.' + last_m[-5:2])
|
||||
now_m = now_m[:-5]
|
||||
now_m = float(now_m + '.' + now_m[-5:2])
|
||||
'''两次聊天记录时间差,单位是秒'''
|
||||
time_sub = now_m - last_m
|
||||
return time_sub >= 300
|
||||
|
||||
|
||||
def judge_type(Type):
|
||||
pass
|
||||
|
||||
|
||||
'''合并word文档到一个文件里'''
|
||||
|
||||
|
||||
def merge_docx(conRemark, n):
|
||||
origin_docx_path = f"{path}/{conRemark}"
|
||||
all_word = os.listdir(origin_docx_path)
|
||||
all_file_path = []
|
||||
for i in range(n):
|
||||
file_name = f"{conRemark}{i}.docx"
|
||||
all_file_path.append(origin_docx_path + '/' + file_name)
|
||||
filename = f"{conRemark}.docx"
|
||||
# print(all_file_path)
|
||||
doc = docx.Document()
|
||||
doc.save(origin_docx_path + '/' + filename)
|
||||
master = docx.Document(origin_docx_path + '/' + filename)
|
||||
middle_new_docx = Composer(master)
|
||||
num = 0
|
||||
for word in all_file_path:
|
||||
word_document = docx.Document(word)
|
||||
word_document.add_page_break()
|
||||
if num != 0:
|
||||
middle_new_docx.append(word_document)
|
||||
num = num + 1
|
||||
middle_new_docx.save(origin_docx_path + '/' + filename)
|
||||
|
||||
|
||||
class MyThread(QThread):
|
||||
signal = pyqtSignal(str)
|
||||
self_text = pyqtSignal(str)
|
||||
ta_text = pyqtSignal(str)
|
||||
bar = pyqtSignal(int)
|
||||
|
||||
def __init__(self):
|
||||
super(MyThread, self).__init__()
|
||||
self.ta_info = {}
|
||||
self.self_info = {}
|
||||
self.textBrowser = None
|
||||
self.num = 0
|
||||
self.total_num = 1
|
||||
|
||||
def get_avator(self):
|
||||
self.wxid = self.self_info['wxid']
|
||||
self.ta_wxid = self.ta_info['wxid']
|
||||
self.avator = get_avator(self.wxid)
|
||||
print(self.avator)
|
||||
self.ta_avator = get_avator(self.ta_wxid)
|
||||
print(self.ta_avator)
|
||||
# quit()
|
||||
self.img_self = open(self.avator, 'rb')
|
||||
self.img_ta = open(self.ta_avator, 'rb')
|
||||
|
||||
def read_csv(self, conRemark):
|
||||
'''
|
||||
:param conRemark: (str) 要导出的联系人备注名
|
||||
:return: pandas数据
|
||||
'''
|
||||
user_data = pd.read_csv(f'{path}/db_tables/{conRemark}.csv')
|
||||
'''将浮点数转化成字符串类型,否则会舍入影响时间结果'''
|
||||
user_data['createTime'] = user_data['createTime'].astype(str)
|
||||
# print(user_data)
|
||||
self.total_num = len(user_data)
|
||||
return user_data
|
||||
|
||||
def create_table(self, doc, isSend):
|
||||
'''
|
||||
#! 创建一个1*2表格
|
||||
#! isSend = 1 (0,0)存聊天内容,(0,1)存头像
|
||||
#! isSend = 0 (0,0)存头像,(0,1)存聊天内容
|
||||
#! 返回聊天内容的坐标
|
||||
'''
|
||||
table = doc.add_table(rows=1, cols=2, style='Normal Table')
|
||||
table.cell(0, 1).height = shared.Inches(0.5)
|
||||
table.cell(0, 0).height = shared.Inches(0.5)
|
||||
text_size = 1
|
||||
if isSend:
|
||||
'''表格右对齐'''
|
||||
table.alignment = WD_PARAGRAPH_ALIGNMENT.RIGHT
|
||||
avatar = table.cell(0, 1).paragraphs[0].add_run()
|
||||
'''插入头像,设置头像宽度'''
|
||||
avatar.add_picture(self.img_self, width=shared.Inches(0.5))
|
||||
'''设置单元格宽度跟头像一致'''
|
||||
table.cell(0, 1).width = shared.Inches(0.5)
|
||||
content_cell = table.cell(0, 0)
|
||||
'''聊天内容右对齐'''
|
||||
content_cell.paragraphs[0].paragraph_format.alignment = WD_PARAGRAPH_ALIGNMENT.RIGHT
|
||||
else:
|
||||
avatar = table.cell(0, 0).paragraphs[0].add_run()
|
||||
avatar.add_picture(self.img_ta, width=shared.Inches(0.5))
|
||||
'''设置单元格宽度'''
|
||||
table.cell(0, 0).width = shared.Inches(0.5)
|
||||
content_cell = table.cell(0, 1)
|
||||
'''聊天内容垂直居中对齐'''
|
||||
content_cell.vertical_alignment = WD_ALIGN_VERTICAL.CENTER
|
||||
return content_cell
|
||||
|
||||
def text(self, doc, isSend, message, status):
|
||||
if status == 5:
|
||||
message += '(未发出) '
|
||||
content_cell = self.create_table(doc, isSend)
|
||||
content_cell.paragraphs[0].add_run(message)
|
||||
content_cell.paragraphs[0].font_size = shared.Inches(0.5)
|
||||
self.self_text.emit(message)
|
||||
if isSend:
|
||||
p = content_cell.paragraphs[0]
|
||||
p.paragraph_format.alignment = WD_PARAGRAPH_ALIGNMENT.RIGHT
|
||||
doc.add_paragraph()
|
||||
|
||||
def image(self, doc, isSend, Type, content, imgPath):
|
||||
'''
|
||||
#! 插入聊天图片
|
||||
#! isSend = 1 只有缩略图
|
||||
#! isSend = 0 有原图
|
||||
:param doc:
|
||||
:param isSend:
|
||||
:param Type:
|
||||
:param content:
|
||||
:param imgPath:
|
||||
:return:
|
||||
'''
|
||||
content = self.create_table(doc, isSend)
|
||||
run = content.paragraphs[0].add_run()
|
||||
imgPath = imgPath.split('//th_')[-1]
|
||||
Path = None
|
||||
if Type == 3:
|
||||
Path = f'{path}/image2//{imgPath[:2]}//{imgPath[2:4]}'
|
||||
elif Type == 47:
|
||||
Path = '{path}/emoji'
|
||||
for root, dirs, files in os.walk(Path):
|
||||
for file in files:
|
||||
if isSend:
|
||||
if imgPath + 'hd' in file:
|
||||
imgPath = file
|
||||
try:
|
||||
run.add_picture(f'{Path}/{imgPath}', height=shared.Inches(2))
|
||||
doc.add_paragraph()
|
||||
except Exception:
|
||||
print("Error!image")
|
||||
return
|
||||
elif imgPath in file:
|
||||
imgPath = file
|
||||
break
|
||||
try:
|
||||
run.add_picture(f'{Path}/{imgPath}', height=shared.Inches(2))
|
||||
doc.add_paragraph()
|
||||
except Exception:
|
||||
print("Error!image")
|
||||
|
||||
# run.add_picture(f'{Path}/{imgPath}', height=shared.Inches(2))
|
||||
|
||||
def emoji(self, doc, isSend, content, imgPath):
|
||||
'''
|
||||
#! 添加表情包
|
||||
:param isSend:
|
||||
:param content:
|
||||
:param imgPath:
|
||||
:return:
|
||||
'''
|
||||
if 1:
|
||||
# try:
|
||||
Path = f'{path}/emoji/{imgPath}'
|
||||
is_Exist = os.path.exists(Path)
|
||||
if not is_Exist:
|
||||
'''表情包不存在,则下载表情包到emoji文件夹中'''
|
||||
download_emoji(content, imgPath)
|
||||
self.image(doc, isSend, Type=47, content=content, imgPath=imgPath)
|
||||
# except Exception:
|
||||
# print("can't find emoji!")
|
||||
|
||||
def wx_file(self, doc, isSend, content, status):
|
||||
'''
|
||||
#! 添加微信文件
|
||||
:param isSend:
|
||||
:param content:
|
||||
:param status:
|
||||
:return:
|
||||
'''
|
||||
pattern = re.compile(r"<title>(.*?)<")
|
||||
r = pattern.search(content).group()
|
||||
filename = r.lstrip('<title>').rstrip('<')
|
||||
self.text(doc, isSend, filename, status)
|
||||
|
||||
def retract_message(self, doc, isSend, content, status):
|
||||
'''
|
||||
#! 显示撤回消息
|
||||
:param isSend:
|
||||
:param content:
|
||||
:param status:
|
||||
:return:
|
||||
'''
|
||||
paragraph = doc.add_paragraph(content)
|
||||
paragraph.paragraph_format.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER
|
||||
|
||||
def reply(self, doc, isSend, content, status):
|
||||
'''
|
||||
#! 添加回复信息
|
||||
:param isSend:
|
||||
:param content:
|
||||
:param status:
|
||||
:return:
|
||||
'''
|
||||
pattern1 = re.compile(r"<title>(?P<title>(.*?))</title>")
|
||||
title = pattern1.search(content).groupdict()['title']
|
||||
pattern2 = re.compile(r"<displayname>(?P<displayname>(.*?))</displayname>")
|
||||
displayname = pattern2.search(content).groupdict()['displayname']
|
||||
'''匹配回复的回复'''
|
||||
pattern3 = re.compile(r"\n?title>(?P<content>(.*?))\n?</title>")
|
||||
if not pattern3.search(content):
|
||||
if isSend == 0:
|
||||
'''匹配对方的回复'''
|
||||
pattern3 = re.compile(r"<content>(?P<content>(.*?))</content>")
|
||||
else:
|
||||
'''匹配自己的回复'''
|
||||
pattern3 = re.compile(r"</msgsource>\n?<content>(?P<content>(.*?))\n?</content>")
|
||||
|
||||
'''这部分代码完全可以用if代替'''
|
||||
|
||||
try:
|
||||
'''试错'''
|
||||
text = pattern3.search(content).groupdict()['content']
|
||||
except Exception:
|
||||
try:
|
||||
'''试错'''
|
||||
text = pattern3.search(content).groupdict()['content']
|
||||
except Exception:
|
||||
'''试错'''
|
||||
pattern3 = re.compile(r"\n?<content>(?P<content>(.*?))\n?</content>")
|
||||
'''试错'''
|
||||
if pattern3.search(content):
|
||||
text = pattern3.search(content).groupdict()['content']
|
||||
else:
|
||||
text = '图片'
|
||||
if status == 5:
|
||||
message = '(未发出) ' + ''
|
||||
content_cell = self.create_table(doc, isSend)
|
||||
content_cell.paragraphs[0].add_run(title)
|
||||
content_cell.paragraphs[0].font_size = shared.Inches(0.5)
|
||||
reply_p = content_cell.add_paragraph()
|
||||
run = content_cell.paragraphs[1].add_run(displayname + ':' + text)
|
||||
'''设置被回复内容格式'''
|
||||
run.font.color.rgb = shared.RGBColor(121, 121, 121)
|
||||
run.font_size = shared.Inches(0.3)
|
||||
run.font.highlight_color = WD_COLOR_INDEX.GRAY_25
|
||||
|
||||
if isSend:
|
||||
p = content_cell.paragraphs[0]
|
||||
p.paragraph_format.alignment = WD_PARAGRAPH_ALIGNMENT.RIGHT
|
||||
reply_p.paragraph_format.alignment = WD_PARAGRAPH_ALIGNMENT.RIGHT
|
||||
doc.add_paragraph()
|
||||
|
||||
def pat_a_pat(self, doc, isSend, content, status):
|
||||
'''
|
||||
#! 添加拍一拍信息
|
||||
todo 把wxid转化成昵称
|
||||
:param isSend:
|
||||
:param content:
|
||||
:param status:
|
||||
:return:
|
||||
'''
|
||||
'''<template><![CDATA[我${fromusername@textstatusicon}拍了拍自己]]></template>'''
|
||||
pattern = re.compile(r"<template><!\[CDATA\[(?P<it>(.*?))]]></template>")
|
||||
result = pattern.search(content).groupdict()['it']
|
||||
fromusername = '${fromusername@textstatusicon}'
|
||||
pattedusername = '${pattedusername@textstatusicon}'
|
||||
'''我拍别人'''
|
||||
if result[0] == u'我':
|
||||
result = ''.join(result.split(fromusername))
|
||||
result = ''.join(result.split(pattedusername))
|
||||
pat = result
|
||||
else:
|
||||
'''处理多余的引号'''
|
||||
result = result.split('""') if '""' in result else result.split('"')
|
||||
for i in range(len(result)):
|
||||
if fromusername in result[i]:
|
||||
result[i] = result[i].rstrip(fromusername)
|
||||
elif pattedusername in result[i]:
|
||||
result[i] = result[i].rstrip(pattedusername)
|
||||
|
||||
if len(result) >= 4:
|
||||
'''别人拍别人
|
||||
#! ""${s407575157}${fromusername@textstatusicon}"" \
|
||||
#! 拍了拍 \
|
||||
#! ""${wxid_7rs401fwlaje22}${pattedusername@textstatusicon}"" \
|
||||
#! 的豪宅不小心塌了??
|
||||
#! [' ', wxid0, '拍了拍', wxid1, '内容']
|
||||
'''
|
||||
wxid0 = result[1].lstrip('${').rstrip('}') # ! 第一个人的wxid
|
||||
wxid1 = result[3].lstrip('${').rstrip('}') # ! 第二个人的wxid
|
||||
nickname0 = rcontact.wxid_to_conRemark(wxid0) # ! 将wxid转换成昵称
|
||||
nickname1 = rcontact.wxid_to_conRemark(wxid1) # ! 将wxid转换成昵称
|
||||
pat = nickname0 + result[2] + nickname1 # todo 留着把wxid转换成昵称
|
||||
if len(result) == 5:
|
||||
pat += result[4]
|
||||
else:
|
||||
'''#! ""${wxid_8piw6sb4hvfm22}"" 拍了拍我 '''
|
||||
'''
|
||||
#! 别人拍我
|
||||
#! [' ', wxid0, '拍了拍我']
|
||||
'''
|
||||
wxid0 = result[1].lstrip('${').rstrip('}')
|
||||
pat = wxid0 + result[2]
|
||||
print(pat)
|
||||
p = doc.add_paragraph()
|
||||
run = p.add_run(pat)
|
||||
p.paragraph_format.alignment = WD_PARAGRAPH_ALIGNMENT.CENTER
|
||||
'''设置拍一拍文字格式'''
|
||||
run.font.color.rgb = shared.RGBColor(121, 121, 121)
|
||||
run.font_size = shared.Inches(0.3)
|
||||
# run.font.highlight_color=WD_COLOR_INDEX.GRAY_25
|
||||
|
||||
def video(self, doc, isSend, content, status, img_path):
|
||||
print(content, img_path)
|
||||
|
||||
def to_docx(self, user_data, i, conRemark):
|
||||
'''
|
||||
|
||||
:param user_data:
|
||||
:param i:
|
||||
:param conRemark:
|
||||
:return:
|
||||
'''
|
||||
'''创建联系人目录'''
|
||||
mkdir(f"{path}/{conRemark}")
|
||||
filename = f"{path}/{conRemark}/{conRemark}{i}.docx"
|
||||
doc = docx.Document()
|
||||
now_timestamp = '1600008700000.0'
|
||||
for row_index, row in user_data.iterrows():
|
||||
self.num += 1
|
||||
self.bar.emit(int((self.num) / self.total_num * 100))
|
||||
Type = row['type']
|
||||
content = row['content']
|
||||
isSend = row['isSend']
|
||||
last_timestamp = now_timestamp
|
||||
now_timestamp = row['createTime']
|
||||
createTime = time_format(now_timestamp)
|
||||
imgPath = row['imgPath']
|
||||
status = row['status']
|
||||
if IS_5_min(last_timestamp, now_timestamp):
|
||||
doc.add_paragraph(createTime).alignment = WD_PARAGRAPH_ALIGNMENT.CENTER
|
||||
if Type == 1:
|
||||
# print('文本信息')
|
||||
# print(createTime, content)
|
||||
# continue
|
||||
self.text(doc, isSend, content, status)
|
||||
elif Type == 3:
|
||||
# print('图片信息')
|
||||
# continue
|
||||
self.image(doc, isSend, 3, content, imgPath)
|
||||
elif Type == 47:
|
||||
# print(content)
|
||||
print(imgPath, content)
|
||||
self.emoji(doc, isSend, content, imgPath)
|
||||
elif Type == 1090519089:
|
||||
self.wx_file(doc, isSend, content, status)
|
||||
elif Type == 268445456:
|
||||
self.retract_message(doc, isSend, content, status)
|
||||
elif Type == 822083633:
|
||||
self.reply(doc, isSend, content, status)
|
||||
elif Type == 922746929:
|
||||
self.pat_a_pat(doc, isSend, content, status)
|
||||
elif Type == 43:
|
||||
# print(createTime)
|
||||
self.video(doc, isSend, content, status, imgPath)
|
||||
# doc.add_paragraph(str(i))
|
||||
# print(filename)
|
||||
doc.save(filename)
|
||||
|
||||
def run(self):
|
||||
if 1:
|
||||
# try:
|
||||
self.get_avator()
|
||||
conRemark = self.ta_info['conRemark']
|
||||
self.self_text.emit(conRemark)
|
||||
self.self_text.emit(path)
|
||||
user_data = self.read_csv(conRemark)
|
||||
l = len(user_data)
|
||||
n = 50
|
||||
threads = []
|
||||
for i in range(n):
|
||||
q = i * (l // n)
|
||||
p = (i + 1) * (l // n)
|
||||
if i == n - 1:
|
||||
p = l
|
||||
data = user_data[q:p]
|
||||
self.to_docx(data, i, conRemark)
|
||||
# # t = threading.Thread(target=self.to_docx, args=(data, i, conRemark))
|
||||
# # threads.append(t)
|
||||
# # for thr in threads:
|
||||
# # thr.start()
|
||||
# # thr.join()
|
||||
self.self_text.emit('\n\n\n导出进度还差一点点!!!')
|
||||
self.bar.emit(99)
|
||||
merge_docx(conRemark, n)
|
||||
self.self_text.emit(f'{conRemark}聊天记录导出成功!!!')
|
||||
self.bar.emit(100)
|
||||
# except Exception as e:
|
||||
# self.self_text.emit('发生异常')
|
||||
# print(e)
|
||||
# self.self_text.emit(e)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# # conRemark = '张三' #! 微信备注名
|
||||
# n = 100 # ! 分割的文件个数
|
||||
# main(conRemark, n)
|
||||
# img_self.close()
|
||||
# img_ta.close()
|
||||
t = MyThread()
|
||||
# t.ta_info = {
|
||||
# 'wxid': 'wxid_q3ozn70pweud22',
|
||||
# 'conRemark': '小钱'
|
||||
# }
|
||||
t.ta_info = {
|
||||
'wxid': 'wxid_8piw6sb4hvfm22',
|
||||
'conRemark': '曹雨萱'
|
||||
}
|
||||
# wxid_8piw6sb4hvfm22
|
||||
t.self_info = {
|
||||
'wxid': 'wxid_27hqbq7vx5hf22',
|
||||
'conRemark': 'Shuaikang Zhou'
|
||||
}
|
||||
t.run()
|
@ -1,9 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@File : __init__.py.py
|
||||
@Author : Shuaikang Zhou
|
||||
@Time : 2022/12/24 10:34
|
||||
@IDE : Pycharm
|
||||
@Version : Python3.10
|
||||
@comment : ···
|
||||
"""
|
@ -1,89 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@File : addContact.py
|
||||
@Author : Shuaikang Zhou
|
||||
@Time : 2022/12/17 14:26
|
||||
@IDE : Pycharm
|
||||
@Version : Python3.10
|
||||
@comment : ···
|
||||
"""
|
||||
from .addContactUi import *
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtWidgets import *
|
||||
from PyQt5.QtCore import *
|
||||
from ....DB import data
|
||||
import time
|
||||
|
||||
|
||||
class addControl(QWidget, Ui_Dialog):
|
||||
backSignal = pyqtSignal(str)
|
||||
contactSignal = pyqtSignal(tuple)
|
||||
def __init__(self, username,parent=None):
|
||||
super(addControl, self).__init__(parent)
|
||||
self.setupUi(self)
|
||||
self.tips.setVisible(False)
|
||||
self.time.setVisible(False)
|
||||
self.setWindowTitle('添加联系人')
|
||||
self.setWindowIcon(QIcon('./data/icon.png'))
|
||||
self.Username = username
|
||||
# self.register_2.clicked.connect(self.login_)
|
||||
self.back.clicked.connect(self.btnEnterClicked)
|
||||
self.search.clicked.connect(self.search_user)
|
||||
self.add_contact.clicked.connect(self.add_contact_)
|
||||
self.avatar = None
|
||||
|
||||
def search_user(self):
|
||||
username = self.username.text()
|
||||
nickname = self.nickname.text()
|
||||
print(username,nickname)
|
||||
if data.searchUser(username):
|
||||
imgpath = data.get_avator(username)
|
||||
print(imgpath)
|
||||
pixmap = QPixmap(imgpath).scaled(60, 60) # 按指定路径找到图片
|
||||
self.avatar_img.setPixmap(pixmap) # 在label上显示图片
|
||||
else:
|
||||
self.error.setText('用户不存在')
|
||||
|
||||
def add_contact_(self):
|
||||
username = self.username.text()
|
||||
nickname = self.nickname.text()
|
||||
flag = data.add_contact(self.Username,username, nickname)
|
||||
if flag:
|
||||
self.error.setText('添加成功')
|
||||
self.contactSignal.emit(flag)
|
||||
self.thread = MyThread() # 创建一个线程
|
||||
self.thread.sec_changed_signal.connect(self._update) # 线程发过来的信号挂接到槽:update
|
||||
self.thread.start()
|
||||
else:
|
||||
QMessageBox.critical(self, "错误", "用户不存在")
|
||||
|
||||
|
||||
def _update(self, sec):
|
||||
self.time.setProperty("value", float(sec))
|
||||
# self.time.setDigitCount(sec)
|
||||
# self.time.s
|
||||
if sec == 0:
|
||||
self.btnEnterClicked()
|
||||
|
||||
def btnEnterClicked(self):
|
||||
print("退出添加联系人界面")
|
||||
# 中间可以添加处理逻辑
|
||||
self.backSignal.emit("back")
|
||||
self.close()
|
||||
|
||||
def btnExitClicked(self):
|
||||
print("Exit clicked")
|
||||
self.close()
|
||||
|
||||
|
||||
class MyThread(QThread):
|
||||
sec_changed_signal = pyqtSignal(int) # 信号类型:int
|
||||
|
||||
def __init__(self, sec=1000, parent=None):
|
||||
super().__init__(parent)
|
||||
self.sec = 2 # 默认1000秒
|
||||
|
||||
def run(self):
|
||||
for i in range(self.sec, -1, -1):
|
||||
self.sec_changed_signal.emit(i) # 发射信号
|
||||
time.sleep(1)
|
@ -1,98 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'addContactUi.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.7
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(400, 300)
|
||||
self.label_3 = QtWidgets.QLabel(Dialog)
|
||||
self.label_3.setGeometry(QtCore.QRect(120, 0, 221, 51))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("一纸情书")
|
||||
font.setPointSize(20)
|
||||
self.label_3.setFont(font)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.error = QtWidgets.QLabel(Dialog)
|
||||
self.error.setGeometry(QtCore.QRect(300, 70, 101, 16))
|
||||
self.error.setAutoFillBackground(False)
|
||||
self.error.setStyleSheet("color:red")
|
||||
self.error.setText("")
|
||||
self.error.setObjectName("error")
|
||||
self.time = QtWidgets.QLCDNumber(Dialog)
|
||||
self.time.setGeometry(QtCore.QRect(230, 230, 51, 61))
|
||||
self.time.setLineWidth(5)
|
||||
self.time.setDigitCount(1)
|
||||
self.time.setProperty("value", 8.0)
|
||||
self.time.setObjectName("time")
|
||||
self.tips = QtWidgets.QLabel(Dialog)
|
||||
self.tips.setGeometry(QtCore.QRect(140, 250, 61, 16))
|
||||
self.tips.setObjectName("tips")
|
||||
self.toolButton = QtWidgets.QToolButton(Dialog)
|
||||
self.toolButton.setGeometry(QtCore.QRect(360, 0, 47, 21))
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
self.back = QtWidgets.QPushButton(Dialog)
|
||||
self.back.setGeometry(QtCore.QRect(10, 10, 41, 28))
|
||||
self.back.setObjectName("back")
|
||||
self.avatar_img = QtWidgets.QLabel(Dialog)
|
||||
self.avatar_img.setGeometry(QtCore.QRect(310, 130, 80, 80))
|
||||
self.avatar_img.setObjectName("avatar_img")
|
||||
self.layoutWidget = QtWidgets.QWidget(Dialog)
|
||||
self.layoutWidget.setGeometry(QtCore.QRect(71, 63, 227, 155))
|
||||
self.layoutWidget.setObjectName("layoutWidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.label_2 = QtWidgets.QLabel(self.layoutWidget)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.horizontalLayout_2.addWidget(self.label_2)
|
||||
self.username = QtWidgets.QLineEdit(self.layoutWidget)
|
||||
self.username.setObjectName("username")
|
||||
self.horizontalLayout_2.addWidget(self.username)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.label_4 = QtWidgets.QLabel(self.layoutWidget)
|
||||
self.label_4.setMinimumSize(QtCore.QSize(38, 21))
|
||||
self.label_4.setMaximumSize(QtCore.QSize(38, 21))
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.horizontalLayout_4.addWidget(self.label_4)
|
||||
self.nickname = QtWidgets.QLineEdit(self.layoutWidget)
|
||||
self.nickname.setMinimumSize(QtCore.QSize(0, 0))
|
||||
self.nickname.setMaximumSize(QtCore.QSize(100000, 10000))
|
||||
self.nickname.setObjectName("nickname")
|
||||
self.horizontalLayout_4.addWidget(self.nickname)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_4)
|
||||
self.search = QtWidgets.QPushButton(self.layoutWidget)
|
||||
self.search.setObjectName("search")
|
||||
self.verticalLayout.addWidget(self.search)
|
||||
self.add_contact = QtWidgets.QPushButton(self.layoutWidget)
|
||||
self.add_contact.setObjectName("add_contact")
|
||||
self.verticalLayout.addWidget(self.add_contact)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.label_3.setText(_translate("Dialog", "添加好友"))
|
||||
self.tips.setText(_translate("Dialog", "即将返回"))
|
||||
self.toolButton.setText(_translate("Dialog", "..."))
|
||||
self.back.setText(_translate("Dialog", "返回"))
|
||||
self.avatar_img.setText(_translate("Dialog", "+"))
|
||||
self.label_2.setText(_translate("Dialog", "账号:"))
|
||||
self.label_4.setText(_translate("Dialog", "备注:"))
|
||||
self.search.setText(_translate("Dialog", "查找"))
|
||||
self.add_contact.setText(_translate("Dialog", "添加联系人"))
|
@ -1,207 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>0</y>
|
||||
<width>221</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>一纸情书</family>
|
||||
<pointsize>20</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>添加好友</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="error">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>300</x>
|
||||
<y>70</y>
|
||||
<width>101</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color:red</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLCDNumber" name="time">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>230</x>
|
||||
<y>230</y>
|
||||
<width>51</width>
|
||||
<height>61</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="digitCount">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value" stdset="0">
|
||||
<double>8.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="tips">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>140</x>
|
||||
<y>250</y>
|
||||
<width>61</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>即将返回</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>360</x>
|
||||
<y>0</y>
|
||||
<width>47</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="back">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>41</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>返回</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="avatar_img">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>310</x>
|
||||
<y>130</y>
|
||||
<width>80</width>
|
||||
<height>80</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>71</x>
|
||||
<y>63</y>
|
||||
<width>227</width>
|
||||
<height>155</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>账号:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="username"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>38</width>
|
||||
<height>21</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>38</width>
|
||||
<height>21</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>备注:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="nickname">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100000</width>
|
||||
<height>10000</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="search">
|
||||
<property name="text">
|
||||
<string>查找</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="add_contact">
|
||||
<property name="text">
|
||||
<string>添加联系人</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,143 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'mainviewUi.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.7
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(1280, 720)
|
||||
Dialog.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
|
||||
Dialog.setAutoFillBackground(False)
|
||||
self.sign_up = QtWidgets.QPushButton(Dialog)
|
||||
self.sign_up.setGeometry(QtCore.QRect(680, 10, 93, 28))
|
||||
self.sign_up.setObjectName("sign_up")
|
||||
self.message = QtWidgets.QTextBrowser(Dialog)
|
||||
self.message.setGeometry(QtCore.QRect(480, 50, 780, 520))
|
||||
self.message.setObjectName("message")
|
||||
self.textEdit = QtWidgets.QTextEdit(Dialog)
|
||||
self.textEdit.setGeometry(QtCore.QRect(480, 600, 800, 120))
|
||||
self.textEdit.setObjectName("textEdit")
|
||||
self.toolButton = QtWidgets.QToolButton(Dialog)
|
||||
self.toolButton.setGeometry(QtCore.QRect(1240, 0, 47, 51))
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
self.btn_sendMsg = QtWidgets.QPushButton(Dialog)
|
||||
self.btn_sendMsg.setGeometry(QtCore.QRect(1162, 670, 121, 51))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("黑体")
|
||||
font.setPointSize(15)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.btn_sendMsg.setFont(font)
|
||||
self.btn_sendMsg.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
|
||||
self.btn_sendMsg.setMouseTracking(False)
|
||||
self.btn_sendMsg.setAutoFillBackground(False)
|
||||
self.btn_sendMsg.setStyleSheet("QPushButton {\n"
|
||||
" background-color: #f0f0f0;\n"
|
||||
" \n"
|
||||
" padding: 10px;\n"
|
||||
" color:rgb(5,180,104);\n"
|
||||
"}")
|
||||
self.btn_sendMsg.setIconSize(QtCore.QSize(40, 40))
|
||||
self.btn_sendMsg.setCheckable(False)
|
||||
self.btn_sendMsg.setAutoDefault(True)
|
||||
self.btn_sendMsg.setObjectName("btn_sendMsg")
|
||||
self.line = QtWidgets.QFrame(Dialog)
|
||||
self.line.setGeometry(QtCore.QRect(480, 570, 800, 3))
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.line_2 = QtWidgets.QFrame(Dialog)
|
||||
self.line_2.setGeometry(QtCore.QRect(480, 50, 800, 3))
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_2.setObjectName("line_2")
|
||||
self.line_3 = QtWidgets.QFrame(Dialog)
|
||||
self.line_3.setGeometry(QtCore.QRect(480, 0, 3, 720))
|
||||
self.line_3.setFrameShape(QtWidgets.QFrame.VLine)
|
||||
self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_3.setObjectName("line_3")
|
||||
self.verticalScrollBar = QtWidgets.QScrollBar(Dialog)
|
||||
self.verticalScrollBar.setGeometry(QtCore.QRect(460, 50, 16, 671))
|
||||
self.verticalScrollBar.setOrientation(QtCore.Qt.Vertical)
|
||||
self.verticalScrollBar.setObjectName("verticalScrollBar")
|
||||
self.verticalScrollBar_2 = QtWidgets.QScrollBar(Dialog)
|
||||
self.verticalScrollBar_2.setGeometry(QtCore.QRect(1260, 50, 16, 520))
|
||||
self.verticalScrollBar_2.setStyleSheet("background-color: #f0f0f0;")
|
||||
self.verticalScrollBar_2.setOrientation(QtCore.Qt.Vertical)
|
||||
self.verticalScrollBar_2.setObjectName("verticalScrollBar_2")
|
||||
self.pushButton_2 = QtWidgets.QPushButton(Dialog)
|
||||
self.pushButton_2.setGeometry(QtCore.QRect(160, 50, 300, 80))
|
||||
self.pushButton_2.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.pushButton_2.setAutoFillBackground(False)
|
||||
self.pushButton_2.setText("")
|
||||
self.pushButton_2.setIconSize(QtCore.QSize(80, 80))
|
||||
self.pushButton_2.setObjectName("pushButton_2")
|
||||
self.verticalLayoutWidget = QtWidgets.QWidget(Dialog)
|
||||
self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 160, 111, 562))
|
||||
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
|
||||
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_2.setSpacing(0)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.btn_chat = QtWidgets.QPushButton(self.verticalLayoutWidget)
|
||||
self.btn_chat.setMinimumSize(QtCore.QSize(0, 80))
|
||||
self.btn_chat.setObjectName("btn_chat")
|
||||
self.verticalLayout_2.addWidget(self.btn_chat)
|
||||
self.btn_contact = QtWidgets.QPushButton(self.verticalLayoutWidget)
|
||||
self.btn_contact.setMinimumSize(QtCore.QSize(0, 80))
|
||||
self.btn_contact.setObjectName("btn_contact")
|
||||
self.verticalLayout_2.addWidget(self.btn_contact)
|
||||
self.btn_addC = QtWidgets.QPushButton(self.verticalLayoutWidget)
|
||||
self.btn_addC.setMinimumSize(QtCore.QSize(0, 80))
|
||||
self.btn_addC.setObjectName("btn_addC")
|
||||
self.verticalLayout_2.addWidget(self.btn_addC)
|
||||
self.btn_delC = QtWidgets.QPushButton(self.verticalLayoutWidget)
|
||||
self.btn_delC.setMinimumSize(QtCore.QSize(0, 80))
|
||||
self.btn_delC.setObjectName("btn_delC")
|
||||
self.verticalLayout_2.addWidget(self.btn_delC)
|
||||
self.btn_create_group = QtWidgets.QPushButton(self.verticalLayoutWidget)
|
||||
self.btn_create_group.setMinimumSize(QtCore.QSize(0, 80))
|
||||
self.btn_create_group.setObjectName("btn_create_group")
|
||||
self.verticalLayout_2.addWidget(self.btn_create_group)
|
||||
self.btn_add_group = QtWidgets.QPushButton(self.verticalLayoutWidget)
|
||||
self.btn_add_group.setMinimumSize(QtCore.QSize(0, 80))
|
||||
self.btn_add_group.setObjectName("btn_add_group")
|
||||
self.verticalLayout_2.addWidget(self.btn_add_group)
|
||||
self.pushButton_6 = QtWidgets.QPushButton(self.verticalLayoutWidget)
|
||||
self.pushButton_6.setMinimumSize(QtCore.QSize(100, 80))
|
||||
self.pushButton_6.setObjectName("pushButton_6")
|
||||
self.verticalLayout_2.addWidget(self.pushButton_6)
|
||||
self.verticalLayout_2.setStretch(0, 1)
|
||||
self.verticalLayout_2.setStretch(2, 1)
|
||||
self.verticalLayout_2.setStretch(3, 1)
|
||||
self.verticalLayout_2.setStretch(6, 1)
|
||||
self.myavatar = QtWidgets.QLabel(Dialog)
|
||||
self.myavatar.setGeometry(QtCore.QRect(10, 30, 100, 100))
|
||||
self.myavatar.setObjectName("myavatar")
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.sign_up.setText(_translate("Dialog", "退出登录"))
|
||||
self.toolButton.setText(_translate("Dialog", "..."))
|
||||
self.btn_sendMsg.setText(_translate("Dialog", "发送"))
|
||||
self.btn_chat.setText(_translate("Dialog", "聊天"))
|
||||
self.btn_contact.setText(_translate("Dialog", "联系人"))
|
||||
self.btn_addC.setText(_translate("Dialog", "添加联系人"))
|
||||
self.btn_delC.setText(_translate("Dialog", "删除联系人"))
|
||||
self.btn_create_group.setText(_translate("Dialog", "建群"))
|
||||
self.btn_add_group.setText(_translate("Dialog", "加群"))
|
||||
self.pushButton_6.setText(_translate("Dialog", "设置"))
|
||||
self.myavatar.setText(_translate("Dialog", "avatar"))
|
@ -1,845 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1280</width>
|
||||
<height>720</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>ArrowCursor</cursorShape>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>580</x>
|
||||
<y>570</y>
|
||||
<width>93</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextBrowser" name="textBrowser">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>480</x>
|
||||
<y>50</y>
|
||||
<width>800</width>
|
||||
<height>520</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextEdit" name="textEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>480</x>
|
||||
<y>600</y>
|
||||
<width>800</width>
|
||||
<height>120</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1240</x>
|
||||
<y>0</y>
|
||||
<width>47</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="sendMsg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1162</x>
|
||||
<y>670</y>
|
||||
<width>121</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>黑体</family>
|
||||
<pointsize>15</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>ArrowCursor</cursorShape>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
background-color: #f0f0f0;
|
||||
border: 1px solid #dcdfe6;
|
||||
padding: 10px;
|
||||
color:rgb(5,180,104);
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>发送</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line" name="line">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>480</x>
|
||||
<y>570</y>
|
||||
<width>800</width>
|
||||
<height>3</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>480</x>
|
||||
<y>50</y>
|
||||
<width>800</width>
|
||||
<height>3</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>480</x>
|
||||
<y>0</y>
|
||||
<width>3</width>
|
||||
<height>720</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>370</y>
|
||||
<width>411</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5" rowstretch="5,3" columnstretch="1,3,1">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="time0_5">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>昨天</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="remark1_5">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>司小远</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="image5">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #ffffff;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLabel" name="msg1_5">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>我没去</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>290</y>
|
||||
<width>411</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6" rowstretch="5,3" columnstretch="1,3,1">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="time0_4">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>昨天</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="remark1_6">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>司小远</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="image4">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #ffffff;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLabel" name="msg1_6">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>我没去</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>210</y>
|
||||
<width>411</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_9" rowstretch="5,3" columnstretch="1,3,1">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="time0_3">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>昨天</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="remark1_9">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>司小远</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="image3">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #ffffff;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLabel" name="msg1_9">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>我没去</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget_5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>130</y>
|
||||
<width>411</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_10" rowstretch="5,3" columnstretch="1,3,1">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="time0_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>昨天</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="remark2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>司小远</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="image2">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #ffffff;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLabel" name="msg2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>我没去</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>450</y>
|
||||
<width>411</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_12" rowstretch="5,3" columnstretch="1,3,1">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="time0_6">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>昨天</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="remark1_12">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>司小远</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="image6">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #ffffff;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLabel" name="msg1_12">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>我没去</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>530</y>
|
||||
<width>411</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_8" rowstretch="5,3" columnstretch="1,3,1">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="time0_7">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>昨天</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="remark1_8">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>司小远</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="image7">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #ffffff;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLabel" name="msg1_8">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>我没去</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>610</y>
|
||||
<width>411</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_13" rowstretch="5,3" columnstretch="1,3,1">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="time0_8">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>昨天</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="remark1_13">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>司小远</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="image8">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #ffffff;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLabel" name="msg1_13">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>我没去</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QScrollBar" name="verticalScrollBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>460</x>
|
||||
<y>50</y>
|
||||
<width>16</width>
|
||||
<height>671</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QScrollBar" name="verticalScrollBar_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1260</x>
|
||||
<y>50</y>
|
||||
<width>16</width>
|
||||
<height>520</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #f0f0f0;</string>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<y>50</y>
|
||||
<width>411</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout" rowstretch="5,3" columnstretch="1,3,1">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="time0_1">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>昨天</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="remark1">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>司小远</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="image1">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #ffffff;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLabel" name="msg1">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>我没去</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,184 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'chatUi.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.7
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(1280, 720)
|
||||
Dialog.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
|
||||
Dialog.setAutoFillBackground(False)
|
||||
self.pushButton = QtWidgets.QPushButton(Dialog)
|
||||
self.pushButton.setGeometry(QtCore.QRect(580, 570, 93, 28))
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.textBrowser = QtWidgets.QTextBrowser(Dialog)
|
||||
self.textBrowser.setGeometry(QtCore.QRect(480, 50, 800, 520))
|
||||
self.textBrowser.setObjectName("textBrowser")
|
||||
self.textEdit = QtWidgets.QTextEdit(Dialog)
|
||||
self.textEdit.setGeometry(QtCore.QRect(480, 600, 800, 120))
|
||||
self.textEdit.setObjectName("textEdit")
|
||||
self.toolButton = QtWidgets.QToolButton(Dialog)
|
||||
self.toolButton.setGeometry(QtCore.QRect(1240, 0, 47, 51))
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
self.sendMsg = QtWidgets.QPushButton(Dialog)
|
||||
self.sendMsg.setGeometry(QtCore.QRect(1162, 670, 121, 51))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("黑体")
|
||||
font.setPointSize(15)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.sendMsg.setFont(font)
|
||||
self.sendMsg.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
|
||||
self.sendMsg.setMouseTracking(False)
|
||||
self.sendMsg.setAutoFillBackground(False)
|
||||
self.sendMsg.setStyleSheet("QPushButton {\n"
|
||||
" background-color: #f0f0f0;\n"
|
||||
" \n"
|
||||
" padding: 10px;\n"
|
||||
" color:rgb(5,180,104);\n"
|
||||
"}")
|
||||
self.sendMsg.setIconSize(QtCore.QSize(40, 40))
|
||||
self.sendMsg.setCheckable(False)
|
||||
self.sendMsg.setAutoDefault(True)
|
||||
self.sendMsg.setObjectName("sendMsg")
|
||||
self.line = QtWidgets.QFrame(Dialog)
|
||||
self.line.setGeometry(QtCore.QRect(480, 570, 800, 3))
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.line_2 = QtWidgets.QFrame(Dialog)
|
||||
self.line_2.setGeometry(QtCore.QRect(480, 50, 800, 3))
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_2.setObjectName("line_2")
|
||||
self.line_3 = QtWidgets.QFrame(Dialog)
|
||||
self.line_3.setGeometry(QtCore.QRect(480, 0, 3, 720))
|
||||
self.line_3.setFrameShape(QtWidgets.QFrame.VLine)
|
||||
self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line_3.setObjectName("line_3")
|
||||
self.verticalScrollBar = QtWidgets.QScrollBar(Dialog)
|
||||
self.verticalScrollBar.setGeometry(QtCore.QRect(460, 50, 16, 671))
|
||||
self.verticalScrollBar.setOrientation(QtCore.Qt.Vertical)
|
||||
self.verticalScrollBar.setObjectName("verticalScrollBar")
|
||||
self.verticalScrollBar_2 = QtWidgets.QScrollBar(Dialog)
|
||||
self.verticalScrollBar_2.setGeometry(QtCore.QRect(1260, 50, 16, 520))
|
||||
self.verticalScrollBar_2.setStyleSheet("background-color: #f0f0f0;")
|
||||
self.verticalScrollBar_2.setOrientation(QtCore.Qt.Vertical)
|
||||
self.verticalScrollBar_2.setObjectName("verticalScrollBar_2")
|
||||
self.pushButton_2 = QtWidgets.QPushButton(Dialog)
|
||||
self.pushButton_2.setGeometry(QtCore.QRect(160, 50, 300, 80))
|
||||
self.pushButton_2.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.pushButton_2.setAutoFillBackground(False)
|
||||
self.pushButton_2.setText("")
|
||||
self.pushButton_2.setIconSize(QtCore.QSize(80, 80))
|
||||
self.pushButton_2.setObjectName("pushButton_2")
|
||||
self.layoutWidget = QtWidgets.QWidget(Dialog)
|
||||
self.layoutWidget.setGeometry(QtCore.QRect(150, 200, 318, 81))
|
||||
self.layoutWidget.setObjectName("layoutWidget")
|
||||
self.gridLayout1 = QtWidgets.QGridLayout(self.layoutWidget)
|
||||
self.gridLayout1.setSizeConstraint(QtWidgets.QLayout.SetMaximumSize)
|
||||
self.gridLayout1.setContentsMargins(10, 10, 10, 10)
|
||||
self.gridLayout1.setSpacing(10)
|
||||
self.gridLayout1.setObjectName("gridLayout1")
|
||||
self.label_time = QtWidgets.QLabel(self.layoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(8)
|
||||
self.label_time.setFont(font)
|
||||
self.label_time.setLayoutDirection(QtCore.Qt.RightToLeft)
|
||||
self.label_time.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.label_time.setObjectName("label_time")
|
||||
self.gridLayout1.addWidget(self.label_time, 0, 2, 1, 1)
|
||||
self.label_remark = QtWidgets.QLabel(self.layoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Adobe 黑体 Std R")
|
||||
font.setPointSize(10)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.label_remark.setFont(font)
|
||||
self.label_remark.setObjectName("label_remark")
|
||||
self.gridLayout1.addWidget(self.label_remark, 0, 1, 1, 1)
|
||||
self.label_msg = QtWidgets.QLabel(self.layoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(8)
|
||||
self.label_msg.setFont(font)
|
||||
self.label_msg.setObjectName("label_msg")
|
||||
self.gridLayout1.addWidget(self.label_msg, 1, 1, 1, 2)
|
||||
self.label_avatar = QtWidgets.QLabel(self.layoutWidget)
|
||||
self.label_avatar.setMinimumSize(QtCore.QSize(60, 60))
|
||||
self.label_avatar.setMaximumSize(QtCore.QSize(60, 60))
|
||||
self.label_avatar.setLayoutDirection(QtCore.Qt.RightToLeft)
|
||||
self.label_avatar.setAutoFillBackground(False)
|
||||
self.label_avatar.setStyleSheet("background-color: #ffffff;")
|
||||
self.label_avatar.setInputMethodHints(QtCore.Qt.ImhNone)
|
||||
self.label_avatar.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.label_avatar.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.label_avatar.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.label_avatar.setObjectName("label_avatar")
|
||||
self.gridLayout1.addWidget(self.label_avatar, 0, 0, 2, 1)
|
||||
self.gridLayout1.setColumnStretch(0, 1)
|
||||
self.gridLayout1.setColumnStretch(1, 6)
|
||||
self.gridLayout1.setRowStretch(0, 5)
|
||||
self.gridLayout1.setRowStretch(1, 3)
|
||||
self.verticalLayoutWidget = QtWidgets.QWidget(Dialog)
|
||||
self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 160, 111, 402))
|
||||
self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
|
||||
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout_2.setSpacing(0)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.btn_msg = QtWidgets.QPushButton(self.verticalLayoutWidget)
|
||||
self.btn_msg.setMinimumSize(QtCore.QSize(0, 80))
|
||||
self.btn_msg.setObjectName("btn_msg")
|
||||
self.verticalLayout_2.addWidget(self.btn_msg)
|
||||
self.btn_contact = QtWidgets.QPushButton(self.verticalLayoutWidget)
|
||||
self.btn_contact.setMinimumSize(QtCore.QSize(0, 80))
|
||||
self.btn_contact.setObjectName("btn_contact")
|
||||
self.verticalLayout_2.addWidget(self.btn_contact)
|
||||
self.btn_addC = QtWidgets.QPushButton(self.verticalLayoutWidget)
|
||||
self.btn_addC.setMinimumSize(QtCore.QSize(0, 80))
|
||||
self.btn_addC.setObjectName("btn_addC")
|
||||
self.verticalLayout_2.addWidget(self.btn_addC)
|
||||
self.btn_delC = QtWidgets.QPushButton(self.verticalLayoutWidget)
|
||||
self.btn_delC.setMinimumSize(QtCore.QSize(0, 80))
|
||||
self.btn_delC.setObjectName("btn_delC")
|
||||
self.verticalLayout_2.addWidget(self.btn_delC)
|
||||
self.pushButton_6 = QtWidgets.QPushButton(self.verticalLayoutWidget)
|
||||
self.pushButton_6.setMinimumSize(QtCore.QSize(100, 80))
|
||||
self.pushButton_6.setObjectName("pushButton_6")
|
||||
self.verticalLayout_2.addWidget(self.pushButton_6)
|
||||
self.verticalLayout_2.setStretch(0, 1)
|
||||
self.verticalLayout_2.setStretch(2, 1)
|
||||
self.verticalLayout_2.setStretch(3, 1)
|
||||
self.verticalLayout_2.setStretch(4, 1)
|
||||
self.myavatar = QtWidgets.QLabel(Dialog)
|
||||
self.myavatar.setGeometry(QtCore.QRect(10, 30, 100, 100))
|
||||
self.myavatar.setObjectName("myavatar")
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
||||
self.pushButton.setText(_translate("Dialog", "PushButton"))
|
||||
self.toolButton.setText(_translate("Dialog", "..."))
|
||||
self.sendMsg.setText(_translate("Dialog", "发送"))
|
||||
self.label_time.setText(_translate("Dialog", "22/12/17"))
|
||||
self.label_remark.setText(_translate("Dialog", "西北工业大学财务处"))
|
||||
self.label_msg.setText(_translate("Dialog", "我没去"))
|
||||
self.label_avatar.setText(_translate("Dialog", "TextLabel"))
|
||||
self.btn_msg.setText(_translate("Dialog", "聊天"))
|
||||
self.btn_contact.setText(_translate("Dialog", "联系人"))
|
||||
self.btn_addC.setText(_translate("Dialog", "添加联系人"))
|
||||
self.btn_delC.setText(_translate("Dialog", "删除联系人"))
|
||||
self.pushButton_6.setText(_translate("Dialog", "设置"))
|
||||
self.myavatar.setText(_translate("Dialog", "avatar"))
|
@ -1,422 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Dialog</class>
|
||||
<widget class="QDialog" name="Dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1280</width>
|
||||
<height>720</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>ArrowCursor</cursorShape>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>580</x>
|
||||
<y>570</y>
|
||||
<width>93</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextBrowser" name="textBrowser">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>480</x>
|
||||
<y>50</y>
|
||||
<width>800</width>
|
||||
<height>520</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextEdit" name="textEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>480</x>
|
||||
<y>600</y>
|
||||
<width>800</width>
|
||||
<height>120</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1240</x>
|
||||
<y>0</y>
|
||||
<width>47</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="sendMsg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1162</x>
|
||||
<y>670</y>
|
||||
<width>121</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>黑体</family>
|
||||
<pointsize>15</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>ArrowCursor</cursorShape>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
background-color: #f0f0f0;
|
||||
|
||||
padding: 10px;
|
||||
color:rgb(5,180,104);
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>发送</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line" name="line">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>480</x>
|
||||
<y>570</y>
|
||||
<width>800</width>
|
||||
<height>3</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>480</x>
|
||||
<y>50</y>
|
||||
<width>800</width>
|
||||
<height>3</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line" name="line_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>480</x>
|
||||
<y>0</y>
|
||||
<width>3</width>
|
||||
<height>720</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QScrollBar" name="verticalScrollBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>460</x>
|
||||
<y>50</y>
|
||||
<width>16</width>
|
||||
<height>671</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QScrollBar" name="verticalScrollBar_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>1260</x>
|
||||
<y>50</y>
|
||||
<width>16</width>
|
||||
<height>520</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #f0f0f0;</string>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>160</x>
|
||||
<y>50</y>
|
||||
<width>300</width>
|
||||
<height>80</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>150</x>
|
||||
<y>200</y>
|
||||
<width>318</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout1" rowstretch="5,3" columnstretch="1,6,0" rowminimumheight="0,0" columnminimumwidth="0,0,0">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMaximumSize</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_time">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>22/12/17</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_remark">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Adobe 黑体 Std R</family>
|
||||
<pointsize>10</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>西北工业大学财务处</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLabel" name="label_msg">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>我没去</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="label_avatar">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>60</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: #ffffff;</string>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhNone</set>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>160</y>
|
||||
<width>111</width>
|
||||
<height>402</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,0,1,1,1">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_msg">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>聊天</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_contact">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>联系人</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_addC">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>添加联系人</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_delC">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>删除联系人</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_6">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>设置</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QLabel" name="myavatar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>100</width>
|
||||
<height>100</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>avatar</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,11 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@File : mainview.py
|
||||
@File : chat.py
|
||||
@Author : Shuaikang Zhou
|
||||
@Time : 2022/12/13 15:07
|
||||
@Time : 2022/12/13 17:07
|
||||
@IDE : Pycharm
|
||||
@Version : Python3.10
|
||||
@comment : ···
|
||||
@comment : 聊天窗口
|
||||
"""
|
||||
import datetime
|
||||
import time
|
||||
@ -58,15 +58,6 @@ class ChatController(QWidget, Ui_Dialog):
|
||||
self.message.setOpenExternalLinks(False)
|
||||
# self.message.anchorClicked(self.hyperlink())
|
||||
self.message.anchorClicked.connect(self.hyperlink)
|
||||
self.textEdit = myTextEdit(self.frame)
|
||||
self.textEdit.setGeometry(QtCore.QRect(9, 580, 821, 141))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(15)
|
||||
self.textEdit.setFont(font)
|
||||
self.textEdit.setTabStopWidth(80)
|
||||
self.textEdit.setCursorWidth(1)
|
||||
self.textEdit.setObjectName("textEdit")
|
||||
self.textEdit.sendSignal.connect(self.sendMsg)
|
||||
self.btn_sendMsg = QtWidgets.QPushButton(self.frame)
|
||||
self.btn_sendMsg.setGeometry(QtCore.QRect(680, 670, 121, 51))
|
||||
font = QtGui.QFont()
|
||||
@ -177,9 +168,6 @@ class ChatController(QWidget, Ui_Dialog):
|
||||
print(pos)
|
||||
self.message.verticalScrollBar().setValue(pos)
|
||||
|
||||
def sendMsg(self, msg):
|
||||
pass
|
||||
|
||||
def check_time(self, msg_time):
|
||||
"""
|
||||
判断两次聊天时间是否大于五分钟
|
||||
@ -338,9 +326,12 @@ class ChatController(QWidget, Ui_Dialog):
|
||||
''' % (content)
|
||||
self.left(html)
|
||||
|
||||
|
||||
|
||||
def hyperlink(self, url: QUrl):
|
||||
"""
|
||||
超链接,点击之后放大显示图片
|
||||
:param url:
|
||||
:return:
|
||||
"""
|
||||
path = data.clearImagePath(url.path())
|
||||
print(url.path(), path)
|
||||
self.imagebox = MainDemo()
|
||||
@ -540,7 +531,7 @@ class Contact(QtWidgets.QPushButton):
|
||||
|
||||
class ChatMsg(QThread):
|
||||
"""
|
||||
发送信息线程
|
||||
多线程显示信息
|
||||
"""
|
||||
isSend_signal = pyqtSignal(tuple)
|
||||
okSignal = pyqtSignal(int)
|
||||
@ -571,11 +562,15 @@ class myTextEdit(QtWidgets.QTextEdit): # 继承 原本组件
|
||||
self.parent = parent
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
self.setHtml(_translate("Dialog",
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" "
|
||||
"\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'SimSun\'; font-size:15pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>"))
|
||||
"</style></head><body style=\" font-family:\'SimSun\'; font-size:15pt; "
|
||||
"font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; "
|
||||
"margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br "
|
||||
"/></p></body></html>"))
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
QtWidgets.QTextEdit.keyPressEvent(self, event)
|
||||
@ -587,7 +582,3 @@ class myTextEdit(QtWidgets.QTextEdit): # 继承 原本组件
|
||||
return
|
||||
self.sendSignal.emit(self.toPlainText())
|
||||
print('success press enter key', self.toPlainText())
|
||||
|
||||
# if modifiers == (Qt.ControlModifier) and event.key() == Qt.Key_Return:
|
||||
# self.sendSignal.emit(self.toPlainText())
|
||||
# print('success press enter key', self.toPlainText())
|
||||
|
@ -1,107 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@File : CreateGroup.py
|
||||
@Author : Shuaikang Zhou
|
||||
@Time : 2022/12/20 22:55
|
||||
@IDE : Pycharm
|
||||
@Version : Python3.10
|
||||
@comment : ···
|
||||
"""
|
||||
from .create_groupUi import *
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtWidgets import *
|
||||
from PyQt5.QtCore import *
|
||||
from ....DB import data
|
||||
import time
|
||||
|
||||
|
||||
class CreateGroupView(QWidget, Ui_Frame):
|
||||
backSignal = pyqtSignal(str)
|
||||
gidSignal = pyqtSignal(int)
|
||||
def __init__(self, username, parent=None):
|
||||
super(CreateGroupView, self).__init__(parent)
|
||||
self.setupUi(self)
|
||||
self.tips.setVisible(False)
|
||||
self.setWindowTitle('创建群聊')
|
||||
self.setWindowIcon(QIcon('./data/icon.png'))
|
||||
self.username = username
|
||||
# self.register_2.clicked.connect(self.login_)
|
||||
self.back.clicked.connect(self.btnEnterClicked)
|
||||
self.back.clicked.connect(self.btnEnterClicked)
|
||||
self.btn_set_gAvatar.clicked.connect(self.up_avatar)
|
||||
self.btn_create.clicked.connect(self.create_group)
|
||||
self.avatar = None
|
||||
|
||||
def up_avatar(self):
|
||||
path, _ = QFileDialog.getOpenFileName(self, 'Open file', r'..', "Image files (*.png;*.jpg)")
|
||||
if path:
|
||||
try:
|
||||
pixmap = QPixmap(path).scaled(80, 80) # 按指定路径找到图片
|
||||
self.avatar_img.setPixmap(pixmap) # 在label上显示图片
|
||||
self.avatar = path
|
||||
except:
|
||||
self.error.setText('头像不存在')
|
||||
|
||||
def create_group(self):
|
||||
# self.close()
|
||||
if not self.avatar:
|
||||
self.error.setText('请上传头像')
|
||||
return False
|
||||
name = self.group_name.text()
|
||||
intro = self.group_intro.toPlainText()
|
||||
# print(intro,self.username)
|
||||
flag = data.create_group(
|
||||
g_name=name,
|
||||
g_admin=self.username,
|
||||
g_intro=intro
|
||||
)
|
||||
# print('123456')
|
||||
# print(flag)
|
||||
if not flag:
|
||||
self.error.setText('创建失败')
|
||||
# print('yonghu已经存在')
|
||||
else:
|
||||
self.error.setText('创建成功')
|
||||
self.error.setStyleSheet("color:black")
|
||||
avatar = data.get_avator(str(flag))
|
||||
# new_path = '/'.join(avatar.split('/')[:-1])+'/'
|
||||
# print(avatar)
|
||||
if '.' in avatar[-10:]:
|
||||
avatar = '.'.join(avatar.split('.')[:-1])
|
||||
# print(avatar)
|
||||
data.mycopyfile(self.avatar, avatar + '.png')
|
||||
self.tips.setVisible(True)
|
||||
self.thread = MyThread() # 创建一个线程
|
||||
self.thread.sec_changed_signal.connect(self._update) # 线程发过来的信号挂接到槽:update
|
||||
self.thread.start()
|
||||
self.gidSignal.emit(int(flag))
|
||||
|
||||
def _update(self, sec):
|
||||
# self.time.setProperty("value", float(sec))
|
||||
# self.time.setDigitCount(sec)
|
||||
# self.time.s
|
||||
if sec == 0:
|
||||
self.btnEnterClicked()
|
||||
|
||||
def btnEnterClicked(self):
|
||||
print("退出创建群聊界面")
|
||||
# 中间可以添加处理逻辑
|
||||
self.backSignal.emit("back")
|
||||
self.close()
|
||||
|
||||
def btnExitClicked(self):
|
||||
print("Exit clicked")
|
||||
self.close()
|
||||
|
||||
|
||||
class MyThread(QThread):
|
||||
sec_changed_signal = pyqtSignal(int) # 信号类型:int
|
||||
|
||||
def __init__(self, sec=1000, parent=None):
|
||||
super().__init__(parent)
|
||||
self.sec = 2 # 默认1000秒
|
||||
|
||||
def run(self):
|
||||
for i in range(self.sec, -1, -1):
|
||||
self.sec_changed_signal.emit(i) # 发射信号
|
||||
time.sleep(1)
|
@ -1,442 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@File : Group.py
|
||||
@Author : Shuaikang Zhou
|
||||
@Time : 2022/12/20 20:26
|
||||
@IDE : Pycharm
|
||||
@Version : Python3.10
|
||||
@comment : ···
|
||||
"""
|
||||
import datetime
|
||||
import json
|
||||
|
||||
from .GroupUi import *
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtWidgets import *
|
||||
from PyQt5.QtCore import *
|
||||
from ....DB import data
|
||||
import time
|
||||
# from .chat import MainWinController
|
||||
from .create_groupUi import Ui_Frame
|
||||
from .CreateGroup import CreateGroupView
|
||||
from .addGroup import Ui_Frame as Add_GroupUi
|
||||
|
||||
|
||||
class GroupControl(QWidget, Ui_Form):
|
||||
backSignal = pyqtSignal(str)
|
||||
addSignal = pyqtSignal(int)
|
||||
|
||||
# createSignal = pyqtSignal(Group)
|
||||
|
||||
def __init__(self, parent=None, Me=None):
|
||||
super(GroupControl, self).__init__(parent)
|
||||
self.groups = None
|
||||
self.setupUi(self)
|
||||
self.Me = Me
|
||||
self.btn_create_group.clicked.connect(self.create_group_view)
|
||||
self.btn_add_group.clicked.connect(self.addGroupUi)
|
||||
self.btn_sendMsg.clicked.connect(self.sendMsg) # 发送信息按钮
|
||||
self.btn_del_group.clicked.connect(self.delete_group)
|
||||
self.toolButton.clicked.connect(self.about)
|
||||
self.frame_ag = QtWidgets.QFrame(self.frame)
|
||||
self.frame_ag.setGeometry(QtCore.QRect(0, 0, 800, 720))
|
||||
self.frame_ag.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.frame_ag.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.frame_ag.setObjectName("frame_cg")
|
||||
self.frame_ag.setVisible(False)
|
||||
self.addSignal.connect(self.new_groupUi)
|
||||
# print(self.username)
|
||||
self.groups = {}
|
||||
self.last_gid = None
|
||||
self.now_gid = None
|
||||
self.group_users = None
|
||||
self.last_msg_time = datetime.datetime(2022, 12, 19, 15, 4) # 上次信息的时间
|
||||
self.initUi()
|
||||
|
||||
def initUi(self):
|
||||
|
||||
groups = data.get_groups(self.Me.username)
|
||||
self.groups_num = len(groups)
|
||||
print('群组:', groups)
|
||||
max_hight = max(self.groups_num * 80, 680)
|
||||
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 300, max_hight))
|
||||
for i in range(len(groups)):
|
||||
group = groups[i]
|
||||
# print(contact)
|
||||
g_id = group[0]
|
||||
print('群聊信息:', group)
|
||||
pushButton_2 = OneGroup(self.scrollAreaWidgetContents, group)
|
||||
pushButton_2.setGeometry(QtCore.QRect(0, 80 * i, 300, 80))
|
||||
pushButton_2.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
pushButton_2.clicked.connect(pushButton_2.show_msg)
|
||||
pushButton_2.gidSingal.connect(self.chat)
|
||||
self.groups[g_id] = pushButton_2
|
||||
|
||||
def chat(self, g_id):
|
||||
# self.frame_ag.setVisible(False)
|
||||
print('当前聊天群号:', g_id)
|
||||
self.frame_msg.setVisible(True)
|
||||
self.frame_ag.setVisible(False)
|
||||
self.now_gid = g_id
|
||||
self.group_users = data.get_group_users(g_id)
|
||||
# 将当前群的界面设置为灰色
|
||||
# if self.last_gid and self.last_gid != g_id:
|
||||
# self.groups[self.last_gid].setStyleSheet("background-color : rgb(253,253,253)")
|
||||
# self.last_gid = g_id
|
||||
# self.groups[g_id].setStyleSheet("background-color : rgb(198,198,198)")
|
||||
g_name = self.groups[g_id].g_name
|
||||
self.l_g_name.setText(f'{g_name}({g_id})')
|
||||
self.message.clear()
|
||||
self.message.append(str(g_id))
|
||||
# 创建新的线程用于显示聊天记录
|
||||
self.Thread = ChatMsg(self.Me.username, g_id, self.Me.socket)
|
||||
self.Thread.isSend_signal.connect(self.showMsg)
|
||||
self.Thread.recvSignal.connect(self.showMsg)
|
||||
self.Thread.sendSignal.connect(self.showMsg)
|
||||
self.Thread.start()
|
||||
pass
|
||||
|
||||
def sendMsg(self, msg):
|
||||
"""
|
||||
发送信息
|
||||
:param msg:信息内容
|
||||
:return:
|
||||
"""
|
||||
msg = self.textEdit.toPlainText()
|
||||
message = self.Thread.send_msg(msg)
|
||||
if message:
|
||||
print(msg, '发送成功')
|
||||
# self.showMsg(message)
|
||||
else:
|
||||
print(msg, '发送失败')
|
||||
self.textEdit.clear()
|
||||
|
||||
def create_group_view(self):
|
||||
"""建群界面"""
|
||||
self.frame_msg.setVisible(False)
|
||||
self.frame_ag.setVisible(False)
|
||||
# self.frame_ag.setVisible(True)
|
||||
# print(self.Me.__dict__)
|
||||
self.create_view = CreateGroupView(username=self.Me.username)
|
||||
self.create_view.gidSignal.connect(self.new_groupUi)
|
||||
self.create_view.show()
|
||||
|
||||
def addGroupBack(self):
|
||||
"""加群界面"""
|
||||
self.frame_msg.setVisible(True)
|
||||
self.frame_ag.setVisible(False)
|
||||
# self.CG_Ui = None
|
||||
|
||||
def delete_group(self):
|
||||
"""退群"""
|
||||
a = QMessageBox.question(self, '警告', '你确定要退群吗?', QMessageBox.Yes | QMessageBox.No,
|
||||
QMessageBox.No) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
||||
if a == QMessageBox.Yes:
|
||||
data.delete_group(self.Me.username, self.now_gid)
|
||||
self.frame_msg.setVisible(False)
|
||||
self.last_gid = None
|
||||
self.groups_num -= 1
|
||||
self.l_g_name.setText('已退群')
|
||||
self.groups[self.now_gid].setVisible(False)
|
||||
self.groups.pop(self.now_gid)
|
||||
else:
|
||||
return
|
||||
|
||||
def show(self):
|
||||
self.message.append('2020303457')
|
||||
|
||||
def addGroupUi(self):
|
||||
"""加群的界面"""
|
||||
self.frame_msg.setVisible(False)
|
||||
self.CG_Ui = Add_GroupUi()
|
||||
self.CG_Ui.setupUi(self.frame_ag)
|
||||
self.CG_Ui.back.clicked.connect(self.addGroupBack)
|
||||
self.CG_Ui.btn_add.clicked.connect(self.addGroup)
|
||||
self.CG_Ui.btn_search.clicked.connect(self.searchGroup)
|
||||
self.frame_ag.setVisible(True)
|
||||
self.CG_Ui.tips.setVisible(False)
|
||||
self.CG_Ui.time.setVisible(False)
|
||||
pass
|
||||
|
||||
def searchGroup(self):
|
||||
"""搜索群聊"""
|
||||
gid = self.CG_Ui.line_g_id.text()
|
||||
if not gid:
|
||||
self.CG_Ui.error.setText('请输入群号')
|
||||
return False
|
||||
nickname = self.CG_Ui.line_nickname.text()
|
||||
group = data.search_group(gid)
|
||||
if not group:
|
||||
self.CG_Ui.error.setText('未找到群聊')
|
||||
return False
|
||||
avatar = data.get_avator(gid)
|
||||
pixmap = QPixmap(avatar).scaled(60, 60) # 按指定路径找到图片
|
||||
self.CG_Ui.avatar_img.setPixmap(pixmap) # 在label上显示图片
|
||||
return group
|
||||
|
||||
def addGroup(self):
|
||||
"""添加群聊"""
|
||||
gid = self.CG_Ui.line_g_id.text()
|
||||
gid = int(gid)
|
||||
nickname = self.CG_Ui.line_nickname.text()
|
||||
flag = data.add_group(self.Me.username, gid, nickname)
|
||||
if not flag:
|
||||
self.CG_Ui.error.setText('群聊不存在')
|
||||
return False
|
||||
avatar = data.get_avator(gid)
|
||||
pixmap = QPixmap(avatar).scaled(60, 60) # 按指定路径找到图片
|
||||
self.CG_Ui.avatar_img.setPixmap(pixmap) # 在label上显示图片
|
||||
self.CG_Ui.error.setText('加群成功')
|
||||
# self.addSignal.emit(gid)
|
||||
self.new_groupUi(gid)
|
||||
|
||||
def new_groupUi(self, gid):
|
||||
nickname = ''
|
||||
group = data.search_group(gid)
|
||||
if not group:
|
||||
return False
|
||||
g_name = group[1]
|
||||
self.groups_num += 1
|
||||
max_hight = max(self.groups_num * 80, 680)
|
||||
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 300, max_hight))
|
||||
group = [
|
||||
gid, g_name, nickname, 3, 1
|
||||
]
|
||||
# g_id = group[0]
|
||||
print('群聊信息:', group)
|
||||
pushButton_2 = OneGroup(self.scrollAreaWidgetContents, group)
|
||||
pushButton_2.setGeometry(QtCore.QRect(0, 80 * self.groups_num - 80, 300, 80))
|
||||
pushButton_2.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
pushButton_2.clicked.connect(pushButton_2.show_msg)
|
||||
pushButton_2.gidSingal.connect(self.chat)
|
||||
# pushButton_2.setVisible(True)
|
||||
print('加群成功', gid)
|
||||
print(pushButton_2.g_id)
|
||||
self.groups[gid] = pushButton_2
|
||||
pushButton_2.setVisible(True)
|
||||
print(self.groups)
|
||||
print(self.now_gid, self.last_gid)
|
||||
|
||||
def showMsg(self, message):
|
||||
"""
|
||||
显示聊天消息
|
||||
:param message:
|
||||
:return:
|
||||
"""
|
||||
# print(message)
|
||||
gid = message[1]
|
||||
if self.now_gid is None or gid != self.now_gid:
|
||||
return
|
||||
# self.now_gid = gid
|
||||
talker = message[5]
|
||||
isSend = message[6]
|
||||
content = message[3]
|
||||
msg_time = message[4]
|
||||
# print(message)
|
||||
# print(msg_time, type(msg_time))
|
||||
self.check_time(msg_time)
|
||||
if isSend == 1 and talker == self.Me.username:
|
||||
# 自己发的信息在右边显示
|
||||
self.right(content, talker)
|
||||
else:
|
||||
# 收到的信息在左边显示
|
||||
self.left(content, talker)
|
||||
self.message.moveCursor(self.message.textCursor().End)
|
||||
|
||||
def about(self):
|
||||
group = data.search_group(self.now_gid)
|
||||
QMessageBox.about(
|
||||
self,
|
||||
"关于",
|
||||
f"关于本群\n群名:{group[1]}\n群号:{self.now_gid}"
|
||||
)
|
||||
|
||||
def check_time(self, msg_time):
|
||||
"""
|
||||
判断两次聊天时间是否大于五分钟
|
||||
超过五分钟就显示时间
|
||||
:param msg_time:
|
||||
:return:
|
||||
"""
|
||||
dt = msg_time - self.last_msg_time
|
||||
# print(msg_time)
|
||||
if dt.seconds >= 300:
|
||||
html = '''
|
||||
<table align="center" style="vertical-align: middle;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>%s</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>''' % (msg_time.strftime("%Y-%m-%d %H:%M"))
|
||||
# print(html)
|
||||
self.last_msg_time = msg_time
|
||||
self.message.insertHtml(html)
|
||||
|
||||
def right(self, content, taklekId):
|
||||
html = '''
|
||||
<div>
|
||||
<table align="right" style="vertical-align: middle;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>%s :</td>
|
||||
<td style="border: 1px #000000 solid"><img align="right" src="%s" width="45" height="45"/></td>
|
||||
<td width="15"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
''' % (content, self.Me.my_avatar)
|
||||
self.message.insertHtml(html)
|
||||
|
||||
def left(self, content, taklekId):
|
||||
avatar = data.get_avator(taklekId)
|
||||
html = '''
|
||||
<div>
|
||||
<table align="left" style="vertical-align: middle;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="15"></td>
|
||||
<td style="border: 1px #000000 solid"><img align="right" src="%s" width="45" height="45"/></td>
|
||||
<td>: %s</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
''' % (avatar, content)
|
||||
self.message.insertHtml(html)
|
||||
|
||||
|
||||
class OneGroup(QtWidgets.QPushButton):
|
||||
"""
|
||||
联系人类,继承自pyqt的按钮,里面封装了联系人头像等标签
|
||||
"""
|
||||
gidSingal = pyqtSignal(int)
|
||||
|
||||
def __init__(self, Ui, contact=None):
|
||||
super(OneGroup, self).__init__(Ui)
|
||||
self.layoutWidget = QtWidgets.QWidget(Ui)
|
||||
self.layoutWidget.setObjectName("layoutWidget")
|
||||
self.gridLayout1 = QtWidgets.QGridLayout(self.layoutWidget)
|
||||
self.gridLayout1.setSizeConstraint(QtWidgets.QLayout.SetMaximumSize)
|
||||
self.gridLayout1.setContentsMargins(10, 10, 10, 10)
|
||||
self.gridLayout1.setHorizontalSpacing(20)
|
||||
self.gridLayout1.setVerticalSpacing(10)
|
||||
self.gridLayout1.setObjectName("gridLayout1")
|
||||
self.time0_1 = QtWidgets.QLabel(self.layoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(8)
|
||||
self.time0_1.setFont(font)
|
||||
self.time0_1.setLayoutDirection(QtCore.Qt.RightToLeft)
|
||||
self.time0_1.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
|
||||
self.time0_1.setObjectName("time0_1")
|
||||
self.gridLayout1.addWidget(self.time0_1, 0, 2, 1, 1)
|
||||
self.remark1 = QtWidgets.QLabel(self.layoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(15)
|
||||
self.remark1.setFont(font)
|
||||
self.remark1.setObjectName("remark1")
|
||||
self.gridLayout1.addWidget(self.remark1, 0, 1, 1, 1)
|
||||
self.msg1 = QtWidgets.QLabel(self.layoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(8)
|
||||
self.msg1.setFont(font)
|
||||
self.msg1.setObjectName("msg1")
|
||||
self.gridLayout1.addWidget(self.msg1, 1, 1, 1, 2)
|
||||
self.image1 = QtWidgets.QLabel(self.layoutWidget)
|
||||
self.image1.setMinimumSize(QtCore.QSize(60, 60))
|
||||
self.image1.setMaximumSize(QtCore.QSize(60, 60))
|
||||
self.image1.setLayoutDirection(QtCore.Qt.RightToLeft)
|
||||
self.image1.setAutoFillBackground(False)
|
||||
self.image1.setStyleSheet("background-color: #ffffff;")
|
||||
self.image1.setInputMethodHints(QtCore.Qt.ImhNone)
|
||||
self.image1.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.image1.setFrameShadow(QtWidgets.QFrame.Plain)
|
||||
self.image1.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
|
||||
self.image1.setObjectName("image1")
|
||||
self.gridLayout1.addWidget(self.image1, 0, 0, 2, 1)
|
||||
self.gridLayout1.setColumnStretch(0, 1)
|
||||
self.gridLayout1.setColumnStretch(1, 6)
|
||||
self.gridLayout1.setRowStretch(0, 5)
|
||||
self.gridLayout1.setRowStretch(1, 3)
|
||||
self.setLayout(self.gridLayout1)
|
||||
if contact:
|
||||
self.g_id = contact[0]
|
||||
self.g_name = contact[1]
|
||||
self.nickname = contact[2]
|
||||
self.type = contact[3]
|
||||
self.addTime = contact[4]
|
||||
self.show_info(id)
|
||||
|
||||
def show_info(self, id):
|
||||
if 1:
|
||||
# try:
|
||||
avatar = data.get_avator(self.g_id)
|
||||
remark = id
|
||||
time = datetime.datetime.now().strftime("%m-%d %H:%M")
|
||||
msg = '还没说话'
|
||||
pixmap = QPixmap(avatar).scaled(60, 60) # 按指定路径找到图片
|
||||
self.image1.setPixmap(pixmap) # 在label上显示图片
|
||||
self.remark1.setText(self.g_name)
|
||||
self.time0_1.setText(time)
|
||||
|
||||
def show_msg(self):
|
||||
print('点击的群号', self.g_id)
|
||||
self.gidSingal.emit(self.g_id)
|
||||
pass
|
||||
|
||||
|
||||
class ChatMsg(QThread):
|
||||
"""
|
||||
发送信息线程
|
||||
"""
|
||||
isSend_signal = pyqtSignal(tuple)
|
||||
recvSignal = pyqtSignal(tuple)
|
||||
sendSignal = pyqtSignal(tuple)
|
||||
|
||||
def __init__(self, my_u, g_id, socket, parent=None):
|
||||
super().__init__(parent)
|
||||
self.sec = 2 # 默认1000秒
|
||||
self.my_u = my_u
|
||||
self.g_id = g_id
|
||||
self.group_users = data.get_group_users(g_id)
|
||||
self.my_avatar = data.get_avator(my_u)
|
||||
self.socket = socket
|
||||
|
||||
def send_msg(self, msg):
|
||||
# 给群里所有在线的用户发送信息
|
||||
for group_user in self.group_users:
|
||||
username = group_user[0]
|
||||
if username == self.my_u:
|
||||
continue
|
||||
ta_port = group_user[4]
|
||||
nickname = group_user[3]
|
||||
self.ta_addr = ('localhost', ta_port)
|
||||
if ta_port == -1:
|
||||
print(f'{nickname}不在线')
|
||||
continue
|
||||
send_data = {
|
||||
'type': 'G',
|
||||
'gid': self.g_id,
|
||||
'username': self.my_u,
|
||||
'content': msg
|
||||
}
|
||||
print(f'{nickname}在线,{msg} 发送成功')
|
||||
self.socket.sendto(json.dumps(send_data).encode('utf-8'), self.ta_addr)
|
||||
message = data.send_group_msg(
|
||||
gid=self.g_id,
|
||||
msg=msg,
|
||||
talker=self.my_u,
|
||||
IsSend=1,
|
||||
_type=3
|
||||
)
|
||||
self.sendSignal.emit(message)
|
||||
return message
|
||||
|
||||
def run(self):
|
||||
# return
|
||||
messages = data.get_group_message(self.g_id)
|
||||
# print(messages)
|
||||
for message in messages:
|
||||
self.isSend_signal.emit(message)
|
||||
# self.recv_msg()
|
@ -1,100 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'GroupUi.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.7
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Form(object):
|
||||
def setupUi(self, Form):
|
||||
Form.setObjectName("Form")
|
||||
Form.resize(1120, 720)
|
||||
self.scrollArea = QtWidgets.QScrollArea(Form)
|
||||
self.scrollArea.setGeometry(QtCore.QRect(-1, 70, 322, 651))
|
||||
self.scrollArea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
|
||||
self.scrollArea.setWidgetResizable(True)
|
||||
self.scrollArea.setObjectName("scrollArea")
|
||||
self.scrollAreaWidgetContents = QtWidgets.QWidget()
|
||||
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 299, 649))
|
||||
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
|
||||
self.scrollArea.setWidget(self.scrollAreaWidgetContents)
|
||||
self.horizontalLayoutWidget = QtWidgets.QWidget(Form)
|
||||
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 321, 71))
|
||||
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.btn_create_group = QtWidgets.QPushButton(self.horizontalLayoutWidget)
|
||||
self.btn_create_group.setObjectName("btn_create_group")
|
||||
self.horizontalLayout.addWidget(self.btn_create_group)
|
||||
self.btn_add_group = QtWidgets.QPushButton(self.horizontalLayoutWidget)
|
||||
self.btn_add_group.setObjectName("btn_add_group")
|
||||
self.horizontalLayout.addWidget(self.btn_add_group)
|
||||
self.frame = QtWidgets.QFrame(Form)
|
||||
self.frame.setGeometry(QtCore.QRect(320, 0, 800, 720))
|
||||
self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.frame.setObjectName("frame")
|
||||
self.frame_msg = QtWidgets.QFrame(self.frame)
|
||||
self.frame_msg.setGeometry(QtCore.QRect(0, 0, 800, 720))
|
||||
self.frame_msg.setFrameShape(QtWidgets.QFrame.Box)
|
||||
self.frame_msg.setFrameShadow(QtWidgets.QFrame.Raised)
|
||||
self.frame_msg.setObjectName("frame_msg")
|
||||
self.message = QtWidgets.QTextBrowser(self.frame_msg)
|
||||
self.message.setGeometry(QtCore.QRect(0, 40, 800, 540))
|
||||
self.message.setObjectName("message")
|
||||
self.textEdit = QtWidgets.QTextEdit(self.frame_msg)
|
||||
self.textEdit.setGeometry(QtCore.QRect(0, 580, 800, 140))
|
||||
self.textEdit.setObjectName("textEdit")
|
||||
self.l_g_name = QtWidgets.QLabel(self.frame_msg)
|
||||
self.l_g_name.setGeometry(QtCore.QRect(10, 0, 431, 41))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(15)
|
||||
self.l_g_name.setFont(font)
|
||||
self.l_g_name.setText("")
|
||||
self.l_g_name.setObjectName("l_g_name")
|
||||
self.btn_sendMsg = QtWidgets.QPushButton(self.frame_msg)
|
||||
self.btn_sendMsg.setGeometry(QtCore.QRect(678, 668, 121, 51))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("黑体")
|
||||
font.setPointSize(15)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.btn_sendMsg.setFont(font)
|
||||
self.btn_sendMsg.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
|
||||
self.btn_sendMsg.setMouseTracking(False)
|
||||
self.btn_sendMsg.setAutoFillBackground(False)
|
||||
self.btn_sendMsg.setStyleSheet("QPushButton {\n"
|
||||
" background-color: #f0f0f0;\n"
|
||||
" \n"
|
||||
" padding: 10px;\n"
|
||||
" color:rgb(5,180,104);\n"
|
||||
"}")
|
||||
self.btn_sendMsg.setIconSize(QtCore.QSize(40, 40))
|
||||
self.btn_sendMsg.setCheckable(False)
|
||||
self.btn_sendMsg.setAutoDefault(True)
|
||||
self.btn_sendMsg.setObjectName("btn_sendMsg")
|
||||
self.toolButton = QtWidgets.QToolButton(self.frame_msg)
|
||||
self.toolButton.setGeometry(QtCore.QRect(750, 10, 47, 21))
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
self.btn_del_group = QtWidgets.QPushButton(self.frame_msg)
|
||||
self.btn_del_group.setGeometry(QtCore.QRect(650, 10, 93, 28))
|
||||
self.btn_del_group.setObjectName("btn_del_group")
|
||||
|
||||
self.retranslateUi(Form)
|
||||
QtCore.QMetaObject.connectSlotsByName(Form)
|
||||
|
||||
def retranslateUi(self, Form):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Form.setWindowTitle(_translate("Form", "Form"))
|
||||
self.btn_create_group.setText(_translate("Form", "创建群聊"))
|
||||
self.btn_add_group.setText(_translate("Form", "添加群聊"))
|
||||
self.btn_sendMsg.setText(_translate("Form", "发送"))
|
||||
self.toolButton.setText(_translate("Form", "..."))
|
||||
self.btn_del_group.setText(_translate("Form", "退群"))
|
@ -1,217 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Form</class>
|
||||
<widget class="QWidget" name="Form">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1120</width>
|
||||
<height>720</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>-1</x>
|
||||
<y>70</y>
|
||||
<width>322</width>
|
||||
<height>651</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOn</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>299</width>
|
||||
<height>649</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>321</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_create_group">
|
||||
<property name="text">
|
||||
<string>创建群聊</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_add_group">
|
||||
<property name="text">
|
||||
<string>添加群聊</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>320</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>720</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<widget class="QFrame" name="frame_msg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>720</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<widget class="QTextBrowser" name="message">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>40</y>
|
||||
<width>800</width>
|
||||
<height>540</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextEdit" name="textEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>580</y>
|
||||
<width>800</width>
|
||||
<height>140</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="l_g_name">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>0</y>
|
||||
<width>431</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="btn_sendMsg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>678</x>
|
||||
<y>668</y>
|
||||
<width>121</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>黑体</family>
|
||||
<pointsize>15</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>ArrowCursor</cursorShape>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
background-color: #f0f0f0;
|
||||
|
||||
padding: 10px;
|
||||
color:rgb(5,180,104);
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>发送</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>750</x>
|
||||
<y>10</y>
|
||||
<width>47</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="btn_del_group">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>650</x>
|
||||
<y>10</y>
|
||||
<width>93</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>退群</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,9 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@File : __init__.py.py
|
||||
@Author : Shuaikang Zhou
|
||||
@Time : 2022/12/24 10:33
|
||||
@IDE : Pycharm
|
||||
@Version : Python3.10
|
||||
@comment : ···
|
||||
"""
|
@ -1,101 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'addGroup.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.7
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Frame(object):
|
||||
def setupUi(self, Frame):
|
||||
Frame.setObjectName("Frame")
|
||||
Frame.resize(800, 720)
|
||||
self.back = QtWidgets.QPushButton(Frame)
|
||||
self.back.setGeometry(QtCore.QRect(0, 0, 93, 28))
|
||||
self.back.setObjectName("back")
|
||||
self.avatar_img = QtWidgets.QLabel(Frame)
|
||||
self.avatar_img.setGeometry(QtCore.QRect(530, 130, 80, 80))
|
||||
self.avatar_img.setObjectName("avatar_img")
|
||||
self.label_3 = QtWidgets.QLabel(Frame)
|
||||
self.label_3.setGeometry(QtCore.QRect(230, 50, 221, 51))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("一纸情书")
|
||||
font.setPointSize(20)
|
||||
self.label_3.setFont(font)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.layoutWidget = QtWidgets.QWidget(Frame)
|
||||
self.layoutWidget.setGeometry(QtCore.QRect(181, 113, 311, 281))
|
||||
self.layoutWidget.setObjectName("layoutWidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.label_2 = QtWidgets.QLabel(self.layoutWidget)
|
||||
self.label_2.setMinimumSize(QtCore.QSize(53, 0))
|
||||
self.label_2.setMaximumSize(QtCore.QSize(58, 16777215))
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.horizontalLayout_2.addWidget(self.label_2)
|
||||
self.line_g_id = QtWidgets.QLineEdit(self.layoutWidget)
|
||||
self.line_g_id.setMinimumSize(QtCore.QSize(0, 50))
|
||||
self.line_g_id.setObjectName("line_g_id")
|
||||
self.horizontalLayout_2.addWidget(self.line_g_id)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.label_4 = QtWidgets.QLabel(self.layoutWidget)
|
||||
self.label_4.setMinimumSize(QtCore.QSize(38, 21))
|
||||
self.label_4.setMaximumSize(QtCore.QSize(58, 21))
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.horizontalLayout_4.addWidget(self.label_4)
|
||||
self.line_nickname = QtWidgets.QLineEdit(self.layoutWidget)
|
||||
self.line_nickname.setMinimumSize(QtCore.QSize(0, 50))
|
||||
self.line_nickname.setMaximumSize(QtCore.QSize(100000, 50))
|
||||
self.line_nickname.setObjectName("line_nickname")
|
||||
self.horizontalLayout_4.addWidget(self.line_nickname)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_4)
|
||||
self.btn_search = QtWidgets.QPushButton(self.layoutWidget)
|
||||
self.btn_search.setObjectName("btn_search")
|
||||
self.verticalLayout.addWidget(self.btn_search)
|
||||
self.btn_add = QtWidgets.QPushButton(self.layoutWidget)
|
||||
self.btn_add.setObjectName("btn_add")
|
||||
self.verticalLayout.addWidget(self.btn_add)
|
||||
self.time = QtWidgets.QLCDNumber(Frame)
|
||||
self.time.setGeometry(QtCore.QRect(390, 400, 51, 61))
|
||||
self.time.setLineWidth(5)
|
||||
self.time.setDigitCount(1)
|
||||
self.time.setProperty("value", 8.0)
|
||||
self.time.setObjectName("time")
|
||||
self.error = QtWidgets.QLabel(Frame)
|
||||
self.error.setGeometry(QtCore.QRect(510, 340, 101, 16))
|
||||
self.error.setAutoFillBackground(False)
|
||||
self.error.setStyleSheet("color:red")
|
||||
self.error.setText("")
|
||||
self.error.setObjectName("error")
|
||||
self.toolButton = QtWidgets.QToolButton(Frame)
|
||||
self.toolButton.setGeometry(QtCore.QRect(750, 0, 47, 21))
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
self.tips = QtWidgets.QLabel(Frame)
|
||||
self.tips.setGeometry(QtCore.QRect(230, 430, 61, 16))
|
||||
self.tips.setObjectName("tips")
|
||||
|
||||
self.retranslateUi(Frame)
|
||||
QtCore.QMetaObject.connectSlotsByName(Frame)
|
||||
|
||||
def retranslateUi(self, Frame):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Frame.setWindowTitle(_translate("Frame", "Frame"))
|
||||
self.back.setText(_translate("Frame", "返回"))
|
||||
self.avatar_img.setText(_translate("Frame", "+"))
|
||||
self.label_3.setText(_translate("Frame", "添加群聊"))
|
||||
self.label_2.setText(_translate("Frame", "群 号:"))
|
||||
self.label_4.setText(_translate("Frame", "群昵称:"))
|
||||
self.btn_search.setText(_translate("Frame", "查找"))
|
||||
self.btn_add.setText(_translate("Frame", "添加"))
|
||||
self.toolButton.setText(_translate("Frame", "..."))
|
||||
self.tips.setText(_translate("Frame", "即将返回"))
|
@ -1,226 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Frame</class>
|
||||
<widget class="QFrame" name="Frame">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>720</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Frame</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="back">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>93</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>返回</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="avatar_img">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>530</x>
|
||||
<y>130</y>
|
||||
<width>80</width>
|
||||
<height>80</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>230</x>
|
||||
<y>50</y>
|
||||
<width>221</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>一纸情书</family>
|
||||
<pointsize>20</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>添加群聊</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>181</x>
|
||||
<y>113</y>
|
||||
<width>311</width>
|
||||
<height>281</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>53</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>58</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>群 号:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="line_g_id">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>38</width>
|
||||
<height>21</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>58</width>
|
||||
<height>21</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>群昵称:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="line_nickname">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100000</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_search">
|
||||
<property name="text">
|
||||
<string>查找</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_add">
|
||||
<property name="text">
|
||||
<string>添加</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QLCDNumber" name="time">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>390</x>
|
||||
<y>400</y>
|
||||
<width>51</width>
|
||||
<height>61</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="digitCount">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value" stdset="0">
|
||||
<double>8.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="error">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>510</x>
|
||||
<y>340</y>
|
||||
<width>101</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color:red</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>750</x>
|
||||
<y>0</y>
|
||||
<width>47</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="tips">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>230</x>
|
||||
<y>430</y>
|
||||
<width>61</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>即将返回</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,113 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'create_groupUi.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.7
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Frame(object):
|
||||
def setupUi(self, Frame):
|
||||
Frame.setObjectName("Frame")
|
||||
Frame.resize(800, 720)
|
||||
self.error = QtWidgets.QLabel(Frame)
|
||||
self.error.setGeometry(QtCore.QRect(550, 80, 101, 16))
|
||||
self.error.setAutoFillBackground(False)
|
||||
self.error.setStyleSheet("color:red")
|
||||
self.error.setText("")
|
||||
self.error.setObjectName("error")
|
||||
self.tips = QtWidgets.QLabel(Frame)
|
||||
self.tips.setGeometry(QtCore.QRect(290, 630, 121, 16))
|
||||
self.tips.setObjectName("tips")
|
||||
self.layoutWidget = QtWidgets.QWidget(Frame)
|
||||
self.layoutWidget.setGeometry(QtCore.QRect(140, 70, 401, 511))
|
||||
self.layoutWidget.setObjectName("layoutWidget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.label_2 = QtWidgets.QLabel(self.layoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(15)
|
||||
self.label_2.setFont(font)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.horizontalLayout_2.addWidget(self.label_2)
|
||||
self.group_name = QtWidgets.QLineEdit(self.layoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(15)
|
||||
self.group_name.setFont(font)
|
||||
self.group_name.setObjectName("group_name")
|
||||
self.horizontalLayout_2.addWidget(self.group_name)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(self.layoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(15)
|
||||
self.label.setFont(font)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.group_intro = QtWidgets.QTextEdit(self.layoutWidget)
|
||||
self.group_intro.setObjectName("group_intro")
|
||||
self.horizontalLayout.addWidget(self.group_intro)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.btn_set_gAvatar = QtWidgets.QPushButton(self.layoutWidget)
|
||||
self.btn_set_gAvatar.setMinimumSize(QtCore.QSize(100, 50))
|
||||
self.btn_set_gAvatar.setMaximumSize(QtCore.QSize(100, 50))
|
||||
self.btn_set_gAvatar.setObjectName("btn_set_gAvatar")
|
||||
self.horizontalLayout_3.addWidget(self.btn_set_gAvatar)
|
||||
self.avatar_img = QtWidgets.QLabel(self.layoutWidget)
|
||||
self.avatar_img.setMinimumSize(QtCore.QSize(100, 100))
|
||||
self.avatar_img.setMaximumSize(QtCore.QSize(100, 100))
|
||||
self.avatar_img.setText("")
|
||||
self.avatar_img.setObjectName("avatar_img")
|
||||
self.horizontalLayout_3.addWidget(self.avatar_img)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_3)
|
||||
self.btn_create = QtWidgets.QPushButton(self.layoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(15)
|
||||
self.btn_create.setFont(font)
|
||||
self.btn_create.setObjectName("btn_create")
|
||||
self.verticalLayout.addWidget(self.btn_create)
|
||||
self.label_3 = QtWidgets.QLabel(Frame)
|
||||
self.label_3.setGeometry(QtCore.QRect(260, 0, 221, 51))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("一纸情书")
|
||||
font.setPointSize(20)
|
||||
self.label_3.setFont(font)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.back = QtWidgets.QPushButton(Frame)
|
||||
self.back.setGeometry(QtCore.QRect(0, 0, 91, 28))
|
||||
self.back.setObjectName("back")
|
||||
self.toolButton = QtWidgets.QToolButton(Frame)
|
||||
self.toolButton.setGeometry(QtCore.QRect(750, 0, 47, 21))
|
||||
self.toolButton.setObjectName("toolButton")
|
||||
|
||||
self.retranslateUi(Frame)
|
||||
QtCore.QMetaObject.connectSlotsByName(Frame)
|
||||
|
||||
def retranslateUi(self, Frame):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Frame.setWindowTitle(_translate("Frame", "Frame"))
|
||||
self.tips.setText(_translate("Frame", "创建群聊成功"))
|
||||
self.label_2.setText(_translate("Frame", "群 名:"))
|
||||
self.group_name.setText(_translate("Frame", "请输入群名"))
|
||||
self.label.setText(_translate("Frame", "群简介:"))
|
||||
self.group_intro.setHtml(_translate("Frame", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'SimSun\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">在这里介绍你的群聊(不超过150字)</p></body></html>"))
|
||||
self.btn_set_gAvatar.setText(_translate("Frame", "选择群头像"))
|
||||
self.btn_create.setText(_translate("Frame", "创建"))
|
||||
self.label_3.setText(_translate("Frame", "创建群聊"))
|
||||
self.back.setText(_translate("Frame", "返回"))
|
||||
self.toolButton.setText(_translate("Frame", "..."))
|
@ -1,217 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Frame</class>
|
||||
<widget class="QFrame" name="Frame">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>720</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Frame</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="error">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>550</x>
|
||||
<y>80</y>
|
||||
<width>101</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color:red</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="tips">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>290</x>
|
||||
<y>630</y>
|
||||
<width>121</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>创建群聊成功</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>140</x>
|
||||
<y>70</y>
|
||||
<width>401</width>
|
||||
<height>511</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>群 名:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="group_name">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>请输入群名</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>群简介:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="group_intro">
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'SimSun'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">在这里介绍你的群聊(不超过150字)</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_set_gAvatar">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择群头像</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="avatar_img">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_create">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>创建</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<y>0</y>
|
||||
<width>221</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>一纸情书</family>
|
||||
<pointsize>20</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>创建群聊</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="back">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>91</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>返回</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>750</x>
|
||||
<y>0</y>
|
||||
<width>47</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,9 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@File : __init__.py.py
|
||||
@Author : Shuaikang Zhou
|
||||
@Time : 2022/12/24 10:33
|
||||
@IDE : Pycharm
|
||||
@Version : Python3.10
|
||||
@comment : ···
|
||||
"""
|
@ -1,67 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@File : myinfo.py
|
||||
@Author : Shuaikang Zhou
|
||||
@Time : 2022/12/23 11:45
|
||||
@IDE : Pycharm
|
||||
@Version : Python3.10
|
||||
@comment : ···
|
||||
"""
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtWidgets import *
|
||||
from PyQt5.QtCore import *
|
||||
from .myinfoUi import *
|
||||
from ....DB import data
|
||||
|
||||
|
||||
class InfoControl(QWidget, Ui_Frame):
|
||||
backSignal = pyqtSignal(str)
|
||||
|
||||
# createSignal = pyqtSignal(Group)
|
||||
def __init__(self, parent=None, Me=None):
|
||||
super(InfoControl, self).__init__(parent)
|
||||
self.setupUi(self)
|
||||
self.Me = Me
|
||||
self.initUi()
|
||||
self.btn_update.clicked.connect(self.update_)
|
||||
|
||||
def initUi(self):
|
||||
self.ltips.setText('')
|
||||
self.info = data.get_myinfo(self.Me.username)
|
||||
nickname = self.info[1]
|
||||
gender = self.info[2]
|
||||
city = self.info[4]
|
||||
province = self.info[5]
|
||||
tel = self.info[6]
|
||||
email = self.info[7]
|
||||
signsture = self.info[8]
|
||||
pixmap = QPixmap(self.Me.my_avatar).scaled(80, 80) # 按指定路径找到图片
|
||||
self.l_avatar.setPixmap(pixmap) # 在label上显示图片
|
||||
self.l_username.setText(f'账号:{self.Me.username}')
|
||||
if gender=='男':
|
||||
self.radioButton.setChecked(True)
|
||||
elif gender=='女':
|
||||
self.radioButton_2.setChecked(True)
|
||||
self.line_nickname.setText(nickname)
|
||||
self.line_city.setText(city)
|
||||
self.line_tel.setText(tel)
|
||||
self.line_province.setText(province)
|
||||
self.line_email.setText(email)
|
||||
self.line_signsture.setText(signsture)
|
||||
def update_(self):
|
||||
"""更新信息"""
|
||||
nickname = self.line_nickname.text()
|
||||
if self.radioButton.isChecked():
|
||||
gender = self.radioButton.text()
|
||||
else:
|
||||
gender = '女'
|
||||
city = self.line_city.text()
|
||||
province = self.line_province.text()
|
||||
tel = self.line_tel.text()
|
||||
email = self.line_email.text()
|
||||
signsture = self.line_signsture.text()
|
||||
userinfo = [
|
||||
nickname,gender,city,province,tel,email,signsture,self.Me.username
|
||||
]
|
||||
data.update_userinfo(userinfo)
|
||||
self.ltips.setText('修改成功')
|
@ -1,128 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'myinfoUi.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.7
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Frame(object):
|
||||
def setupUi(self, Frame):
|
||||
Frame.setObjectName("Frame")
|
||||
Frame.resize(1120, 720)
|
||||
self.l_avatar = QtWidgets.QLabel(Frame)
|
||||
self.l_avatar.setGeometry(QtCore.QRect(370, 140, 80, 80))
|
||||
self.l_avatar.setText("")
|
||||
self.l_avatar.setPixmap(QtGui.QPixmap("../../../a_img/微信图片_20221215224740.jpg"))
|
||||
self.l_avatar.setScaledContents(True)
|
||||
self.l_avatar.setObjectName("l_avatar")
|
||||
self.btn_update = QtWidgets.QPushButton(Frame)
|
||||
self.btn_update.setGeometry(QtCore.QRect(370, 610, 93, 28))
|
||||
self.btn_update.setObjectName("btn_update")
|
||||
self.ltips = QtWidgets.QLabel(Frame)
|
||||
self.ltips.setGeometry(QtCore.QRect(490, 620, 72, 15))
|
||||
self.ltips.setText("")
|
||||
self.ltips.setObjectName("ltips")
|
||||
self.widget = QtWidgets.QWidget(Frame)
|
||||
self.widget.setGeometry(QtCore.QRect(270, 260, 281, 311))
|
||||
self.widget.setObjectName("widget")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.widget)
|
||||
self.verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetMinAndMaxSize)
|
||||
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.l_username = QtWidgets.QLabel(self.widget)
|
||||
self.l_username.setObjectName("l_username")
|
||||
self.verticalLayout.addWidget(self.l_username)
|
||||
self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
|
||||
self.l_nickname = QtWidgets.QLabel(self.widget)
|
||||
self.l_nickname.setObjectName("l_nickname")
|
||||
self.horizontalLayout_6.addWidget(self.l_nickname)
|
||||
self.line_nickname = QtWidgets.QLineEdit(self.widget)
|
||||
self.line_nickname.setObjectName("line_nickname")
|
||||
self.horizontalLayout_6.addWidget(self.line_nickname)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_6)
|
||||
self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
|
||||
self.l_gender = QtWidgets.QLabel(self.widget)
|
||||
self.l_gender.setObjectName("l_gender")
|
||||
self.horizontalLayout_7.addWidget(self.l_gender)
|
||||
self.radioButton = QtWidgets.QRadioButton(self.widget)
|
||||
self.radioButton.setObjectName("radioButton")
|
||||
self.horizontalLayout_7.addWidget(self.radioButton)
|
||||
self.radioButton_2 = QtWidgets.QRadioButton(self.widget)
|
||||
self.radioButton_2.setObjectName("radioButton_2")
|
||||
self.horizontalLayout_7.addWidget(self.radioButton_2)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_7)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.l_nickname_3 = QtWidgets.QLabel(self.widget)
|
||||
self.l_nickname_3.setObjectName("l_nickname_3")
|
||||
self.horizontalLayout_2.addWidget(self.l_nickname_3)
|
||||
self.line_city = QtWidgets.QLineEdit(self.widget)
|
||||
self.line_city.setText("")
|
||||
self.line_city.setObjectName("line_city")
|
||||
self.horizontalLayout_2.addWidget(self.line_city)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_2)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.l_nickname_2 = QtWidgets.QLabel(self.widget)
|
||||
self.l_nickname_2.setObjectName("l_nickname_2")
|
||||
self.horizontalLayout.addWidget(self.l_nickname_2)
|
||||
self.line_province = QtWidgets.QLineEdit(self.widget)
|
||||
self.line_province.setObjectName("line_province")
|
||||
self.horizontalLayout.addWidget(self.line_province)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.l_tel = QtWidgets.QLabel(self.widget)
|
||||
self.l_tel.setObjectName("l_tel")
|
||||
self.horizontalLayout_3.addWidget(self.l_tel)
|
||||
self.line_tel = QtWidgets.QLineEdit(self.widget)
|
||||
self.line_tel.setText("")
|
||||
self.line_tel.setObjectName("line_tel")
|
||||
self.horizontalLayout_3.addWidget(self.line_tel)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_3)
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.l_nickname_5 = QtWidgets.QLabel(self.widget)
|
||||
self.l_nickname_5.setObjectName("l_nickname_5")
|
||||
self.horizontalLayout_4.addWidget(self.l_nickname_5)
|
||||
self.line_email = QtWidgets.QLineEdit(self.widget)
|
||||
self.line_email.setText("")
|
||||
self.line_email.setObjectName("line_email")
|
||||
self.horizontalLayout_4.addWidget(self.line_email)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_4)
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.l_nickname_6 = QtWidgets.QLabel(self.widget)
|
||||
self.l_nickname_6.setObjectName("l_nickname_6")
|
||||
self.horizontalLayout_5.addWidget(self.l_nickname_6)
|
||||
self.line_signsture = QtWidgets.QLineEdit(self.widget)
|
||||
self.line_signsture.setText("")
|
||||
self.line_signsture.setObjectName("line_signsture")
|
||||
self.horizontalLayout_5.addWidget(self.line_signsture)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout_5)
|
||||
|
||||
self.retranslateUi(Frame)
|
||||
QtCore.QMetaObject.connectSlotsByName(Frame)
|
||||
|
||||
def retranslateUi(self, Frame):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Frame.setWindowTitle(_translate("Frame", "Frame"))
|
||||
self.btn_update.setText(_translate("Frame", "修改资料"))
|
||||
self.l_username.setText(_translate("Frame", "账号:2020303457"))
|
||||
self.l_nickname.setText(_translate("Frame", "昵称:"))
|
||||
self.l_gender.setText(_translate("Frame", "性别:"))
|
||||
self.radioButton.setText(_translate("Frame", "男"))
|
||||
self.radioButton_2.setText(_translate("Frame", "女"))
|
||||
self.l_nickname_3.setText(_translate("Frame", "城市:"))
|
||||
self.l_nickname_2.setText(_translate("Frame", "省份:"))
|
||||
self.l_tel.setText(_translate("Frame", "电话:"))
|
||||
self.l_nickname_5.setText(_translate("Frame", "邮箱:"))
|
||||
self.l_nickname_6.setText(_translate("Frame", "签名:"))
|
@ -1,211 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Frame</class>
|
||||
<widget class="QFrame" name="Frame">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1120</width>
|
||||
<height>720</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Frame</string>
|
||||
</property>
|
||||
<widget class="QLabel" name="l_avatar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>370</x>
|
||||
<y>140</y>
|
||||
<width>80</width>
|
||||
<height>80</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>../../../a_img/微信图片_20221215224740.jpg</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="btn_update">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>370</x>
|
||||
<y>610</y>
|
||||
<width>93</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>修改资料</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="ltips">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>490</x>
|
||||
<y>620</y>
|
||||
<width>72</width>
|
||||
<height>15</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>270</x>
|
||||
<y>260</y>
|
||||
<width>281</width>
|
||||
<height>311</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetMinAndMaxSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="l_username">
|
||||
<property name="text">
|
||||
<string>账号:2020303457</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="l_nickname">
|
||||
<property name="text">
|
||||
<string>昵称:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="line_nickname"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QLabel" name="l_gender">
|
||||
<property name="text">
|
||||
<string>性别:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton">
|
||||
<property name="text">
|
||||
<string>男</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_2">
|
||||
<property name="text">
|
||||
<string>女</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="l_nickname_3">
|
||||
<property name="text">
|
||||
<string>城市:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="line_city">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="l_nickname_2">
|
||||
<property name="text">
|
||||
<string>省份:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="line_province"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="l_tel">
|
||||
<property name="text">
|
||||
<string>电话:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="line_tel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="l_nickname_5">
|
||||
<property name="text">
|
||||
<string>邮箱:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="line_email">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="l_nickname_6">
|
||||
<property name="text">
|
||||
<string>签名:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="line_signsture">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,9 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@File : __init__.py.py
|
||||
@Author : Shuaikang Zhou
|
||||
@Time : 2022/12/24 10:34
|
||||
@IDE : Pycharm
|
||||
@Version : Python3.10
|
||||
@comment : ···
|
||||
"""
|
@ -1,100 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'userinfoUi.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.7
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Frame(object):
|
||||
def setupUi(self, Frame):
|
||||
Frame.setObjectName("Frame")
|
||||
Frame.resize(800, 720)
|
||||
Frame.setCursor(QtGui.QCursor(QtCore.Qt.IBeamCursor))
|
||||
Frame.setMouseTracking(True)
|
||||
Frame.setTabletTracking(True)
|
||||
self.widget = QtWidgets.QWidget(Frame)
|
||||
self.widget.setGeometry(QtCore.QRect(210, 100, 429, 81))
|
||||
self.widget.setObjectName("widget")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.widget)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.l_avatar = QtWidgets.QLabel(self.widget)
|
||||
self.l_avatar.setMinimumSize(QtCore.QSize(80, 80))
|
||||
self.l_avatar.setMaximumSize(QtCore.QSize(80, 80))
|
||||
self.l_avatar.setText("")
|
||||
self.l_avatar.setPixmap(QtGui.QPixmap("../../../a_img/be0fa6c0c4707fb5f7b37b660de826d3.jpg"))
|
||||
self.l_avatar.setScaledContents(True)
|
||||
self.l_avatar.setObjectName("l_avatar")
|
||||
self.gridLayout.addWidget(self.l_avatar, 0, 0, 3, 1)
|
||||
self.l_remark = QtWidgets.QLabel(self.widget)
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(15)
|
||||
self.l_remark.setFont(font)
|
||||
self.l_remark.setObjectName("l_remark")
|
||||
self.gridLayout.addWidget(self.l_remark, 0, 1, 1, 1)
|
||||
self.l_nickname = QtWidgets.QLabel(self.widget)
|
||||
self.l_nickname.setObjectName("l_nickname")
|
||||
self.gridLayout.addWidget(self.l_nickname, 1, 1, 1, 1)
|
||||
self.l_username = QtWidgets.QLabel(self.widget)
|
||||
self.l_username.setObjectName("l_username")
|
||||
self.gridLayout.addWidget(self.l_username, 2, 1, 1, 1)
|
||||
self.horizontalLayoutWidget = QtWidgets.QWidget(Frame)
|
||||
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(210, 210, 429, 71))
|
||||
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
|
||||
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(self.horizontalLayoutWidget)
|
||||
self.label.setMinimumSize(QtCore.QSize(80, 0))
|
||||
self.label.setMaximumSize(QtCore.QSize(80, 16777215))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(15)
|
||||
self.label.setFont(font)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.lineEdit = QtWidgets.QLineEdit(self.horizontalLayoutWidget)
|
||||
self.lineEdit.setMinimumSize(QtCore.QSize(0, 25))
|
||||
self.lineEdit.setMaximumSize(QtCore.QSize(16777215, 25))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(15)
|
||||
self.lineEdit.setFont(font)
|
||||
self.lineEdit.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
|
||||
self.lineEdit.setAutoFillBackground(False)
|
||||
self.lineEdit.setStyleSheet("background:transparent;border-width:0;border-style:outset")
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.horizontalLayout.addWidget(self.lineEdit)
|
||||
self.btn_update_remark = QtWidgets.QPushButton(self.horizontalLayoutWidget)
|
||||
self.btn_update_remark.setMinimumSize(QtCore.QSize(140, 40))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(12)
|
||||
self.btn_update_remark.setFont(font)
|
||||
self.btn_update_remark.setObjectName("btn_update_remark")
|
||||
self.horizontalLayout.addWidget(self.btn_update_remark)
|
||||
self.btn_delete_contact = QtWidgets.QPushButton(Frame)
|
||||
self.btn_delete_contact.setGeometry(QtCore.QRect(330, 370, 140, 40))
|
||||
self.btn_delete_contact.setMinimumSize(QtCore.QSize(140, 40))
|
||||
self.btn_delete_contact.setMaximumSize(QtCore.QSize(140, 40))
|
||||
font = QtGui.QFont()
|
||||
font.setPointSize(12)
|
||||
self.btn_delete_contact.setFont(font)
|
||||
self.btn_delete_contact.setObjectName("btn_delete_contact")
|
||||
|
||||
self.retranslateUi(Frame)
|
||||
QtCore.QMetaObject.connectSlotsByName(Frame)
|
||||
|
||||
def retranslateUi(self, Frame):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Frame.setWindowTitle(_translate("Frame", "Frame"))
|
||||
self.l_remark.setText(_translate("Frame", "曹雨萱"))
|
||||
self.l_nickname.setText(_translate("Frame", "昵称:997"))
|
||||
self.l_username.setText(_translate("Frame", "账号:TextLabel"))
|
||||
self.label.setText(_translate("Frame", "备注名"))
|
||||
self.lineEdit.setText(_translate("Frame", "曹雨萱"))
|
||||
self.btn_update_remark.setText(_translate("Frame", "修改备注"))
|
||||
self.btn_delete_contact.setText(_translate("Frame", "删除好友"))
|
@ -1,208 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Frame</class>
|
||||
<widget class="QFrame" name="Frame">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>720</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>IBeamCursor</cursorShape>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="tabletTracking">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Frame</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>210</x>
|
||||
<y>100</y>
|
||||
<width>429</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" rowspan="3">
|
||||
<widget class="QLabel" name="l_avatar">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>80</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>../../../a_img/be0fa6c0c4707fb5f7b37b660de826d3.jpg</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="l_remark">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>曹雨萱</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="l_nickname">
|
||||
<property name="text">
|
||||
<string>昵称:997</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="l_username">
|
||||
<property name="text">
|
||||
<string>账号:TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>210</x>
|
||||
<y>210</y>
|
||||
<width>429</width>
|
||||
<height>71</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>备注名</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>15</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>ArrowCursor</cursorShape>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background:transparent;border-width:0;border-style:outset</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>曹雨萱</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btn_update_remark">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>修改备注</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="btn_delete_contact">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>330</x>
|
||||
<y>370</y>
|
||||
<width>140</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>140</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>删除好友</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,23 +1,9 @@
|
||||
import sys
|
||||
|
||||
from PyQt5.QtWebEngineWidgets import QWebEngineView
|
||||
from PyQt5.QtWidgets import *
|
||||
from PyQt5.QtCore import *
|
||||
from PyQt5.QtGui import *
|
||||
from app.DataBase import data
|
||||
|
||||
# class AnalysisController(QMainWindow, Ui_Dialog):
|
||||
# exitSignal = pyqtSignal()
|
||||
#
|
||||
# # username = ''
|
||||
# def __init__(self, username, parent=None):
|
||||
# super(AnalysisController, self).__init__(parent)
|
||||
# self.setupUi(self)
|
||||
# self.setWindowTitle('WeChat')
|
||||
# self.setWindowIcon(QIcon('./app/data/icon.png'))
|
||||
# self.Me = data.get_myinfo()
|
||||
import sys
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
from PyQt5.QtWidgets import (QWidget, QHBoxLayout, QSplitter, QApplication)
|
||||
from PyQt5.QtCore import (Qt, QUrl)
|
||||
from PyQt5.QtWebEngineWidgets import *
|
||||
from . import charts
|
||||
|
||||
|
||||
@ -25,20 +11,42 @@ class AnalysisController(QWidget):
|
||||
def __init__(self, username):
|
||||
super().__init__()
|
||||
self.ta_username = username
|
||||
self.load_data()
|
||||
self.initUI()
|
||||
self.setWindowTitle('WeChat')
|
||||
self.setWindowTitle('数据分析')
|
||||
self.setWindowIcon(QIcon('./app/data/icon.png'))
|
||||
# self.setBackground()
|
||||
# self.setWindowFlag(Qt.FramelessWindowHint)
|
||||
self.setStyleSheet('''QWidget{background-color:rgb(255, 255, 255);}''')
|
||||
self.resize(400, 300)
|
||||
self.center()
|
||||
self.setAttribute(Qt.WA_AttributeCount)
|
||||
self.label_01()
|
||||
self.Thread = LoadData(username)
|
||||
self.Thread.okSignal.connect(self.initUI)
|
||||
self.Thread.start()
|
||||
|
||||
def load_data(self):
|
||||
charts.send_recv_rate(self.ta_username)
|
||||
charts.message_word_cloud(self.ta_username)
|
||||
charts.msg_type_rate(self.ta_username)
|
||||
charts.calendar_chart(self.ta_username)
|
||||
charts.month_num(self.ta_username)
|
||||
def center(self): # 定义一个函数使得窗口居中显示
|
||||
# 获取屏幕坐标系
|
||||
screen = QDesktopWidget().screenGeometry()
|
||||
# 获取窗口坐标系
|
||||
size = self.geometry()
|
||||
newLeft = (screen.width() - size.width()) / 2
|
||||
newTop = (screen.height() - size.height()) / 2
|
||||
self.move(int(newLeft), int(newTop))
|
||||
|
||||
def label_01(self):
|
||||
self.label = QLabel(self)
|
||||
self.label.setGeometry(150, 100, 100, 100)
|
||||
self.label.setToolTip("这是一个标签")
|
||||
self.m_movie()
|
||||
|
||||
def m_movie(self):
|
||||
movie = QMovie("./app/data/bg.gif")
|
||||
|
||||
self.label.setMovie(movie)
|
||||
|
||||
movie.start()
|
||||
|
||||
def initUI(self):
|
||||
self.label.setVisible(False)
|
||||
main_box = QHBoxLayout(self)
|
||||
self.browser1 = QWebEngineView()
|
||||
self.browser1.load(QUrl('http://www.baidu.com'))
|
||||
@ -120,7 +128,6 @@ class AnalysisController(QWidget):
|
||||
|
||||
main_box.addWidget(splitter1)
|
||||
self.setLayout(main_box)
|
||||
self.setGeometry(300, 300, 600, 500)
|
||||
|
||||
def setBackground(self):
|
||||
palette = QPalette()
|
||||
@ -130,6 +137,26 @@ class AnalysisController(QWidget):
|
||||
# palette.setColor(self.backgroundRole(), QColor(192, 253, 123)) # 设置背景颜色
|
||||
self.setPalette(palette)
|
||||
|
||||
|
||||
class LoadData(QThread):
|
||||
"""
|
||||
发送信息线程
|
||||
"""
|
||||
okSignal = pyqtSignal(int)
|
||||
|
||||
def __init__(self,ta_u, parent=None):
|
||||
super().__init__(parent)
|
||||
self.ta_username = ta_u
|
||||
|
||||
def run(self):
|
||||
charts.send_recv_rate(self.ta_username)
|
||||
charts.message_word_cloud(self.ta_username)
|
||||
charts.msg_type_rate(self.ta_username)
|
||||
charts.calendar_chart(self.ta_username)
|
||||
charts.month_num(self.ta_username)
|
||||
self.okSignal.emit(10)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication(sys.argv)
|
||||
ex = MainWindow()
|
||||
|
@ -1,12 +1,7 @@
|
||||
import datetime
|
||||
import os
|
||||
import random
|
||||
import time
|
||||
|
||||
import jieba
|
||||
from pyecharts import options as opts
|
||||
from pyecharts.charts import Pie, WordCloud, Calendar, Bar
|
||||
from pyecharts.faker import Faker
|
||||
from ....DataBase import data
|
||||
|
||||
data.mkdir(os.path.abspath('.') + '/data/聊天统计')
|
||||
|
@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@File : mainview.py
|
||||
@File : contact.py
|
||||
@Author : Shuaikang Zhou
|
||||
@Time : 2022/12/13 15:07
|
||||
@IDE : Pycharm
|
||||
@ -16,6 +16,7 @@ from ...DataBase import data, output
|
||||
from .userinfo import userinfoUi
|
||||
from .analysis import analysis
|
||||
|
||||
|
||||
class ContactController(QWidget, Ui_Dialog):
|
||||
exitSignal = pyqtSignal()
|
||||
urlSignal = pyqtSignal(QUrl)
|
||||
@ -42,7 +43,7 @@ class ContactController(QWidget, Ui_Dialog):
|
||||
self.last_talkerId = None
|
||||
self.now_talkerId = None
|
||||
self.showContact()
|
||||
self.userinfo = userinfoUi.Ui_Frame()
|
||||
self.userinfo = userinfoUi.Ui_Frame() # 联系人信息界面
|
||||
self.userinfo.setupUi(self.frame)
|
||||
self.userinfo.btn_outbut.clicked.connect(self.output)
|
||||
self.userinfo.btn_analysis.clicked.connect(self.analysis)
|
||||
@ -55,7 +56,7 @@ class ContactController(QWidget, Ui_Dialog):
|
||||
|
||||
def showContact(self):
|
||||
"""
|
||||
显示聊天界面
|
||||
显示联系人
|
||||
:return:
|
||||
"""
|
||||
print('show')
|
||||
@ -112,15 +113,32 @@ class ContactController(QWidget, Ui_Dialog):
|
||||
self.userinfo.l_username.setText(f'微信号:{alias}')
|
||||
self.userinfo.lineEdit.setText(conRemark)
|
||||
|
||||
def closeEvent(self, a0: QtGui.QCloseEvent) -> None:
|
||||
print("closed")
|
||||
self.exitSignal.emit()
|
||||
self.close()
|
||||
|
||||
def output(self):
|
||||
"""
|
||||
导出聊天记录
|
||||
:return:
|
||||
"""
|
||||
self.outputThread = output.Output(self.Me, self.now_talkerId)
|
||||
self.outputThread.progressSignal.connect(self.output_progress)
|
||||
self.outputThread.rangeSignal.connect(self.set_progressBar_range)
|
||||
self.outputThread.okSignal.connect(self.hide_progress_bar)
|
||||
self.outputThread.start()
|
||||
|
||||
def hide_progress_bar(self, int):
|
||||
self.userinfo.progressBar.setVisible(False)
|
||||
|
||||
def set_progressBar_range(self, value):
|
||||
self.userinfo.progressBar.setVisible(True)
|
||||
self.userinfo.progressBar.setRange(0, value)
|
||||
|
||||
def output_progress(self, value):
|
||||
self.userinfo.progressBar.setProperty('value', value)
|
||||
|
||||
def analysis(self):
|
||||
"""
|
||||
聊天分析
|
||||
:return:
|
||||
"""
|
||||
self.analysisView = analysis.AnalysisController(self.now_talkerId)
|
||||
self.analysisView.show()
|
||||
pass
|
||||
|
@ -81,6 +81,10 @@ class Ui_Frame(object):
|
||||
self.btn_analysis = QtWidgets.QPushButton(self.horizontalLayoutWidget_2)
|
||||
self.btn_analysis.setObjectName("btn_analysis")
|
||||
self.horizontalLayout_2.addWidget(self.btn_analysis)
|
||||
self.progressBar = QtWidgets.QProgressBar(Frame)
|
||||
self.progressBar.setGeometry(QtCore.QRect(210, 480, 451, 23))
|
||||
self.progressBar.setProperty("value", 24)
|
||||
self.progressBar.setObjectName("progressBar")
|
||||
|
||||
self.retranslateUi(Frame)
|
||||
QtCore.QMetaObject.connectSlotsByName(Frame)
|
||||
|
@ -180,6 +180,19 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>210</x>
|
||||
<y>480</y>
|
||||
<width>451</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
@ -5,7 +5,7 @@
|
||||
@Time : 2023/1/5 18:13
|
||||
@IDE : Pycharm
|
||||
@Version : Python3.10
|
||||
@comment : ···
|
||||
@comment : ··· 解密数据库,导出原始数据库文件
|
||||
"""
|
||||
import hashlib
|
||||
import os
|
||||
@ -92,6 +92,7 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
|
||||
return False
|
||||
|
||||
def key(self, uin, IMEI='1234567890ABCDEF'):
|
||||
|
||||
print(IMEI, uin)
|
||||
m = hashlib.md5()
|
||||
m.update(bytes((IMEI + uin).encode('utf-8')))
|
||||
@ -110,6 +111,7 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
|
||||
:param value: 进度0-100
|
||||
:return: None
|
||||
"""
|
||||
|
||||
self.progressBar.setProperty('value', value)
|
||||
if value == '100':
|
||||
QMessageBox.information(self, "解密成功", "请退出该界面",
|
||||
|
@ -5,7 +5,7 @@
|
||||
@Time : 2022/12/13 15:07
|
||||
@IDE : Pycharm
|
||||
@Version : Python3.10
|
||||
@comment : ···
|
||||
@comment : 主窗口
|
||||
"""
|
||||
|
||||
from PyQt5.QtWidgets import *
|
||||
@ -67,6 +67,9 @@ class MainWinController(QMainWindow, Ui_Dialog):
|
||||
self.myavatar.setPixmap(pixmap) # 在label上显示图片
|
||||
|
||||
def chat_view(self):
|
||||
"""
|
||||
聊天窗口
|
||||
"""
|
||||
self.now_btn = self.btn_chat
|
||||
self.now_btn.setStyleSheet(
|
||||
"QPushButton {background-color: rgb(198,198,198);}")
|
||||
@ -78,6 +81,9 @@ class MainWinController(QMainWindow, Ui_Dialog):
|
||||
self.chatView.showChat()
|
||||
|
||||
def contact_view(self):
|
||||
"""
|
||||
联系人窗口
|
||||
"""
|
||||
self.now_btn = self.btn_contact
|
||||
self.now_btn.setStyleSheet(
|
||||
"QPushButton {background-color: rgb(198,198,198);}")
|
||||
@ -89,6 +95,9 @@ class MainWinController(QMainWindow, Ui_Dialog):
|
||||
self.contactView.showContact()
|
||||
|
||||
def myInfo(self):
|
||||
"""
|
||||
显示我的个人信息
|
||||
"""
|
||||
self.now_btn = self.btn_myinfo
|
||||
self.now_btn.setStyleSheet(
|
||||
"QPushButton {background-color: rgb(198,198,198);}")
|
||||
@ -98,11 +107,17 @@ class MainWinController(QMainWindow, Ui_Dialog):
|
||||
self.last_btn = self.now_btn
|
||||
|
||||
def about(self):
|
||||
"""
|
||||
关于
|
||||
"""
|
||||
QMessageBox.about(self, "关于",
|
||||
"关于作者\n姓名:周帅康\n邮箱:lc863854@mail.nwpu.edu.cn"
|
||||
)
|
||||
|
||||
def setviewVisible(self, view):
|
||||
"""
|
||||
设置窗口可见性
|
||||
"""
|
||||
view.setVisible(True)
|
||||
if view != self.lastView and self.lastView:
|
||||
self.lastView.setVisible(False)
|
||||
|
Loading…
Reference in New Issue
Block a user