Commit 8adad9b7 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

network: Add timers.

Showing with 7 additions and 0 deletions
+7 -0
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment