• 4407阅读
  • 0回复

【提问】表格条目超过10000就无法显示[s:6] [复制链接]

上一主题 下一主题
离线buben
 

只看楼主 倒序阅读 楼主  发表于: 2006-04-28
我用python写了个显示表格的程序,用qt做界面。但如果条目超过10000,就只能显示前4位数字,不知哪位高手能指点一下?
相关程序如下所示:
  self.table1 = QTable(self,"table1")
    self.table1.setGeometry(QRect(20,60,335,90))
    mydb=MySQLdb.Connect(host="localhost", db="test",user="root",passwd="root")
    mycursor=mydb.cursor()
    stmt="select max(index) from aaa"
    mycursor.execute(stmt)
    result = mycursor.fetchall()
    for record in result:
        numEx=record[0]
   
    self.table1.setNumRows(numEx)
    self.table1.setNumCols(3)

    self.languageChange()
    for j in range(3):
        stmt="select var"+str(j)+" from aaa where index<="+str(numEx)
        #print stmt
        mycursor.execute(stmt)
        result = mycursor.fetchall()
        i=0
        for record in result:
          x=record[0]
          self.table1.setText(i, j, unicode(str(x),'MBCS'))
          i +=1
快速回复
限100 字节
 
上一个 下一个