Exemplo n.º 1
0
 def __init__(self, *args):
     QGraphicsEllipseItem.__init__(self, *args)
     self.setRect(-3, -3, 6, 6)
     self.setPen(QPen(Qt.NoPen))
     self.normalBrush = QBrush(QColor("#9CACB4"))
     self.hoverBrush = QBrush(QColor("#7D7D7D"))
     self.setBrush(self.normalBrush)
     self.__hover = False
Exemplo n.º 2
0
 def __init__(self, *args):
     QGraphicsEllipseItem.__init__(self, *args)
     self.setRect(-3, -3, 6, 6)
     self.setPen(QPen(Qt.NoPen))
     self.normalBrush = QBrush(QColor("#9CACB4"))
     self.hoverBrush = QBrush(QColor("#7D7D7D"))
     self.setBrush(self.normalBrush)
     self.__hover = False
Exemplo n.º 3
0
 def __init__(self, rect, type):
     QGraphicsEllipseItem.__init__(self, rect)
     self._color = None
     self._darkColor = None
     self._pos = None
     self._startAngle = None
     self._spanAngle = None
     self._value = None
     self._type = type
Exemplo n.º 4
0
 def __init__(self, name, tileset, roundsFinished=0, parent = None):
     """generate new wind tile"""
     if not len(WINDPIXMAPS):
         WINDPIXMAPS[('E', False)] = None # avoid recursion
         self.genWINDPIXMAPS()
     QGraphicsEllipseItem.__init__(self)
     if parent:
         self.setParentItem(parent)
     self.name = name
     self.face = QGraphicsSvgItem()
     self.face.setParentItem(self)
     self.prevailing = None
     self.setWind(name, roundsFinished)
     self.tileset = tileset
     self.__sizeFace()
Exemplo n.º 5
0
 def __init__(self, name, tileset, roundsFinished=0, parent = None):
     """generate new wind tile"""
     if not len(WINDPIXMAPS):
         WINDPIXMAPS[('E', False)] = None # avoid recursion
         self.genWINDPIXMAPS()
     QGraphicsEllipseItem.__init__(self)
     if parent:
         self.setParentItem(parent)
     self.name = name
     self.face = QGraphicsSvgItem()
     self.face.setParentItem(self)
     self.prevailing = None
     self.setWind(name, roundsFinished)
     self.tileset = tileset
     self.__sizeFace()
Exemplo n.º 6
0
    def __init__(self, longitude, latitude, pixmap, scene, parent=None):
        """Constructor.

        Args:
            longitude(float): Longitude of the origin of the pixmap.
            latitude(float): Latitude of the center of the pixmap.
            pixmap(QPixmap): Pixmap.
            scene(MapGraphicsScene): Scene the item belongs to.
            parent(QGraphicsItem): Parent item.
        """
        QGraphicsEllipseItem.__init__(self, parent=parent, scene=scene)

        self._lon = longitude
        self._lat = latitude
        self.setPixmap(pixmap)

        self.updatePosition(scene)
Exemplo n.º 7
0
    def __init__(self, radius, parent=None):
        QGraphicsEllipseItem.__init__(self, QRectF(-radius, -radius, radius*2.0, radius*2.0), parent=parent)

        self._pen = QPen(QColor('#000000'))
        self._pen.setWidth(1)
        self.setPen(self._pen)

        self._hoverPen = QPen(QColor('#000000'))
        self._hoverPen.setWidth(2)

        brush = QBrush(QColor('#FF9966'))
        self.setBrush(brush)

        self._isSelected = False
        self._isHover = False

        self.setAcceptHoverEvents(True)
Exemplo n.º 8
0
    def __init__(self, longitude, latitude, pixmap, scene, parent=None):
        """Constructor.

        Args:
            longitude(float): Longitude of the origin of the pixmap.
            latitude(float): Latitude of the center of the pixmap.
            pixmap(QPixmap): Pixmap.
            scene(MapGraphicsScene): Scene the item belongs to.
            parent(QGraphicsItem): Parent item.
        """
        QGraphicsEllipseItem.__init__(self, parent=parent, scene=scene)

        self._lon = longitude
        self._lat = latitude
        self.setPixmap(pixmap)

        self.updatePosition(scene)
Exemplo n.º 9
0
    def __init__(self, longitude, latitude, radius, scene, parent=None):
        """Constructor.

        Args:
            longitude(float): Longitude of the center of the circle.
            latitude(float): Latitude of the center of the circle.
            radius(float): Radius of the circle in pixels.
            scene(MapGraphicsScene): Scene to which the circle belongs.
            parent(QGraphicsItem): Parent item, default None.

        Note:
            The management of the parent item is work in progress.
        """
        QGraphicsEllipseItem.__init__(self, parent=parent, scene=scene)

        self._lon = longitude
        self._lat = latitude
        self._radius = radius

        d = self._radius * 2
        self.setRect(0, 0, d, d)

        self.updatePosition(scene)
Exemplo n.º 10
0
    def __init__(self, longitude, latitude, radius, scene, parent=None):
        """Constructor.

        Args:
            longitude(float): Longitude of the center of the circle.
            latitude(float): Latitude of the center of the circle.
            radius(float): Radius of the circle in pixels.
            scene(MapGraphicsScene): Scene to which the circle belongs.
            parent(QGraphicsItem): Parent item, default None.

        Note:
            The management of the parent item is work in progress.
        """
        QGraphicsEllipseItem.__init__(self, parent=parent, scene=scene)

        self._lon = longitude
        self._lat = latitude
        self._radius = radius

        d = self._radius * 2
        self.setRect(0, 0, d, d)

        self.updatePosition(scene)
Exemplo n.º 11
0
    def __init__(self, name, radius, parent=None):
        QGraphicsEllipseItem.__init__(self, QRectF(-radius, -radius, radius*2.0, radius*2.0), parent=parent)

        self._name = name

        pfname = parent.fullname()
        if pfname is not None:
            self._fullname = pfname + ':' + name
        else:
            self._fullname = parent.name() + ':' + name

        pen = QPen(QColor('#000000'))
        pen.setWidth(3)
        self.setPen(pen)

        brush = QBrush(QColor('#000000'))
        self.setBrush(brush)

        self.setToolTip(name)

        self.setAcceptedMouseButtons(Qt.LeftButton)
        self.setAcceptHoverEvents(True)

        self._isDraggingLine = False
Exemplo n.º 12
0
 def __init__(self, *args, **kwords):
     QGraphicsEllipseItem.__init__(self, *args, **kwords)
     self.setSpanAngle(180*16)
Exemplo n.º 13
0
 def __init__(self, x, y, number=0, radius=RADIUS, parent=None, scene=None):
     QGraphicsEllipseItem.__init__(self, x - radius / 2, y - radius / 2, 2 * radius, 2 * radius, parent, scene)
     self.number = number
Exemplo n.º 14
0
 def __init__(self, *args):
     QGraphicsEllipseItem.__init__(self, *args)
     self.setRect(-3.5, -3.5, 7., 7.)
     self.setPen(QPen(Qt.NoPen))
     self.setBrush(QBrush(QColor("#9CACB4")))
     self.__hover = False
Exemplo n.º 15
0
 def __init__(self, *args):
     QGraphicsEllipseItem.__init__(self, *args)
     self.setRect(-3.5, -3.5, 7., 7.)
     self.setPen(QPen(Qt.NoPen))
     self.setBrush(QBrush(QColor("#9CACB4")))
     self.__hover = False