Skip to content

Commit

Permalink
修复聊天气泡不能更改大小的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LC044 committed Nov 17, 2023
1 parent fc0b125 commit a24ce6a
Show file tree
Hide file tree
Showing 8 changed files with 248 additions and 48 deletions.
81 changes: 45 additions & 36 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/DataBase/micro_msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def get_contact():
from Contact inner join ContactHeadImgUrl on Contact.UserName = ContactHeadImgUrl.usrName
where Type=3 and Alias is not null
order by PYInitial
limit 30
'''
cursor.execute(sql)
result = cursor.fetchall()
Expand Down
2 changes: 2 additions & 0 deletions app/components/bubble_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ def __init__(self):
bubble_message1 = BubbleMessage("D:\Project\Python\PyQt-master\QLabel\Data\\fg1.png", avatar, Type=3,
is_send=False)
layout0.addWidget(bubble_message1)

self.spacerItem = QSpacerItem(10, 10, QSizePolicy.Minimum, QSizePolicy.Expanding)
layout0.addItem(self.spacerItem)
# layout.setStretch(0, 1)
Expand All @@ -302,6 +303,7 @@ class Test(QWidget):
def __init__(self):
super().__init__()
layout = QVBoxLayout()
self.resize(500, 600)
w1 = MyWidget()
w2 = QLabel("nihao")
layout.addWidget(w1)
Expand Down
15 changes: 13 additions & 2 deletions app/person.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

class Person:
def __init__(self, wxid: str):

self.wxid = wxid
self.conRemark = data.get_conRemark(wxid)
self.nickname, self.alias = data.get_nickname(wxid)
Expand Down Expand Up @@ -52,7 +53,15 @@ def inner():

@singleton
class MePC:
def __init__(self, contact_info: Dict):
def __init__(self):
contact_info = {
'UserName': 'contact_info_list[0]',
'Alias': 'contact_info_list[1]',
'Type': 'contact_info_list[2]',
'Remark': 'contact_info_list[3]',
'NickName': 'contact_info_list[4]',
'smallHeadImgUrl': 'contact_info_list[7]'
}
self.wxid = contact_info.get('UserName')
self.remark = contact_info.get('Remark')
# Alias,Type,Remark,NickName,PYInitial,RemarkPYInitial,ContactHeadImgUrl.smallHeadImgUrl,ContactHeadImgUrl,bigHeadImgUrl
Expand Down Expand Up @@ -105,4 +114,6 @@ def __init__(self, wxid: str):


if __name__ == '__main__':
pass
p1 = MePC()
p2 = MePC()
print(p1 == p2)
1 change: 0 additions & 1 deletion app/ui_pc/chat/chatInfoUi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(817, 748)
self.verticalLayout = QtWidgets.QVBoxLayout(Form)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.setSpacing(0)
Expand Down
68 changes: 68 additions & 0 deletions app/ui_pc/chat/chatUi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# -*- 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, QtWidgets


class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(840, 752)
Form.setStyleSheet("background: rgb(240, 240, 240);")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(Form)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setSpacing(0)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtWidgets.QLabel(Form)
self.label.setText("")
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)
self.lineEdit = QtWidgets.QLineEdit(Form)
self.lineEdit.setMinimumSize(QtCore.QSize(200, 30))
self.lineEdit.setMaximumSize(QtCore.QSize(200, 16777215))
self.lineEdit.setStyleSheet("background:transparent;\n"
" border-width:0;\n"
" border-style:outset;\n"
" background-color:rgb(226,226,226);\n"
" ")
self.lineEdit.setCursorMoveStyle(QtCore.Qt.VisualMoveStyle)
self.lineEdit.setObjectName("lineEdit")
self.horizontalLayout.addWidget(self.lineEdit)
self.label_2 = QtWidgets.QLabel(Form)
self.label_2.setText("")
self.label_2.setObjectName("label_2")
self.horizontalLayout.addWidget(self.label_2)
self.verticalLayout.addLayout(self.horizontalLayout)
self.verticalLayout_2.addLayout(self.verticalLayout)
self.listWidget = QtWidgets.QListWidget(Form)
self.listWidget.setMinimumSize(QtCore.QSize(250, 0))
self.listWidget.setMaximumSize(QtCore.QSize(250, 16777215))
self.listWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.listWidget.setObjectName("listWidget")
self.verticalLayout_2.addWidget(self.listWidget)
self.verticalLayout_2.setStretch(1, 1)
self.horizontalLayout_2.addLayout(self.verticalLayout_2)
self.stackedWidget = QtWidgets.QStackedWidget(Form)
self.stackedWidget.setObjectName("stackedWidget")
self.horizontalLayout_2.addWidget(self.stackedWidget)
self.horizontalLayout_2.setStretch(1, 1)

self.retranslateUi(Form)
self.stackedWidget.setCurrentIndex(-1)
QtCore.QMetaObject.connectSlotsByName(Form)

def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Form"))
Loading

0 comments on commit a24ce6a

Please sign in to comment.