From b888197a0d57f77383591875baae8136cec2a663 Mon Sep 17 00:00:00 2001 From: Blaine Date: Wed, 3 Jun 2020 12:59:12 +0530 Subject: conflict resolution --- src/main/python/shapes/shapes.py | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'src/main/python/shapes/shapes.py') diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index 9f7113c..3cb1e14 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -6,16 +6,8 @@ from PyQt5.QtWidgets import QLineEdit, QGraphicsItem, QGraphicsEllipseItem, QGra from PyQt5.QtGui import QPen, QColor, QFont, QCursor, QPainterPath, QPainter, QDrag, QBrush, QImage, QTransform from PyQt5.QtCore import Qt, QRectF, QPointF, QSizeF, QEvent, QMimeData, QFile, QIODevice, QRect -<<<<<<< HEAD -from line import Line - - -======= from .line import Line - from utils.app import fileImporter ->>>>>>> merge -# resourceManager = ApplicationContext() class GripItem(QGraphicsPathItem): @@ -232,11 +224,7 @@ class LineGripItem(GripItem): startPoint = endPoint = self.parentItem().mapToScene(self.pos()) self.tempLine = Line(startPoint, endPoint) self.tempLine.setStartGripItem(self) -<<<<<<< HEAD - self.scene().addItem(self.tempLine) -======= self.scene().addItemPlus(self.tempLine) ->>>>>>> merge super().mousePressEvent(mouseEvent) def mouseMoveEvent(self, mouseEvent): @@ -308,22 +296,14 @@ class NodeItem(QGraphicsSvgItem): def __init__(self, unitOperationType, parent=None): QGraphicsSvgItem.__init__(self, parent) self.m_type = unitOperationType -<<<<<<< HEAD - self.m_renderer = QSvgRenderer("svg/" + unitOperationType + ".svg") -======= # self.m_renderer = QSvgRenderer("svg/" + unitOperationType + ".svg") # self.m_renderer = QSvgRenderer(fileImporter(f'svg/{unitOperationType}.svg')) self.m_renderer = QSvgRenderer(fileImporter(f'svg/ellipse.svg')) ->>>>>>> merge # self.m_renderer = QSvgRenderer(resourceManager.get_resource(f'toolbar/{unitOperationType}.svg')) self.setSharedRenderer(self.m_renderer) # set initial size of item self.width = 100 -<<<<<<< HEAD - self.height = 150 -======= self.height = 100 ->>>>>>> merge self.rect = QRectF(-self.width / 2, -self.height / 2, self.width, self.height) # set graphical settings for this item self.setFlags(QGraphicsSvgItem.ItemIsMovable | @@ -334,13 +314,7 @@ class NodeItem(QGraphicsSvgItem): # grip items connected to this item self.lineGripItems = [] self.sizeGripItems = [] - -<<<<<<< HEAD -======= - def advance(self, int): - print (int) - ->>>>>>> merge + def boundingRect(self): """Overrides QGraphicsSvgItem's boundingRect() virtual public function and returns a valid bounding -- cgit From f0a2c4501a136fa23890380e82551e44d9465707 Mon Sep 17 00:00:00 2001 From: Blaine Date: Wed, 3 Jun 2020 13:01:39 +0530 Subject: conflict resolution --- src/main/python/shapes/shapes.py | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'src/main/python/shapes/shapes.py') diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index 3cb1e14..e79ddb7 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -1,14 +1,18 @@ -# from fbs_runtime.application_context.PyQt5 import ApplicationContext from PyQt5 import QtCore, QtWidgets +from PyQt5.QtCore import (QEvent, QFile, QIODevice, QMimeData, QPointF, QRect, + QRectF, QSizeF, Qt) +from PyQt5.QtGui import (QBrush, QColor, QCursor, QDrag, QFont, QImage, + QPainter, QPainterPath, QPen, QTransform) from PyQt5.QtSvg import QGraphicsSvgItem, QSvgRenderer -from PyQt5.QtWidgets import QLineEdit, QGraphicsItem, QGraphicsEllipseItem, QGraphicsProxyWidget, QGraphicsPathItem, \ - QGraphicsSceneHoverEvent, QGraphicsColorizeEffect -from PyQt5.QtGui import QPen, QColor, QFont, QCursor, QPainterPath, QPainter, QDrag, QBrush, QImage, QTransform -from PyQt5.QtCore import Qt, QRectF, QPointF, QSizeF, QEvent, QMimeData, QFile, QIODevice, QRect +from PyQt5.QtWidgets import (QGraphicsColorizeEffect, QGraphicsEllipseItem, + QGraphicsItem, QGraphicsPathItem, + QGraphicsProxyWidget, QGraphicsSceneHoverEvent, + QLineEdit) -from .line import Line from utils.app import fileImporter +from .line import Line + class GripItem(QGraphicsPathItem): """ @@ -27,21 +31,6 @@ class GripItem(QGraphicsPathItem): self.setAcceptHoverEvents(True) self.setCursor(QCursor(Qt.PointingHandCursor)) - # def hoverEnterEvent(self, event): - # """ - # defines shape highlighting on Mouse Over - # """ - # self.setPen(QPen(QColor("black"), 2)) - # self.setBrush(QColor("red")) - # super(GripItem, self).hoverEnterEvent(event) - # - # def hoverLeaveEvent(self, event): - # """ - # defines shape highlighting on Mouse Leave - # """ - # self.setPen(QPen(Qt.transparent)) - # self.setBrush(Qt.transparent) - # super(GripItem, self).hoverLeaveEvent(event) def mouseReleaseEvent(self, event): """ -- cgit From 56d830cb025a1b7dd99ac2c0292c0eed27aebb9b Mon Sep 17 00:00:00 2001 From: Blaine Date: Wed, 3 Jun 2020 14:12:43 +0530 Subject: fix shapes --- src/main/python/shapes/shapes.py | 44 ---------------------------------------- 1 file changed, 44 deletions(-) (limited to 'src/main/python/shapes/shapes.py') diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index 582215e..19c0298 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -5,24 +5,10 @@ from PyQt5.QtWidgets import QLineEdit, QGraphicsItem, QGraphicsEllipseItem, QGra from PyQt5.QtGui import QPen, QColor, QFont, QCursor, QPainterPath, QPainter, QDrag, QBrush, QImage, QTransform from PyQt5.QtCore import Qt, QRectF, QPointF, QSizeF, QEvent, QMimeData, QFile, QIODevice, QRect -<<<<<<< HEAD from .line import Line from utils.app import fileImporter -======= -<<<<<<< HEAD -from line import Line - - -======= -from .line import Line - -from utils.app import fileImporter ->>>>>>> merge -# resourceManager = ApplicationContext() - ->>>>>>> upstream/master class GripItem(QGraphicsPathItem): """ @@ -237,16 +223,7 @@ class LineGripItem(GripItem): # initialize a line and add on scene startPoint = endPoint = self.parentItem().mapToScene(self.pos()) self.tempLine = Line(startPoint, endPoint) -<<<<<<< HEAD - self.scene().addItemPlus(self.tempLine) -======= - self.tempLine.setStartGripItem(self) -<<<<<<< HEAD - self.scene().addItem(self.tempLine) -======= self.scene().addItemPlus(self.tempLine) ->>>>>>> merge ->>>>>>> upstream/master super().mousePressEvent(mouseEvent) def mouseMoveEvent(self, mouseEvent): @@ -321,29 +298,14 @@ class NodeItem(QGraphicsSvgItem): def __init__(self, unitOperationType, parent=None): QGraphicsSvgItem.__init__(self, parent) self.m_type = unitOperationType -<<<<<<< HEAD self.id = None self.m_renderer = NodeItem.renderer # if each svg is seperate file # self.m_renderer = QSvgRenderer(fileImporter(f'svg/ellipse.svg')) -======= -<<<<<<< HEAD - self.m_renderer = QSvgRenderer("svg/" + unitOperationType + ".svg") -======= - # self.m_renderer = QSvgRenderer("svg/" + unitOperationType + ".svg") - # self.m_renderer = QSvgRenderer(fileImporter(f'svg/{unitOperationType}.svg')) - self.m_renderer = QSvgRenderer(fileImporter(f'svg/ellipse.svg')) ->>>>>>> merge - # self.m_renderer = QSvgRenderer(resourceManager.get_resource(f'toolbar/{unitOperationType}.svg')) ->>>>>>> upstream/master self.setSharedRenderer(self.m_renderer) # set initial size of item self.width = 100 -<<<<<<< HEAD self.height = 150 -======= - self.height = 100 ->>>>>>> merge self.rect = QRectF(-self.width / 2, -self.height / 2, self.width, self.height) # set graphical settings for this item self.setFlags(QGraphicsSvgItem.ItemIsMovable | @@ -355,12 +317,6 @@ class NodeItem(QGraphicsSvgItem): self.lineGripItems = [] self.sizeGripItems = [] -<<<<<<< HEAD -======= - def advance(self, int): - print (int) - ->>>>>>> merge def boundingRect(self): """Overrides QGraphicsSvgItem's boundingRect() virtual public function and returns a valid bounding -- cgit From d5745628dec09c909d162eaea722303e604b04e0 Mon Sep 17 00:00:00 2001 From: Blaine Date: Wed, 3 Jun 2020 14:19:08 +0530 Subject: fix2 --- src/main/python/shapes/shapes.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/main/python/shapes/shapes.py') diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index c2d79e4..3237e72 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -14,10 +14,6 @@ from utils.app import fileImporter from .line import Line from utils.app import fileImporter -<<<<<<< HEAD - -======= ->>>>>>> upstream/master class GripItem(QGraphicsPathItem): """ -- cgit