当前位置: 首页>>代码示例>>Python>>正文


Python QtGui.QGraphicsItem类代码示例

本文整理汇总了Python中PyQt4.QtGui.QGraphicsItem的典型用法代码示例。如果您正苦于以下问题:Python QGraphicsItem类的具体用法?Python QGraphicsItem怎么用?Python QGraphicsItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QGraphicsItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: mouseReleaseEvent

 def mouseReleaseEvent (self, e):
     
     self.harpoon.setVisible (False)
             
     self.helper.initAndStartTimer ()
     
     QGraphicsItem.mouseReleaseEvent (self, e)
开发者ID:iras,项目名称:JADE,代码行数:7,代码来源:Hook0.py

示例2: __init__

 def __init__(self, scale, source, target, parent=None):
     QGraphicsItem.__init__(self, parent)
     self.source = source
     self.target = target
     self.scale = scale
     self.updateShape()
     self.setZValue(2)
开发者ID:PierreBdR,项目名称:point_tracker,代码行数:7,代码来源:tracking_items.py

示例3: mousePressEvent

 def mousePressEvent (self, e):
     
     self.harpoon.setInitPos (self.pos()+self.parent.pos())
     self.harpoon.setVisible (True)
     
     self.harpoon.update ()
     QGraphicsItem.mousePressEvent (self, e)
开发者ID:iras,项目名称:JADE,代码行数:7,代码来源:Hook0.py

示例4: __init__

    def __init__(self, scene, axis, posModel):
        """
        scene: Must be an ImageScene2D instance.  We manipulate the scene.allow_brushing flag.
        """
        QGraphicsItem.__init__(self, scene=scene)
        self.setFlag(QGraphicsItem.ItemHasNoContents);
        
        self.axis = axis
        self.posModel = posModel
        
        self._width = 0
        self._height = 0

        self.thick_penX = QPen(Qt.red, self.thick_width)
        self.thick_penX.setCosmetic(True)

        self.thick_penY = QPen(Qt.green, self.thick_width)
        self.thick_penY.setCosmetic(True)

        self.thin_penX = QPen(Qt.red, self.thin_width)
        self.thin_penX.setCosmetic(True)

        self.thin_penY = QPen(Qt.green, self.thin_width)
        self.thin_penY.setCosmetic(True)

        self.x = 0
        self.y = 0

        # These child items do most of the work.
        self._horizontal_marker = SliceMarkerLine(self, 'horizontal')
        self._vertical_marker = SliceMarkerLine(self, 'vertical')
开发者ID:CVML,项目名称:volumina,代码行数:31,代码来源:sliceIntersectionMarker.py

示例5: __init__

    def __init__(self, scene, axis, crop_extents_model, editable=True):

        self._cropColor = Qt.white
        self._editable = editable

        QGraphicsItem.__init__(self, scene=scene)
        self.setFlag(QGraphicsItem.ItemHasNoContents);
        self.setAcceptHoverEvents(True)
        self.scene = scene
        self.axis = axis
        self.crop_extents_model = crop_extents_model
        self.crop_extents_model.editableChanged.connect( self.onEditableChanged)

        self._width = 0
        self._height = 0

        # Add shading item first so crop lines are drawn on top.
        self._shading_item = ExcludedRegionShading( self, self.crop_extents_model )

        self._horizontal0 = CropLine(self, 'horizontal', 0)
        self._horizontal1 = CropLine(self, 'horizontal', 1)
        self._vertical0 = CropLine(self, 'vertical', 0)
        self._vertical1 = CropLine(self, 'vertical', 1)

        self.crop_extents_model.changed.connect( self.onExtentsChanged )
        self.crop_extents_model.colorChanged.connect( self.onColorChanged )

        # keeping track which line started mouse move
        self._mouseMoveStartH = -1
        self._mouseMoveStartV = -1
        self._fractionOfDistance = 1
开发者ID:kkiefer,项目名称:volumina,代码行数:31,代码来源:croppingMarkers.py

示例6: __init__

    def __init__(self, scene, axis, posModel):
        QGraphicsItem.__init__(self, scene=scene)
        self.setFlag(QGraphicsItem.ItemHasNoContents);
        
        self.axis = axis
        self.posModel = posModel
        
        self._width = 0
        self._height = 0

        self.thick_penX = QPen(Qt.red, self.thick_width)
        self.thick_penX.setCosmetic(True)

        self.thick_penY = QPen(Qt.green, self.thick_width)
        self.thick_penY.setCosmetic(True)

        self.thin_penX = QPen(Qt.red, self.thin_width)
        self.thin_penX.setCosmetic(True)

        self.thin_penY = QPen(Qt.green, self.thin_width)
        self.thin_penY.setCosmetic(True)

        self.x = 0
        self.y = 0

        # These child items do most of the work.
        self._horizontal_marker = SliceMarkerLine(self, 'horizontal')
        self._vertical_marker = SliceMarkerLine(self, 'vertical')

        # We 
        self._horizontal_marker = SliceMarkerLine(self, 'horizontal')
        self._vertical_marker = SliceMarkerLine(self, 'vertical')
