Esempio n. 1
0
 def outputTable(self, returnvalue):
     table_list = returnvalue.Payload.Table
     table_header = returnvalue.Payload.TableHeader
     color_list_vertical = returnvalue.Payload.TableColorVertical
     
     height = len(table_list)
     width = len(table_list[0])
     
     tableWidget = SpeakingTableWidget(height, width, self.Universe, None)
     if table_header != None:
         tableWidget.setHorizontalHeaderLabels(table_header)
     
     #row = -1
     for row, line in enumerate(table_list):
         #row += 1
         
         #column = -1
         for column, item in enumerate(line):
             #column += 1
             
             item = QtGui.QTableWidgetItem(unicode(item))
             
             if color_list_vertical:
                 r, g, b = color_list_vertical[column]
                 item.setBackgroundColor(QtGui.QColor(r, g, b))
                 
             tableWidget.setItem(row, column, item)
             
             
     tableWidget.resizeColumnsToContents()
     
     return tableWidget
Esempio n. 2
0
    def resultInTable(self, head, result, name):
        table = SpeakingTableWidget(len(result), len(result[0]), self.Universe, name)

        table.setHorizontalHeaderLabels(head)
        # return table, "bla"

        row = -1
        for line in result:
            row += 1

            column = -1
            for item in line:
                column += 1

                table.setItem(row, column, QtGui.QTableWidgetItem(unicode(item)))

        table.resizeColumnsToContents()

        self.ResultObject.Payload.SpeakingTableWidget = table
        return self.ResultObject