Changeset 8388:534da1b47a94 in orange


Ignore:
Timestamp:
07/09/11 11:00:52 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
3623f1d90897f8365e602713fe6feb75f8cb625a
Message:

Fix PolygonCurve so that it shows up in OWDistributionsQt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/plot/owtools.py

    r8387 r8388  
    6161        self._data_polygon = self.polygon_from_data(xData, yData) 
    6262        self._polygon_item = QGraphicsPolygonItem(self) 
    63         self.pen = pen 
    64         self.brush = brush 
     63        self.setPen(pen) 
     64        self.setBrush(brush) 
    6565         
    6666    def updateProperties(self): 
    6767        self._polygon_item.setPolygon(self.graphTransform().map(self._data_polygon)) 
    68         self._polygon_item.setPen(self.pen) 
    69         self._polygon_item.setBrush(self.brush) 
     68        self._polygon_item.setPen(self.pen()) 
     69        self._polygon_item.setBrush(self.brush()) 
    7070         
    7171    @staticmethod 
     
    8181            return QPolygonF() 
    8282             
    83  
     83    def setData(self, xData, yData): 
     84        self._data_polygon = self.polygon_from_data(xData, yData) 
     85        OWCurve.setData(self, xData, yData) 
     86            
    8487class RectangleCurve(OWCurve): 
    8588    def __init__(self, pen = QPen(Qt.black), brush = QBrush(Qt.white), xData = None, yData = None, tooltip = None): 
     
    8790        self.setPen(pen) 
    8891        self.setBrush(brush) 
    89         self._item = QGraphicsRectItem() 
     92        self._item = QGraphicsRectItem(self) 
    9093         
    9194    def updateProperties(self): 
    92         d = self.data() 
    93         if len(d) < 4: 
    94             self._item.setRect(QRectF()) 
    95         else: 
    96             self._item.setRect(self.graphTransform().mapRect(self.boundingRectFromData(d))) 
    97  
     95        self._item.setRect(self.graphTransform().mapRect(self.dataRect())) 
     96        self._item.setPen(self.pen()) 
     97        self._item.setBrush(self.brush()) 
     98         
    9899class UnconnectedLinesCurve(orangeplot.UnconnectedLinesCurve): 
    99100    def __init__(self, name, pen = QPen(Qt.black), xData = None, yData = None): 
Note: See TracChangeset for help on using the changeset viewer.