开发者ID:burgerdev,项目名称:volumina,代码行数:32,代码来源:sliceIntersectionMarker.py

示例7: __init__

 def __init__(self, unit):
     QGraphicsItem.__init__(self)
     self.unit = unit
     self.yPosition = unit * 0.03
     self.width = -self.unit * 0.02
     self.lengthInUnits = 200
     self.axisLength = self.lengthInUnits * unit
     self.axisStart = -self.axisLength / 2
开发者ID:pawel-k,项目名称:pendulum,代码行数:8,代码来源:Axis.py

示例8: __init__

 def __init__(self, tile):
     QGraphicsItem.__init__(self)
     self._tile = weakref.ref(tile) # avoid circular references for easier gc
     self._boundingRect = None
     self.setCacheMode(QGraphicsItem.DeviceCoordinateCache)
     # while moving the tile we use ItemCoordinateCache, see
     # Tile.setActiveAnimation
     self.setClippingFlags()
开发者ID:ospalh,项目名称:kajongg-fork,代码行数:8,代码来源:uitile.py

示例9: hoverLeaveEvent

 def hoverLeaveEvent (self, e):
     
     self.pen_color = QPen (Qt.black, 2)
     self._text_item.setDefaultTextColor (Qt.black)
     
     # records the node_id in the helper's attribute.
     self.comm.setHoveredSocketId (None)
     
     QGraphicsItem.hoverLeaveEvent (self, e)
开发者ID:iras,项目名称:JADE,代码行数:9,代码来源:Hook0.py

示例10: __init__

    def __init__(self):
        QGraphicsItem.__init__(self)

        self.__selected = None
        self.setZValue(3.0)

        self.__mark = EDraw.Circle(10, 3, 90).translated(QPointF(0.0, -12.0))

        self.__pen = EDraw.EColor.DefaultEnterHoverPen
开发者ID:shrimo,项目名称:node_image_tools,代码行数:9,代码来源:escene.py

示例11: addItem

    def addItem(self, QGraphicsItem):

        if self.__isNode(QGraphicsItem):
            QGraphicsItem.setZValue(1.0)
            QGraphicsItem.onPress.connect(self.__onNodePressed)

            self.__nodes[QGraphicsItem.Id] = QGraphicsItem

        QGraphicsScene.addItem(self, QGraphicsItem)
开发者ID:shrimo,项目名称:node_image_tools,代码行数:9,代码来源:escene.py

示例12: hoverLeaveEvent

 def hoverLeaveEvent (self, e):
     
     # records the node_id in the helper's attribute.
     self.comm.setHoveredItemId (None)
     
     # deal with the harpoon.
     if not self.helper.isTimerEnded():
         self.setSelected (True)
     
     QGraphicsItem.hoverLeaveEvent (self, e)
开发者ID:iras,项目名称:JADE,代码行数:10,代码来源:Tags0.py

示例13: mousePressEvent

 def mousePressEvent (self, e):
     
     #self.setAcceptedMouseButtons(Qt.NoButton)
     self.previousMouseGrabberItem = self.scene.mouseGrabberItem()
     
     if e.button() == Qt.RightButton:
         pos = self.pos()
         self.comm.emitCtxMenuSignal (pos)
     
     QGraphicsItem.mousePressEvent (self, e)
开发者ID:iras,项目名称:JADE,代码行数:10,代码来源:Tags0.py

示例14: __init__

    def __init__(self, parent, direction, index):
        assert isinstance(parent, CroppingMarkers)
        assert direction in ('horizontal', 'vertical')

        self._parent = parent
        self._direction = direction
        self._index = index
        QGraphicsItem.__init__(self, parent)
        self.setAcceptHoverEvents(True)
        
        self._position = 0
开发者ID:CVML,项目名称:volumina,代码行数:11,代码来源:croppingMarkers.py

示例15: __init__

 def __init__(self, parent=None, graphicView=None, graphicScene=None):
     QGraphicsItem.__init__(self)
     self.set_default_data()
     self.className = QGraphicsTextItem(self)
     self.functionsItem = FunctionsContainerModel(self)
     self.className.setPlainText(self.defaultClassName)
     self.setFlag(self.ItemIsMovable)
     self.setFlag(self.ItemSendsGeometryChanges)
     self.functionsItem.setPos(0, self.__get_title_height())
     self.attributesItem = FunctionsContainerModel(self)
     self.attributesItem.setPos(0, self.functionsItem.get_height())
开发者ID:AnyBucket,项目名称:ninja-ide,代码行数:11,代码来源:class_diagram.py


注:本文中的PyQt4.QtGui.QGraphicsItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。