-
Notifications
You must be signed in to change notification settings - Fork 1
/
ChatSet.py
35 lines (28 loc) · 1.16 KB
/
ChatSet.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import sys
import os
from PyQt5 import QtCore,QtWidgets,QtGui
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from Ui_chatset import Ui_Dialog
class chooseFile(QtWidgets.QMainWindow,Ui_Dialog):
mySignal = pyqtSignal(dict)
def __init__(self,parent = None):
super(chooseFile,self).__init__(parent)
self.setupUi(self)
self.cwd = os.getcwd() # 获取当前程序文件位置
self.lineEdit.setReadOnly(True)
def OpenFiles(self):
fileName_choose, filetype = QFileDialog.getOpenFileName(self,
"选取文件",
self.cwd, # 起始路径
"JPG Files (*.jpg);;PNG Files (*.png)") # 设置文件扩展名过滤,用双分号间隔
self.lineEdit.setText(fileName_choose)
def SetMessage(self):
dic = {}
dic['聊天背景'] = self.lineEdit.text()
dic['字体'] = self.comboBox.currentText()
dic['字体样式'] = self.comboBox_2.currentText()
dic['字体大小'] = self.comboBox_3.currentText()
self.mySignal.emit(dic)
self.close()