-
Notifications
You must be signed in to change notification settings - Fork 0
/
taobao_ui.py
155 lines (151 loc) · 8.4 KB
/
taobao_ui.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# -*- coding: utf-8 -*-
# 基于pyuic5生成的代码修改
from PyQt5 import QtCore, QtGui, QtWidgets
from _thread import start_new_thread
import sys
def get_dpi_scale(MainWindow):
# 获取系统DPI缩放比例
screen = QtWidgets.QApplication.primaryScreen()
dpi_x = MainWindow.logicalDpiX()
dpi_y = MainWindow.logicalDpiY()
return dpi_x/96, dpi_y/96
class Ui_MainWindow:
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.setFixedSize(750, 800)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
MainWindow.setSizePolicy(sizePolicy)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.label_3 = QtWidgets.QLabel(self.centralwidget)
self.label_3.setGeometry(QtCore.QRect(10, 5, 231, 21))
self.label_3.setObjectName("label_3")
self.label_4 = QtWidgets.QLabel(self.centralwidget)
self.label_4.setGeometry(QtCore.QRect(460, 0, 231, 31))
self.label_4.setObjectName("label_4")
self.lstAccount = QtWidgets.QListWidget(self.centralwidget)
self.lstAccount.setGeometry(QtCore.QRect(10, 30, 231, 501))
self.lstAccount.setObjectName("lstAccount")
self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
self.tabWidget.setGeometry(QtCore.QRect(460, 30, 281, 501))
self.tabWidget.setObjectName("tabWidget")
self.lineEdit = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit.setGeometry(QtCore.QRect(250, 140, 201, 31))
self.lineEdit.setObjectName("lineEdit")
self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
self.groupBox.setGeometry(QtCore.QRect(250, 10, 201, 121))
self.groupBox.setObjectName("groupBox")
self.pushButton_2 = QtWidgets.QPushButton(self.groupBox)
self.pushButton_2.setGeometry(QtCore.QRect(20, 20, 161, 41))
self.pushButton_2.setObjectName("pushButton_2")
self.pushButton_3 = QtWidgets.QPushButton(self.groupBox)
self.pushButton_3.setGeometry(QtCore.QRect(20, 70, 161, 41))
self.pushButton_3.setObjectName("pushButton_3")
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
self.pushButton.setGeometry(QtCore.QRect(250, 260, 201, 41))
self.pushButton.setObjectName("pushButton")
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setGeometry(QtCore.QRect(250, 180, 111, 20))
self.label.setObjectName("label")
self.spinBox = QtWidgets.QSpinBox(self.centralwidget)
self.spinBox.setGeometry(QtCore.QRect(360, 180, 91, 21))
self.spinBox.setObjectName("spinBox")
self.spinBox.setMinimum(1)
self.spinBox.setMaximum(sys.maxsize) # 不限制最大值
self.spinBox.setValue(50)
self.label_2 = QtWidgets.QLabel(self.centralwidget)
self.label_2.setGeometry(QtCore.QRect(250, 300, 81, 31))
self.label_2.setObjectName("label_2")
self.pushButton_4 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_4.setGeometry(QtCore.QRect(400, 305, 51, 21))
self.pushButton_4.setObjectName("pushButton_4")
small_font = QtGui.QFont()
fontsize=8
small_font.setPointSize(min(int(
fontsize*1.25/get_dpi_scale(MainWindow)[0]),fontsize))
self.pushButton_4.setFont(small_font)
self.lstFilters = QtWidgets.QListWidget(self.centralwidget)
self.lstFilters.setGeometry(QtCore.QRect(250, 330, 201, 201))
self.lstFilters.setSelectionRectVisible(True)
self.lstFilters.setObjectName("lstFilters")
MainWindow.setCentralWidget(self.centralwidget)
self.groupBox_2 = QtWidgets.QGroupBox(self.centralwidget)
self.groupBox_2.setGeometry(QtCore.QRect(17, 541, 716, 227))
self.groupBox_2.setObjectName("groupBox_2")
self.textEdit = QtWidgets.QTextEdit(self.groupBox_2)
self.textEdit.setGeometry(QtCore.QRect(13, 16, 691, 201))
self.textEdit.setUndoRedoEnabled(False)
self.textEdit.setReadOnly(True)
self.textEdit.setObjectName("textEdit")
self.pushButton_5 = QtWidgets.QPushButton(self.groupBox_2)
self.pushButton_5.setGeometry(QtCore.QRect(650, 0, 51, 20))
self.pushButton_5.setFont(small_font)
self.pushButton_5.setObjectName("pushButton_5")
self.pushButton_6 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_6.setGeometry(QtCore.QRect(342, 305, 51, 21))
self.pushButton_6.setFont(small_font)
self.pushButton_6.setObjectName("pushButton_6")
self.pushButton_7 = QtWidgets.QPushButton(self.centralwidget)
self.pushButton_7.setGeometry(QtCore.QRect(677, 6, 60, 20))
self.pushButton_7.setFont(small_font)
self.pushButton_7.setObjectName("pushButton_7")
self.label_5 = QtWidgets.QLabel(self.centralwidget)
self.label_5.setGeometry(QtCore.QRect(250, 208, 41, 20))
self.label_5.setObjectName("label_5")
self.label_6 = QtWidgets.QLabel(self.centralwidget)
self.label_6.setGeometry(QtCore.QRect(357, 208, 21, 21))
self.label_6.setObjectName("label_6")
self.chkMin = QtWidgets.QCheckBox(self.centralwidget)
self.chkMin.setGeometry(QtCore.QRect(290, 208, 21, 21))
self.chkMin.setText("")
self.chkMin.setObjectName("chkMin")
self.chkMax = QtWidgets.QCheckBox(self.centralwidget)
self.chkMax.setGeometry(QtCore.QRect(380, 208, 21, 21))
self.chkMax.setText("")
self.chkMax.setObjectName("chkMax")
self.spinPriceMin = QtWidgets.QSpinBox(self.centralwidget)
self.spinPriceMin.setGeometry(QtCore.QRect(310, 208, 51, 21))
self.spinPriceMin.setObjectName("spinPriceMin")
self.spinPriceMin.setMaximum(sys.maxsize)
self.spinPriceMax = QtWidgets.QSpinBox(self.centralwidget)
self.spinPriceMax.setGeometry(QtCore.QRect(400, 208, 51, 21))
self.spinPriceMax.setObjectName("spinPriceMax")
self.spinPriceMax.setMaximum(sys.maxsize)
self.spinPageCnt = QtWidgets.QSpinBox(self.centralwidget)
self.spinPageCnt.setGeometry(QtCore.QRect(338, 236, 113, 21))
self.spinPageCnt.setObjectName("spinPageCnt")
self.spinPageCnt.setMinimum(1)
self.spinPageCnt.setMaximum(sys.maxsize)
self.label_7 = QtWidgets.QLabel(self.centralwidget)
self.label_7.setGeometry(QtCore.QRect(250, 236, 80, 20))
self.label_7.setObjectName("label_7")
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
self.tabWidget.setCurrentIndex(0)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "淘宝商品自动筛选系统"))
self.lineEdit.setPlaceholderText(_translate("MainWindow", "请输入搜索关键词"))
self.groupBox.setTitle(_translate("MainWindow", "账号管理"))
self.pushButton_2.setText(_translate("MainWindow", "添加账号"))
self.pushButton_3.setText(_translate("MainWindow", "移除账号"))
self.pushButton.setText(_translate("MainWindow", "搜索并加入购物车"))
self.label.setText(_translate("MainWindow", "最大商品数:"))
self.label_2.setText(_translate("MainWindow", "筛选条件:"))
self.pushButton_4.setText(_translate("MainWindow", "重置"))
self.groupBox_2.setTitle(_translate("MainWindow", "日志"))
self.pushButton_5.setText(_translate("MainWindow", "清空"))
self.pushButton_6.setText(_translate("MainWindow", "自定义"))
self.pushButton_7.setText(_translate("MainWindow", "全部清空"))
self.statusbar.showMessage(_translate("MainWindow","就绪"))
self.label_3.setText(_translate("MainWindow", " 账号:"))
self.label_4.setText(_translate("MainWindow", " 添加的商品:"))
self.label_5.setText(_translate("MainWindow", "价格"))
self.label_6.setText(_translate("MainWindow", " -"))
self.label_7.setText(_translate("MainWindow", "搜索页数:"))