Ps:水平有限,欢迎建议和挑错
根据上章读者留言,补充完整的QTableWidget
中间耽误太久的时间,实在不好意思。
完整代码如下:
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
import pandas as pd
import numpy as np
class Ui_MainWindow(QMainWindow):
def __init__(self):
super(QtWidgets.QMainWindow,self).__init__()
self.setupUi(self)
self.retranslateUi(self)
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(666, 488)
self.centralWidget = QtWidgets.QWidget(MainWindow)
self.centralWidget.setObjectName("centralWidget")
self.retranslateUi(MainWindow)
self.tableWidget = QtWidgets.QTableWidget(self.centralWidget)
self.tableWidget.setGeometry(QtCore.QRect(0, 60, 813, 371))
self.tableWidget.setObjectName("tableWidget")
self.tableWidget.setColumnCount(0)
self.tableWidget.setRowCount(0)
self.tableWidget.setStyleSheet("selection-background-color:pink")
self.tableWidget.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.tableWidget.raise_()
self.pushButton = QtWidgets.QPush