From e8d6774f5f506420e5cd8a701293992d0871bf4a Mon Sep 17 00:00:00 2001 From: shuaikangzhou <863909694@qq.com> Date: Wed, 3 Jan 2024 23:45:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9label=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/person.py | 12 +++++++++++- app/ui/Icon.py | 8 +++++--- app/ui/contact/userinfo/userinfoUi.py | 10 +++++----- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/app/person.py b/app/person.py index 9beddcf..2f05bb0 100644 --- a/app/person.py +++ b/app/person.py @@ -79,7 +79,17 @@ class Contact(Person): self.avatar_path = Icon.Default_avatar_path self.is_chatroom = self.wxid.__contains__('@chatroom') self.detail = contact_info.get('detail') - self.label_name = contact_info.get('label_name') + self.label_name = contact_info.get('label_name') # 联系人的标签分类 + + """ + detail存储了联系人的详细信息,是个字典 + { + 'region': tuple[国家,省份,市], # 地区三元组 + 'signature': str, # 个性签名 + 'telephone': str, # 电话号码,自己写的备注才会显示 + 'gender': int, # 性别 0:未知,1:男,2:女 + } + """ class ContactDefault(Person): diff --git a/app/ui/Icon.py b/app/ui/Icon.py index 87e0c5f..d63dead 100644 --- a/app/ui/Icon.py +++ b/app/ui/Icon.py @@ -1,4 +1,4 @@ -from PyQt5.QtGui import QIcon +from PyQt5.QtGui import QIcon, QPixmap from app.resources import resource_rc @@ -32,8 +32,10 @@ class Icon: Folder_Icon = QIcon(':/icons/icons/folder.svg') Start_Icon = QIcon(':/icons/icons/start.svg') Decrypt_Icon = QIcon(':/icons/icons/decrypt.svg') - Man_Icon = QIcon(':/icons/icons/man.svg') - Woman_Icon = QIcon(':/icons/icons/woman.svg') Man_Icon_path = ':/icons/icons/man.svg' Woman_Icon_path = ':/icons/icons/woman.svg' + Man_Icon = QIcon(':/icons/icons/man.svg') + Woman_Icon = QIcon(':/icons/icons/woman.svg') + # Man_Icon_pixmap = QPixmap(Man_Icon_path) + # Woman_Icon_pixmap = QPixmap(Woman_Icon_path) # Logo_Icon = QIcon(':/icons/icons/logo.png') diff --git a/app/ui/contact/userinfo/userinfoUi.py b/app/ui/contact/userinfo/userinfoUi.py index a3928b3..29f690f 100644 --- a/app/ui/contact/userinfo/userinfoUi.py +++ b/app/ui/contact/userinfo/userinfoUi.py @@ -54,6 +54,7 @@ class Ui_Frame(object): sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.l_gender.sizePolicy().hasHeightForWidth()) self.l_gender.setSizePolicy(sizePolicy) + self.l_gender.setText("") self.l_gender.setObjectName("l_gender") self.horizontalLayout.addWidget(self.l_gender) self.gridLayout_2.addLayout(self.horizontalLayout, 0, 1, 1, 1) @@ -70,6 +71,7 @@ class Ui_Frame(object): self.l_username.setObjectName("l_username") self.gridLayout_2.addWidget(self.l_username, 2, 1, 1, 1) self.l_region = QtWidgets.QLabel(Frame) + self.l_region.setText("") self.l_region.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse) self.l_region.setObjectName("l_region") self.gridLayout_2.addWidget(self.l_region, 3, 1, 1, 1) @@ -108,6 +110,7 @@ class Ui_Frame(object): self.label_4.setObjectName("label_4") self.gridLayout.addWidget(self.label_4, 1, 0, 1, 1) self.l_tel = QtWidgets.QLabel(Frame) + self.l_tel.setText("") self.l_tel.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse) self.l_tel.setObjectName("l_tel") self.gridLayout.addWidget(self.l_tel, 1, 1, 1, 1) @@ -120,6 +123,7 @@ class Ui_Frame(object): self.label_3.setObjectName("label_3") self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1) self.l_contact_label = QtWidgets.QLabel(Frame) + self.l_contact_label.setText("") self.l_contact_label.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse) self.l_contact_label.setObjectName("l_contact_label") self.gridLayout.addWidget(self.l_contact_label, 2, 1, 1, 1) @@ -134,6 +138,7 @@ class Ui_Frame(object): self.l_signature = QtWidgets.QLabel(Frame) self.l_signature.setMinimumSize(QtCore.QSize(300, 0)) self.l_signature.setMaximumSize(QtCore.QSize(300, 100)) + self.l_signature.setText("") self.l_signature.setWordWrap(True) self.l_signature.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse) self.l_signature.setObjectName("l_signature") @@ -152,15 +157,10 @@ class Ui_Frame(object): _translate = QtCore.QCoreApplication.translate Frame.setWindowTitle(_translate("Frame", "Frame")) self.l_remark.setText(_translate("Frame", "曹雨萱")) - self.l_gender.setText(_translate("Frame", "TextLabel")) self.l_nickname.setText(_translate("Frame", "昵称:997")) self.l_username.setText(_translate("Frame", "账号:TextLabel")) - self.l_region.setText(_translate("Frame", "TextLabel")) self.label.setText(_translate("Frame", "备注名")) self.lineEdit.setText(_translate("Frame", "曹雨萱")) self.label_4.setText(_translate("Frame", "电话")) - self.l_tel.setText(_translate("Frame", "TextLabel")) self.label_3.setText(_translate("Frame", "标签")) - self.l_contact_label.setText(_translate("Frame", "TextLabel")) self.label_2.setText(_translate("Frame", "个性签名")) - self.l_signature.setText(_translate("Frame", "TextLabel"))