Changeset 11293:467a276e7fa6 in orange


Ignore:
Timestamp:
01/29/13 18:25:41 (15 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Changed the base class of NodeAnchorItem from QGraphicsPathItem to GraphicsPathObject.

It seems that on some PyQt4 builds 'AnchorPoint.setParentItem' does not
accept a non QGraphicsObject derived instance as a parent.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/canvas/items/nodeitem.py

    r11207 r11293  
    1717from PyQt4.QtCore import pyqtProperty as Property 
    1818 
     19from .graphicspathobject import GraphicsPathObject 
    1920from .utils import saturated, radial_gradient 
    2021 
     
    245246 
    246247 
    247 class NodeAnchorItem(QGraphicsPathItem): 
     248class NodeAnchorItem(GraphicsPathObject): 
    248249    """The left/right widget input/output anchors. 
    249250    """ 
    250251 
    251252    def __init__(self, parent, *args): 
    252         QGraphicsPathItem.__init__(self, parent, *args) 
     253        GraphicsPathObject.__init__(self, parent, *args) 
    253254        self.setAcceptHoverEvents(True) 
    254255        self.setPen(QPen(Qt.NoPen)) 
     
    433434            return self.__fullStroke 
    434435        else: 
    435             return QGraphicsPathItem.shape(self) 
     436            return GraphicsPathObject.shape(self) 
    436437 
    437438    def hoverEnterEvent(self, event): 
    438439        self.shadow.setEnabled(True) 
    439         return QGraphicsPathItem.hoverEnterEvent(self, event) 
     440        return GraphicsPathObject.hoverEnterEvent(self, event) 
    440441 
    441442    def hoverLeaveEvent(self, event): 
    442443        self.shadow.setEnabled(False) 
    443         return QGraphicsPathItem.hoverLeaveEvent(self, event) 
     444        return GraphicsPathObject.hoverLeaveEvent(self, event) 
    444445 
    445446    def __updatePositions(self): 
Note: See TracChangeset for help on using the changeset viewer.