mirror of https://gitlab.com/pamhyr/pamhyr2
network: Add timers.
parent
632e092619
commit
8adad9b7ad
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
import math
|
||||
|
||||
from tools import timer
|
||||
|
||||
from PyQt5.QtCore import (
|
||||
Qt, QPoint, QPointF, QSizeF, QLineF, QRectF,
|
||||
pyqtSlot, pyqtSignal,
|
||||
|
|
@ -47,6 +49,7 @@ class NodeItem(QGraphicsItem):
|
|||
path.addEllipse(-10, -10, 20, 20)
|
||||
return path
|
||||
|
||||
@timer
|
||||
def paint(self, painter, option, widget):
|
||||
painter.setPen(Qt.NoPen)
|
||||
|
||||
|
|
@ -127,6 +130,7 @@ class EdgeItem(QGraphicsItem):
|
|||
|
||||
return result
|
||||
|
||||
@timer
|
||||
def paint(self, painter, option, widget):
|
||||
# Draw shape of the edge
|
||||
# color = QColor(Qt.white)
|
||||
|
|
@ -198,6 +202,7 @@ class NodeText(QGraphicsTextItem):
|
|||
|
||||
self.setPos(QPointF(x,y))
|
||||
|
||||
@timer
|
||||
def paint(self, painter, option, widget):
|
||||
color = QColor(Qt.white)
|
||||
color.setAlpha(128)
|
||||
|
|
@ -232,6 +237,7 @@ class NewEdgeLine(QGraphicsItem):
|
|||
)
|
||||
).normalized().adjusted(-extra, -extra, extra, extra)
|
||||
|
||||
@timer
|
||||
def paint(self, painter, option, widget):
|
||||
line = QLineF(self.src, self.dest)
|
||||
if line.length() == 0.0:
|
||||
|
|
@ -284,6 +290,7 @@ class GraphWidget(QGraphicsView):
|
|||
|
||||
self.create_items()
|
||||
|
||||
@timer
|
||||
def create_items(self):
|
||||
"""Create all items and draw its
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue