diff --git a/src/View/Network/GraphWidget.py b/src/View/Network/GraphWidget.py index 91dca277bfc088cd80c723084f71ed5d965460b6..e6281c0f06ca566633fe581efc80bd4a7ef81151 100644 --- a/src/View/Network/GraphWidget.py +++ b/src/View/Network/GraphWidget.py @@ -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