首页 > 代码库 > pyqt QTableWidgetItem多行显示

pyqt QTableWidgetItem多行显示

def __2(self):

        t1=QtGui.QTableWidgetItem(self.names.text())

        self.tabs.tableinsertinto.setItem(0,0,t1)

        t3=QtGui.QTableWidgetItem(self.mains.text())

        self.tabs.tableinsertinto.setItem(0,2,t3)

        t4=QtGui.QTableWidgetItem(self.poohs.text()+self.addrs.text())

        self.tabs.tableinsertinto.setItem(0,3,t4)

        t2x=datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")

        t2x=QtGui.QTableWidgetItem(t2x)

        self.tabs.tableinsertinto.setItem(0,1,t2x)

如图: