mirror of
https://github.com/LC044/WeChatMsg
synced 2025-02-22 19:02:17 +08:00
将自己的wxid设置为配置文件
This commit is contained in:
parent
19e485cae0
commit
a38550c5ff
@ -4,12 +4,14 @@
|
|||||||
<option name="autoReloadType" value="SELECTIVE" />
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="84e65474-7da9-466d-baf3-cc88dde3ffdd" name="变更" comment="修复聊天气泡不能更改大小的bug">
|
<list default="true" id="84e65474-7da9-466d-baf3-cc88dde3ffdd" name="变更" comment="更改头像显示">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/DataBase/micro_msg.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/DataBase/micro_msg.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/DataBase/msg.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/DataBase/msg.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/person.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/person.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/person.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/person.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/ui_pc/chat/chat_info.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/chat/chat_info.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/ui_pc/chat/chat_window.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/chat/chat_window.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/app/ui_pc/contact/contact_window.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/contact/contact_window.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/ui_pc/mainview.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/mainview.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/ui_pc/mainview.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/mainview.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/app/ui_pc/tool/pc_decrypt/pc_decrypt.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/tool/pc_decrypt/pc_decrypt.py" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/app/ui_pc/tool/tool_window.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/tool/tool_window.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/app/ui_pc/tool/tool_window.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/tool/tool_window.py" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
@ -276,13 +278,6 @@
|
|||||||
<option name="presentableId" value="Default" />
|
<option name="presentableId" value="Default" />
|
||||||
<updated>1672848140146</updated>
|
<updated>1672848140146</updated>
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00021" summary="readme">
|
|
||||||
<created>1684598440645</created>
|
|
||||||
<option name="number" value="00021" />
|
|
||||||
<option name="presentableId" value="LOCAL-00021" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1684598440645</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00022" summary="readme">
|
<task id="LOCAL-00022" summary="readme">
|
||||||
<created>1684599002132</created>
|
<created>1684599002132</created>
|
||||||
<option name="number" value="00022" />
|
<option name="number" value="00022" />
|
||||||
@ -619,7 +614,14 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1700232296923</updated>
|
<updated>1700232296923</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="70" />
|
<task id="LOCAL-00070" summary="更改头像显示">
|
||||||
|
<created>1700233361985</created>
|
||||||
|
<option name="number" value="00070" />
|
||||||
|
<option name="presentableId" value="LOCAL-00070" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1700233361985</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="71" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="UnknownFeatures">
|
<component name="UnknownFeatures">
|
||||||
@ -655,7 +657,6 @@
|
|||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<MESSAGE value="用stackWidget重写contactUI" />
|
|
||||||
<MESSAGE value="修改联系人视图架构" />
|
<MESSAGE value="修改联系人视图架构" />
|
||||||
<MESSAGE value="加快打开速度" />
|
<MESSAGE value="加快打开速度" />
|
||||||
<MESSAGE value="修改导入路径,方便打包成exe" />
|
<MESSAGE value="修改导入路径,方便打包成exe" />
|
||||||
@ -680,7 +681,8 @@
|
|||||||
<MESSAGE value="update readme" />
|
<MESSAGE value="update readme" />
|
||||||
<MESSAGE value="数据库加锁避免多线程访问报错" />
|
<MESSAGE value="数据库加锁避免多线程访问报错" />
|
||||||
<MESSAGE value="修复聊天气泡不能更改大小的bug" />
|
<MESSAGE value="修复聊天气泡不能更改大小的bug" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="修复聊天气泡不能更改大小的bug" />
|
<MESSAGE value="更改头像显示" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="更改头像显示" />
|
||||||
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" />
|
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" />
|
||||||
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
|
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
|
||||||
</component>
|
</component>
|
||||||
@ -704,17 +706,17 @@
|
|||||||
</line-breakpoint>
|
</line-breakpoint>
|
||||||
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
||||||
<url>file://$PROJECT_DIR$/app/person.py</url>
|
<url>file://$PROJECT_DIR$/app/person.py</url>
|
||||||
<line>101</line>
|
<line>100</line>
|
||||||
<option name="timeStamp" value="10" />
|
<option name="timeStamp" value="10" />
|
||||||
</line-breakpoint>
|
</line-breakpoint>
|
||||||
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
||||||
<url>file://$PROJECT_DIR$/app/person.py</url>
|
<url>file://$PROJECT_DIR$/app/person.py</url>
|
||||||
<line>99</line>
|
<line>98</line>
|
||||||
<option name="timeStamp" value="11" />
|
<option name="timeStamp" value="11" />
|
||||||
</line-breakpoint>
|
</line-breakpoint>
|
||||||
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
|
||||||
<url>file://$PROJECT_DIR$/app/person.py</url>
|
<url>file://$PROJECT_DIR$/app/person.py</url>
|
||||||
<line>100</line>
|
<line>99</line>
|
||||||
<option name="timeStamp" value="12" />
|
<option name="timeStamp" value="12" />
|
||||||
</line-breakpoint>
|
</line-breakpoint>
|
||||||
</breakpoints>
|
</breakpoints>
|
||||||
|
@ -31,7 +31,6 @@ def get_contact():
|
|||||||
from Contact inner join ContactHeadImgUrl on Contact.UserName = ContactHeadImgUrl.usrName
|
from Contact inner join ContactHeadImgUrl on Contact.UserName = ContactHeadImgUrl.usrName
|
||||||
where Type=3 and Alias is not null
|
where Type=3 and Alias is not null
|
||||||
order by PYInitial
|
order by PYInitial
|
||||||
limit 30
|
|
||||||
'''
|
'''
|
||||||
cursor.execute(sql)
|
cursor.execute(sql)
|
||||||
result = cursor.fetchall()
|
result = cursor.fetchall()
|
||||||
|
@ -62,7 +62,7 @@ def get_message_by_num(username_, n):
|
|||||||
from MSG
|
from MSG
|
||||||
where StrTalker=?
|
where StrTalker=?
|
||||||
order by CreateTime
|
order by CreateTime
|
||||||
limit 10
|
limit 100
|
||||||
'''
|
'''
|
||||||
result = []
|
result = []
|
||||||
try:
|
try:
|
||||||
|
@ -64,7 +64,6 @@ class MePC:
|
|||||||
self.avatar.loadFromData(img_bytes, format='PNG')
|
self.avatar.loadFromData(img_bytes, format='PNG')
|
||||||
else:
|
else:
|
||||||
self.avatar.loadFromData(img_bytes, format='jfif')
|
self.avatar.loadFromData(img_bytes, format='jfif')
|
||||||
self.avatar = QPixmap()
|
|
||||||
|
|
||||||
|
|
||||||
class ContactPC:
|
class ContactPC:
|
||||||
|
@ -46,6 +46,8 @@ HistoryPanel::item:hover {
|
|||||||
|
|
||||||
|
|
||||||
class ChatWindow(QWidget, Ui_Form):
|
class ChatWindow(QWidget, Ui_Form):
|
||||||
|
load_finish_signal = pyqtSignal(bool)
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.show_thread = None
|
self.show_thread = None
|
||||||
@ -56,6 +58,7 @@ class ChatWindow(QWidget, Ui_Form):
|
|||||||
self.show_chats()
|
self.show_chats()
|
||||||
|
|
||||||
def init_ui(self):
|
def init_ui(self):
|
||||||
|
|
||||||
search_action = QAction(self.lineEdit)
|
search_action = QAction(self.lineEdit)
|
||||||
search_action.setIcon(Icon.Search_Icon)
|
search_action.setIcon(Icon.Search_Icon)
|
||||||
self.lineEdit.addAction(search_action, QLineEdit.LeadingPosition)
|
self.lineEdit.addAction(search_action, QLineEdit.LeadingPosition)
|
||||||
@ -74,6 +77,7 @@ class ChatWindow(QWidget, Ui_Form):
|
|||||||
return
|
return
|
||||||
self.show_thread = ShowContactThread()
|
self.show_thread = ShowContactThread()
|
||||||
self.show_thread.showSingal.connect(self.show_chat)
|
self.show_thread.showSingal.connect(self.show_chat)
|
||||||
|
self.show_thread.load_finish_signal.connect(self.stop_loading)
|
||||||
self.show_thread.start()
|
self.show_thread.start()
|
||||||
self.ok_flag = True
|
self.ok_flag = True
|
||||||
|
|
||||||
@ -88,9 +92,14 @@ class ChatWindow(QWidget, Ui_Form):
|
|||||||
print(row)
|
print(row)
|
||||||
self.stackedWidget.setCurrentIndex(row)
|
self.stackedWidget.setCurrentIndex(row)
|
||||||
|
|
||||||
|
def stop_loading(self, a0):
|
||||||
|
# self.label.setVisible(False)
|
||||||
|
self.load_finish_signal.emit(True)
|
||||||
|
|
||||||
|
|
||||||
class ShowContactThread(QThread):
|
class ShowContactThread(QThread):
|
||||||
showSingal = pyqtSignal(ContactPC)
|
showSingal = pyqtSignal(ContactPC)
|
||||||
|
load_finish_signal = pyqtSignal(bool)
|
||||||
|
|
||||||
# heightSingal = pyqtSignal(int)
|
# heightSingal = pyqtSignal(int)
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -113,3 +122,4 @@ class ShowContactThread(QThread):
|
|||||||
contact.set_avatar(contact.smallHeadImgBLOG)
|
contact.set_avatar(contact.smallHeadImgBLOG)
|
||||||
self.showSingal.emit(contact)
|
self.showSingal.emit(contact)
|
||||||
# pprint(contact.__dict__)
|
# pprint(contact.__dict__)
|
||||||
|
self.load_finish_signal.emit(True)
|
||||||
|
@ -46,6 +46,8 @@ HistoryPanel::item:hover {
|
|||||||
|
|
||||||
|
|
||||||
class ContactWindow(QWidget, Ui_Form):
|
class ContactWindow(QWidget, Ui_Form):
|
||||||
|
load_finish_signal = pyqtSignal(bool)
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.show_thread = None
|
self.show_thread = None
|
||||||
@ -73,6 +75,7 @@ class ContactWindow(QWidget, Ui_Form):
|
|||||||
return
|
return
|
||||||
self.show_thread = ShowContactThread()
|
self.show_thread = ShowContactThread()
|
||||||
self.show_thread.showSingal.connect(self.show_contact)
|
self.show_thread.showSingal.connect(self.show_contact)
|
||||||
|
self.show_thread.load_finish_signal.connect(self.load_finish_signal)
|
||||||
self.show_thread.start()
|
self.show_thread.start()
|
||||||
self.ok_flag = True
|
self.ok_flag = True
|
||||||
|
|
||||||
@ -90,6 +93,7 @@ class ContactWindow(QWidget, Ui_Form):
|
|||||||
|
|
||||||
class ShowContactThread(QThread):
|
class ShowContactThread(QThread):
|
||||||
showSingal = pyqtSignal(ContactPC)
|
showSingal = pyqtSignal(ContactPC)
|
||||||
|
load_finish_signal = pyqtSignal(bool)
|
||||||
|
|
||||||
# heightSingal = pyqtSignal(int)
|
# heightSingal = pyqtSignal(int)
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -112,3 +116,4 @@ class ShowContactThread(QThread):
|
|||||||
contact.set_avatar(contact.smallHeadImgBLOG)
|
contact.set_avatar(contact.smallHeadImgBLOG)
|
||||||
self.showSingal.emit(contact)
|
self.showSingal.emit(contact)
|
||||||
# pprint(contact.__dict__)
|
# pprint(contact.__dict__)
|
||||||
|
self.load_finish_signal.emit(True)
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
@Version : Python3.10
|
@Version : Python3.10
|
||||||
@comment : 主窗口
|
@comment : 主窗口
|
||||||
"""
|
"""
|
||||||
|
import json
|
||||||
from random import randint
|
from random import randint
|
||||||
|
|
||||||
from PyQt5.QtCore import *
|
from PyQt5.QtCore import *
|
||||||
@ -73,37 +74,65 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
|||||||
self.resize(QSize(800, 600))
|
self.resize(QSize(800, 600))
|
||||||
# self.stackedWidget = QtWidgets.QStackedWidget(self.centralwidget)
|
# self.stackedWidget = QtWidgets.QStackedWidget(self.centralwidget)
|
||||||
self.action_desc.triggered.connect(self.about)
|
self.action_desc.triggered.connect(self.about)
|
||||||
|
self.load_data()
|
||||||
self.init_ui()
|
self.init_ui()
|
||||||
|
self.load_num = 0
|
||||||
|
|
||||||
|
def load_data(self):
|
||||||
|
with open('./app/data/info.json', 'r', encoding='utf-8') as f:
|
||||||
|
dic = json.loads(f.read())
|
||||||
|
wxid = dic.get('wxid')
|
||||||
|
if wxid:
|
||||||
|
me = MePC()
|
||||||
|
self.set_my_info(wxid)
|
||||||
|
|
||||||
def init_ui(self):
|
def init_ui(self):
|
||||||
|
# self.movie = QMovie("./app/data/loading.gif")
|
||||||
|
self.label = QLabel(self)
|
||||||
|
self.label.setGeometry(0, 0, self.width(), self.height())
|
||||||
|
# self.label.setMovie(self.movie)
|
||||||
|
# self.movie.start()
|
||||||
self.listWidget.currentRowChanged.connect(self.setCurrentIndex)
|
self.listWidget.currentRowChanged.connect(self.setCurrentIndex)
|
||||||
|
tool_item = QListWidgetItem(Icon.MyInfo_Icon, '工具', self.listWidget)
|
||||||
chat_item = QListWidgetItem(Icon.Chat_Icon, '聊天', self.listWidget)
|
chat_item = QListWidgetItem(Icon.Chat_Icon, '聊天', self.listWidget)
|
||||||
contact_item = QListWidgetItem(Icon.Contact_Icon, '好友', self.listWidget)
|
contact_item = QListWidgetItem(Icon.Contact_Icon, '好友', self.listWidget)
|
||||||
myinfo_item = QListWidgetItem(Icon.MyInfo_Icon, '我的', self.listWidget)
|
myinfo_item = QListWidgetItem(Icon.MyInfo_Icon, '我的', self.listWidget)
|
||||||
tool_item = QListWidgetItem(Icon.MyInfo_Icon, '工具', self.listWidget)
|
|
||||||
|
|
||||||
tool_window = ToolWindow()
|
tool_window = ToolWindow()
|
||||||
tool_window.get_info_signal.connect(self.set_my_info)
|
tool_window.get_info_signal.connect(self.set_my_info)
|
||||||
self.chat_window = ChatWindow()
|
tool_window.load_finish_signal.connect(self.loading)
|
||||||
self.stackedWidget.addWidget(self.chat_window)
|
self.stackedWidget.addWidget(tool_window)
|
||||||
self.contact_window = ContactWindow()
|
self.listWidget.setCurrentRow(0)
|
||||||
# self.contact_window = QWidget()
|
self.stackedWidget.setCurrentIndex(0)
|
||||||
self.stackedWidget.addWidget(self.contact_window)
|
chat_window = ChatWindow()
|
||||||
label = QLabel('我是页面', self)
|
self.stackedWidget.addWidget(chat_window)
|
||||||
|
contact_window = ContactWindow()
|
||||||
|
self.stackedWidget.addWidget(contact_window)
|
||||||
|
label = QLabel('我是页面')
|
||||||
label.setAlignment(Qt.AlignCenter)
|
label.setAlignment(Qt.AlignCenter)
|
||||||
# 设置label的背景颜色(这里随机)
|
# 设置label的背景颜色(这里随机)
|
||||||
# 这里加了一个margin边距(方便区分QStackedWidget和QLabel的颜色)
|
# 这里加了一个margin边距(方便区分QStackedWidget和QLabel的颜色)
|
||||||
label.setStyleSheet('background: rgb(%d, %d, %d);margin: 50px;' % (
|
label.setStyleSheet('background: rgb(%d, %d, %d);margin: 50px;' % (
|
||||||
randint(0, 255), randint(0, 255), randint(0, 255)))
|
randint(0, 255), randint(0, 255), randint(0, 255)))
|
||||||
self.stackedWidget.addWidget(label)
|
self.stackedWidget.addWidget(label)
|
||||||
self.stackedWidget.addWidget(tool_window)
|
tool_window.load_finish_signal.connect(self.loading)
|
||||||
self.listWidget.setCurrentRow(3)
|
contact_window.load_finish_signal.connect(self.loading)
|
||||||
self.stackedWidget.setCurrentIndex(3)
|
chat_window.load_finish_signal.connect(self.loading)
|
||||||
|
# self.load_window_thread = LoadWindowThread(self.stackedWidget)
|
||||||
|
# self.load_window_thread.okSignal.connect(self.stop_loading)
|
||||||
|
# self.load_window_thread.start()
|
||||||
|
|
||||||
def setCurrentIndex(self, row):
|
def setCurrentIndex(self, row):
|
||||||
if row == 1:
|
|
||||||
self.contact_window.show_contacts()
|
|
||||||
self.stackedWidget.setCurrentIndex(row)
|
self.stackedWidget.setCurrentIndex(row)
|
||||||
|
if row == 2:
|
||||||
|
self.stackedWidget.currentWidget().show_contacts()
|
||||||
|
|
||||||
|
def setWindow(self, window):
|
||||||
|
try:
|
||||||
|
window.load_finish_signal.connect(self.loading)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
self.stackedWidget.addWidget(window)
|
||||||
|
|
||||||
def set_my_info(self, wxid):
|
def set_my_info(self, wxid):
|
||||||
self.avatar = QPixmap()
|
self.avatar = QPixmap()
|
||||||
@ -115,9 +144,24 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
|||||||
self.avatar.scaled(60, 60)
|
self.avatar.scaled(60, 60)
|
||||||
me = MePC()
|
me = MePC()
|
||||||
me.set_avatar(img_bytes)
|
me.set_avatar(img_bytes)
|
||||||
|
dic = {
|
||||||
|
'wxid': wxid
|
||||||
|
}
|
||||||
|
with open('./app/data/info.json', 'w', encoding='utf-8') as f:
|
||||||
|
f.write(json.dumps(dic))
|
||||||
self.myavatar.setScaledContents(True)
|
self.myavatar.setScaledContents(True)
|
||||||
self.myavatar.setPixmap(self.avatar)
|
self.myavatar.setPixmap(self.avatar)
|
||||||
|
|
||||||
|
def stop_loading(self, a0):
|
||||||
|
self.label.setVisible(False)
|
||||||
|
|
||||||
|
def loading(self, a0):
|
||||||
|
self.load_num += 1
|
||||||
|
print('加载一个了')
|
||||||
|
if self.load_num == 2:
|
||||||
|
print('ok了')
|
||||||
|
self.label.setVisible(False)
|
||||||
|
|
||||||
def about(self):
|
def about(self):
|
||||||
"""
|
"""
|
||||||
关于
|
关于
|
||||||
@ -133,3 +177,26 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow):
|
|||||||
del self.stackedWidget
|
del self.stackedWidget
|
||||||
msg.close()
|
msg.close()
|
||||||
self.contact_window.close()
|
self.contact_window.close()
|
||||||
|
|
||||||
|
|
||||||
|
class LoadWindowThread(QThread):
|
||||||
|
windowSignal = pyqtSignal(QWidget)
|
||||||
|
okSignal = pyqtSignal(bool)
|
||||||
|
|
||||||
|
def __init__(self, stackedWidget):
|
||||||
|
super().__init__()
|
||||||
|
self.stackedWidget = stackedWidget
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
chat_window = ChatWindow()
|
||||||
|
self.stackedWidget.addWidget(chat_window)
|
||||||
|
contact_window = ContactWindow()
|
||||||
|
self.stackedWidget.addWidget(contact_window)
|
||||||
|
label = QLabel('我是页面')
|
||||||
|
label.setAlignment(Qt.AlignCenter)
|
||||||
|
# 设置label的背景颜色(这里随机)
|
||||||
|
# 这里加了一个margin边距(方便区分QStackedWidget和QLabel的颜色)
|
||||||
|
label.setStyleSheet('background: rgb(%d, %d, %d);margin: 50px;' % (
|
||||||
|
randint(0, 255), randint(0, 255), randint(0, 255)))
|
||||||
|
self.stackedWidget.addWidget(label)
|
||||||
|
self.okSignal.emit(True)
|
||||||
|
@ -46,12 +46,14 @@ HistoryPanel::item:hover {
|
|||||||
|
|
||||||
class ToolWindow(QWidget, Ui_Dialog):
|
class ToolWindow(QWidget, Ui_Dialog):
|
||||||
get_info_signal = pyqtSignal(str)
|
get_info_signal = pyqtSignal(str)
|
||||||
|
load_finish_signal = pyqtSignal(bool)
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.setStyleSheet(Stylesheet)
|
self.setStyleSheet(Stylesheet)
|
||||||
self.init_ui()
|
self.init_ui()
|
||||||
|
self.load_finish_signal.emit(True)
|
||||||
|
|
||||||
def init_ui(self):
|
def init_ui(self):
|
||||||
self.listWidget.clear()
|
self.listWidget.clear()
|
||||||
|
Loading…
Reference in New Issue
Block a user