办公室必备:
1、自动隐藏,随意拖动,透明显示,老键盘隐藏。
2、可自动配置显示股票代码,隐藏股票助手意图,防止被发现。
3、小窗显示,可以边上班边看盘。
4、实时行情和相关咨询数据的获取。
5、目标触发条件的判断,实时提醒。
https://download.csdn.net/download/waiwai0511/87640311
from PyQt5 import QtWidgets
from PyQt5.QtGui import QIcon, QPixmap
from PyQt5.QtWidgets import QApplication, QFileDialog, QMessageBox, QTableWidgetItem, QHeaderView, QMainWindow, QWidget
import sys
from Sina7x24.Sina_7x24_0 import get_data_0
from Sina7x24.Sina_7x24_1 import get_data_1
from Sina7x24.Sina_7x24_2 import get_data_2
from Sina7x24.Sina_7x24_3 import get_data_3
from Sina7x24.Sina_7x24_4 import get_data_4
from Sina7x24.Sina_7x24_5 import get_data_5
from Sina7x24.Sina_7x24_6 import get_data_6
from Sina7x24.Sina_7x24_7 import get_data_7
from Sina7x24.Sina_7x24_8 import get_data_8
from Sina7x24.Sina_7x24_10 import get_data_10
from ui.sina7x24window import Ui_Form
class sina7x24Show(QMainWindow, Ui_Form):
def __init__(self, parent=None):
super(sina7x24Show, self).__init__(parent)
self.setupUi(self)
self.sysIcon = QIcon('images/logo.ico')
self.setWindowIcon(self.sysIcon)
# self.rd = DbThread() # 创建我的线程对象
# self.rd.start()
# self.setFixedSize(self.width(), self.height()) # 固定窗口大小
self.tableWidget.setAlternatingRowColors(True)
self.tableWidget.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.tableWidget.horizontalHeader().setStretchLastSection(True)
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.tableWidget_2.setAlternatingRowColors(True)
self.tableWidget_2.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.tableWidget_2.horizontalHeader().setStretchLastSection(True)
self.tableWidget_2.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.tableWidget_3.setAlternatingRowColors(True)
self.tableWidget_3.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.tableWidget_3.horizontalHeader().setStretchLastSection(True)
self.tableWidget_3.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.tableWidget_4.setAlternatingRowColors(True)
self.tableWidget_4.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.tableWidget_4.horizontalHeader().setStretchLastSection(True)
self.tableWidget_4.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.tableWidget_5.setAlternatingRowColors(True)
self.tableWidget_5.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.tableWidget_5.horizontalHeader().setStretchLastSection(True)
self.tableWidget_5.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.tableWidget_6.setAlternatingRowColors(True)
self.tableWidget_6.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.tableWidget_6.horizontalHeader().setStretchLastSection(True)
self.tableWidget_6.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.tableWidget_7.setAlternatingRowColors(True)
self.tableWidget_7.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.tableWidget_7.horizontalHeader().setStretchLastSection(True)
self.tableWidget_7.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.tableWidget_8.setAlternatingRowColors(True)
self.tableWidget_8.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.tableWidget_8.horizontalHeader().setStretchLastSection(True)
self.tableWidget_8.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.tableWidget_9.setAlternatingRowColors(True)
self.tableWidget_9.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.tableWidget_9.horizontalHeader().setStretchLastSection(True)
self.tableWidget_9.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.tableWidget_10.setAlternatingRowColors(True)
self.tableWidget_10.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
self.tableWidget_10.horizontalHeader().setStretchLastSection(True)
self.tableWidget_10.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.tableWidget.cellClicked.connect(self.data_0_CellClicked) #
self.tableWidget_2.cellClicked.connect(self.data_1_CellClicked) #
self.tableWidget_3.cellClicked.connect(self.data_2_CellClicked) #
self.tableWidget_4.cellClicked.connect(self.data_3_CellClicked) #
self.tableWidget_5.cellClicked.connect(self.data_4_CellClicked) #
self.tableWidget_6.cellClicked.connect(self.data_5_CellClicked) #
self.tableWidget_7.cellClicked.connect(self.data_6_CellClicked) #
self.tableWidget_8.cellClicked.connect(self.data_7_CellClicked) #
self.tableWidget_9.cellClicked.connect(self.data_8_CellClicked) #
self.tableWidget_10.cellClicked.connect(self.data_10_CellClicked) #
self.pushButton.clicked.connect(self.refurbishData) # 查询
mainwidget = QWidget()
mainwidget.setLayout(self.gridLayout)
self.setCentralWidget(mainwidget)
def data_0_CellClicked(self):
s = self.tableWidget.selectedItems() # 选中的数据
s0 = s[0].text()
QMessageBox.information(self, '信息', s0)
def data_1_CellClicked(self):
s = self.tableWidget_2.selectedItems() # 选中的数据
s0 = s[0].text()
QMessageBox.information(self, '信息', s0)
def data_2_CellClicked(self):
s = self.tableWidget_3.selectedItems() # 选中的数据
s0 = s[0].text()
QMessageBox.information(self, '信息', s0)
def data_3_CellClicked(self):
s = self.tableWidget_4.selectedItems() # 选中的数据
s0 = s[0].text()
QMessageBox.information(self, '信息', s0)
def data_4_CellClicked(self):
s = self.tableWidget_5.selectedItems() # 选中的数据
s0 = s[0].text()
QMessageBox.information(self, '信息', s0)
def data_5_CellClicked(self):
s = self.tableWidget_6.selectedItems() # 选中的数据
s0 = s[0].text()
QMessageBox.information(self, '信息', s0)
def data_6_CellClicked(self):
s = self.tableWidget_7.selectedItems() # 选中的数据
s0 = s[0].text()
QMessageBox.information(self, '信息', s0)
def data_7_CellClicked(self):
s = self.tableWidget_8.selectedItems() # 选中的数据
s0 = s[0].text()
QMessageBox.information(self, '信息', s0)
def data_8_CellClicked(self):
s = self.tableWidget_9.selectedItems() # 选中的数据
s0 = s[0].text()
QMessageBox.information(self, '信息', s0)
def data_10_CellClicked(self):
s = self.tableWidget_10.selectedItems() # 选中的数据
s0 = s[0].text()
QMessageBox.information(self, '信息', s0)
def refurbishData(self):
data_10 = get_data_10()
self.tableWidget.setRowCount(len(data_10))
i = 0
for x in data_10:
# print(data)
self.tableWidget.setItem(i, 0, QTableWidgetItem(str(x[0])))
self.tableWidget.setItem(i, 1, QTableWidgetItem(x[1]))
i = i + 1
data_1 = get_data_1()
self.tableWidget_2.setRowCount(len(data_1))
i = 0
for x in data_1:
# print(data)
self.tableWidget_2.setItem(i, 0, QTableWidgetItem(str(x[0])))
self.tableWidget_2.setItem(i, 1, QTableWidgetItem(x[1]))
i = i + 1
data_2 = get_data_2()
self.tableWidget_3.setRowCount(len(data_2))
i = 0
for x in data_2:
# print(data)
self.tableWidget_3.setItem(i, 0, QTableWidgetItem(str(x[0])))
self.tableWidget_3.setItem(i, 1, QTableWidgetItem(x[1]))
i = i + 1
data_3 = get_data_3()
self.tableWidget_4.setRowCount(len(data_3))
i = 0
for x in data_3:
# print(data)
self.tableWidget_4.setItem(i, 0, QTableWidgetItem(str(x[0])))
self.tableWidget_4.setItem(i, 1, QTableWidgetItem(x[1]))
i = i + 1
data_4 = get_data_4()
self.tableWidget_5.setRowCount(len(data_4))
i = 0
for x in data_4:
# print(data)
self.tableWidget_5.setItem(i, 0, QTableWidgetItem(str(x[0])))
self.tableWidget_5.setItem(i, 1, QTableWidgetItem(x[1]))
i = i + 1
data_5 = get_data_5()
self.tableWidget_6.setRowCount(len(data_5))
i = 0
for x in data_5:
# print(data)
self.tableWidget_6.setItem(i, 0, QTableWidgetItem(str(x[0])))
self.tableWidget_6.setItem(i, 1, QTableWidgetItem(x[1]))
i = i + 1
data_6 = get_data_6()
self.tableWidget_7.setRowCount(len(data_6))
i = 0
for x in data_6:
# print(data)
self.tableWidget_7.setItem(i, 0, QTableWidgetItem(str(x[0])))
self.tableWidget_7.setItem(i, 1, QTableWidgetItem(x[1]))
i = i + 1
data_7 = get_data_7()
self.tableWidget_8.setRowCount(len(data_7))
i = 0
for x in data_7:
# print(data)
self.tableWidget_8.setItem(i, 0, QTableWidgetItem(str(x[0])))
self.tableWidget_8.setItem(i, 1, QTableWidgetItem(x[1]))
i = i + 1
data_8 = get_data_8()
self.tableWidget_9.setRowCount(len(data_8))
i = 0
for x in data_8:
# print(data)
self.tableWidget_9.setItem(i, 0, QTableWidgetItem(str(x[0])))
self.tableWidget_9.setItem(i, 1, QTableWidgetItem(x[1]))
i = i + 1
data_0 = get_data_0()
self.tableWidget_10.setRowCount(len(data_0))
i = 0
for x in data_0:
print("data_0>>>", x)
self.tableWidget_10.setItem(i, 0, QTableWidgetItem(str(x[0])))
self.tableWidget_10.setItem(i, 1, QTableWidgetItem(x[1]))
i = i + 1
if __name__ == '__main__':
app = QApplication(sys.argv) # 创建GUI对象
reg = sina7x24Show() # 创建主窗体ui类对象
reg.show() # 显示主窗体
sys.exit(app.exec_()) # 除非退出程序关闭窗体,否则一直运行