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


Python QGraphicsItem.__init__方法代码示例

本文整理汇总了Python中PyQt5.QtWidgets.QGraphicsItem.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QGraphicsItem.__init__方法的具体用法?Python QGraphicsItem.__init__怎么用?Python QGraphicsItem.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtWidgets.QGraphicsItem的用法示例。


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

示例1: __init__

# 需要导入模块: from PyQt5.QtWidgets import QGraphicsItem [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsItem import __init__ [as 别名]
    def __init__(self, axis, crop_extents_model, editable=True):

        self._cropColor = Qt.white

        QGraphicsItem.__init__(self)
        self.setFlag(QGraphicsItem.ItemHasNoContents)
        self.setAcceptHoverEvents(True)
        self.axis = axis
        self.crop_extents_model = crop_extents_model

        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:ilastik,项目名称:volumina,代码行数:30,代码来源:croppingMarkers.py

示例2: __init__

# 需要导入模块: from PyQt5.QtWidgets import QGraphicsItem [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsItem import __init__ [as 别名]
    def __init__(self, nr, closed, parentEntity):
        QGraphicsItem.__init__(self)
        Shape.__init__(self, nr, closed, parentEntity)

        self.setFlag(QGraphicsItem.ItemIsSelectable, True)
        self.setAcceptedMouseButtons(QtCore.Qt.NoButton)

        self.selectionChangedCallback = None
        self.enableDisableCallback = None

        self.starrow = None
        self.enarrow = None
开发者ID:opme,项目名称:dxf2gcode,代码行数:14,代码来源:canvas2d.py

示例3: __init__

# 需要导入模块: from PyQt5.QtWidgets import QGraphicsItem [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsItem import __init__ [as 别名]
    def __init__(self):
        QGraphicsItem.__init__(self)

        self._width = 0
        self._height = 0

        self.penDotted = QPen(Qt.red, 2, Qt.DotLine, Qt.RoundCap, Qt.RoundJoin)
        self.penDotted.setCosmetic(True)

        self.penSolid = QPen(Qt.red, 2)
        self.penSolid.setCosmetic(True)

        self.x = 0
        self.y = 0
        self.brushSize = 0

        self.mode = self.modeXYPosition
        self._enabled = True
开发者ID:ilastik,项目名称:volumina,代码行数:20,代码来源:crossHairCursor.py

示例4: __init__

# 需要导入模块: from PyQt5.QtWidgets import QGraphicsItem [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsItem import __init__ [as 别名]
    def __init__(self, text='S', startp=Point(x=0.0, y=0.0),):
        """
        Initialisation of the class.
        """
        QGraphicsItem.__init__(self)

        self.setFlag(QGraphicsItem.ItemIsSelectable, False)

        self.text = text
        self.sc = 1.0
        self.startp = QtCore.QPointF(startp.x, -startp.y)

        pencolor = QColor(0, 200, 255)
        self.brush = QColor(0, 100, 255)

        self.pen = QPen(pencolor, 1, QtCore.Qt.SolidLine)
        self.pen.setCosmetic(True)

        self.path = QPainterPath()
        self.path.addText(QtCore.QPointF(0, 0),
                          QFont("Arial", 10/self.sc),
                          self.text)
开发者ID:cnc-club,项目名称:dxf2gcode,代码行数:24,代码来源:routetext.py

示例5: __init__

# 需要导入模块: from PyQt5.QtWidgets import QGraphicsItem [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsItem import __init__ [as 别名]
 def __init__(self, index):
     Node.__init__(self, index)
     QGraphicsItem.__init__(self)
     # 绘制时的位置
     self.index_draw = 0
开发者ID:bssthu,项目名称:skiplist,代码行数:7,代码来源:nodeItem.py


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