Changeset 9269:2fba8760e2dd in orange


Ignore:
Timestamp:
11/25/11 11:21:40 (2 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
7947b7c8bd6490372daebc439120d354dc09078d
Message:

Fixed Reporting in Rank widget.

Location:
orange/OrangeWidgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Data/OWRank.py

    r8899 r9269  
    759759    def sendReport(self): 
    760760        self.reportData(self.data) 
    761         self.reportRaw(OWReport.reportTable(self.table)) 
     761        self.reportRaw(OWReport.reportTable(self.ranksView)) 
    762762 
    763763    def applyIf(self): 
  • orange/OrangeWidgets/OWReport.py

    r8042 r9269  
    395395        align, ok = align.toInt() if align.isValid() else Qt.AlignLeft, True  
    396396        alignment = {Qt.AlignLeft: "left", Qt.AlignRight: "right", Qt.AlignHCenter: "center"}.get(align & Qt.AlignHorizontal_Mask, "left") 
    397         text = str(item.data(Qt.DisplayRole).toString()).replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;") 
     397        value = item.data(Qt.DisplayRole) 
     398        if value.type() >= QVariant.UserType: 
     399            text = str(value.toPyObject()) 
     400        else: 
     401            text = str(value.toString()) 
     402        text = text.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;") 
    398403        return '<%s style="%s; text-align: %s">%s</%s>' % (tag, style, alignment, text, tag) 
    399404    elif isinstance(item, tuple): #(QAbstractItemModel, headerIndex) 
    400         model, ind = item 
     405        model, index = item 
    401406        align = model.headerData(index, Qt.Horizontal, Qt.TextAlignmentRole) 
    402407        align, ok = align.toInt() if align.isValid() else Qt.AlignLeft, True 
Note: See TracChangeset for help on using the changeset viewer.