diff options
Diffstat (limited to 'src/main/python')
-rw-r--r-- | src/main/python/main.py | 13 | ||||
-rw-r--r-- | src/main/python/shapes/line.py | 38 | ||||
-rw-r--r-- | src/main/python/shapes/rLGPlus.txt | 41 | ||||
-rw-r--r-- | src/main/python/shapes/shapes.py | 221 | ||||
-rw-r--r-- | src/main/python/utils/graphics.py | 29 | ||||
-rw-r--r-- | src/main/python/utils/toolbar.py | 1 |
6 files changed, 264 insertions, 79 deletions
diff --git a/src/main/python/main.py b/src/main/python/main.py index 3aa8e6a..5af252d 100644 --- a/src/main/python/main.py +++ b/src/main/python/main.py @@ -104,12 +104,12 @@ class appWindow(QMainWindow): #call to create a new file inside mdi area project = FileWindow(self.mdi) project.setObjectName("New Project") + project.setWindowFlags(Qt.FramelessWindowHint) self.mdi.addSubWindow(project) if not project.tabList: # important when unpickling a file instead project.newDiagram() #create a new tab in the new file project.fileCloseEvent.connect(self.fileClosed) #closed file signal to switch to sub window view - if self.count > 1: #switch to tab view if needed - self.mdi.setViewMode(QMdiArea.TabbedView) + self.mdi.setViewMode(QMdiArea.TabbedView) project.show() def openProject(self): @@ -126,9 +126,7 @@ class appWindow(QMainWindow): project.resizeHandler() project.fileCloseEvent.connect(self.fileClosed) project.show() - if self.count > 1: - # self.tabSpace.setVisible(True) - self.mdi.setViewMode(QMdiArea.TabbedView) + self.mdi.setViewMode(QMdiArea.TabbedView) def saveProject(self): #serialize all files in mdi area @@ -169,9 +167,10 @@ class appWindow(QMainWindow): self.writeSettings() def fileClosed(self, index): + pass #checks if the file tab menu needs to be removed - if self.count <= 2 : - self.mdi.setViewMode(QMdiArea.SubWindowView) + # if self.count <= 1 : + # self.mdi.setViewMode(QMdiArea.SubWindowView) def writeSettings(self): # write window state on window close diff --git a/src/main/python/shapes/line.py b/src/main/python/shapes/line.py index 856869d..ba0c564 100644 --- a/src/main/python/shapes/line.py +++ b/src/main/python/shapes/line.py @@ -5,6 +5,18 @@ from PyQt5.QtCore import Qt, QPointF, QRectF, QLineF, pyqtSignal from collections import defaultdict +#For extending Lines for repositioned Rectangular Line Grips +rLGPlus = {} +f = open('./shapes/rLGPlus.txt','r') +dataRead = f.readlines()[1:] +for line in dataRead: + + if not line.__contains__(',') : + rLGPlus[line.strip()] = [] + else: + grips = line.strip().split(',') + rLGPlus[list(rLGPlus.keys())[-1]].append(grips) + class Grabber(QGraphicsPathItem): """ Extends QGraphicsPathItem to create grabber for line for moving a particular segment @@ -936,6 +948,19 @@ class Line(QGraphicsPathItem): startPoint.setY( startPoint.y() - self.startGap * item.boundingRect().height()) self.startPoint = startPoint + #Adjusting line for repositioned retangular grips + if self.startGripItem.parentItem().__class__.__name__ in list(rLGPlus.keys()): + for tgrip in rLGPlus[self.startGripItem.parentItem().__class__.__name__]: + if(float(tgrip[3]) == 0): + if self.startGripItem.m_location == tgrip[0]: + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.startPoint.setX(self.startPoint.x()+tempx) + self.startPoint.setY(self.startPoint.y()+tempy) + else: + if self.startGripItem.m_location == tgrip[0] and self.startGripItem.size == float(tgrip[3]): + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.startPoint.setX(self.startPoint.x()+tempx) + self.startPoint.setY(self.startPoint.y()+tempy) # end point on line if self.endGripItem: item = self.endGripItem @@ -948,6 +973,19 @@ class Line(QGraphicsPathItem): endPoint.setY( endPoint.y() - self.endGap * item.boundingRect().height()) self.endPoint = endPoint + #Adjusting line for repositioned retangular grips + if self.endGripItem.parentItem().__class__.__name__ in list(rLGPlus.keys()): + for tgrip in rLGPlus[self.endGripItem.parentItem().__class__.__name__]: + if(float(tgrip[3]) == 0): + if self.endGripItem.m_location == tgrip[0]: + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.endPoint.setX(self.endPoint.x()+tempx) + self.endPoint.setY(self.endPoint.y()+tempy) + else: + if self.endGripItem.m_location == tgrip[0] and self.endGripItem.size == float(tgrip[3]): + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.endPoint.setX(self.endPoint.x()+tempx) + self.endPoint.setY(self.endPoint.y()+tempy) self.updatePath() # end point on other line elif self.refLine: diff --git a/src/main/python/shapes/rLGPlus.txt b/src/main/python/shapes/rLGPlus.txt new file mode 100644 index 0000000..0cd2e86 --- /dev/null +++ b/src/main/python/shapes/rLGPlus.txt @@ -0,0 +1,41 @@ +#Contains data of the distance rectangular line grips were extended className:direction,x,y,width +OilGasOrPulverizedFuelFurnace +left,4,0,0 +right,-4,0,0 +bottom,0,-8,0 +SolidFuelFurnace +left,4,0,0 +right,-4,0,0 +bottom,0,-8,0 +HorizontalVessel +top,0,6,0 +bottom,0,-6,0 +PackedVessel +left,6,0,0 +right,-6,0,0 +VerticalVessel +left,6,0,0 +right,-6,0,0 +FixedRoofTank +left,5,0,0 +right,-6,0,0 +bottom,0,-8,0 +FloatingRoofTank +left,6,0,0 +right,-6,0,0 +bottom,0,-8,0 +SeparatorsForLiquidsDecanter +top,0,8,0 +left,8,0,0 +right,-8,0,0 +bottom,0,-8,0 +OneCellFiredHeaterFurnace +left,5,0,50 +right,-5,0,50 +bottom,0,-8,0 +TwoCellFiredHeaterFurnace +left,3,0,66.66 +right,-3,0,66.66 +bottom,0,-8,33.33 +ContinuousDryer +top,0,8,0
\ No newline at end of file diff --git a/src/main/python/shapes/shapes.py b/src/main/python/shapes/shapes.py index 5446e98..a67e8dc 100644 --- a/src/main/python/shapes/shapes.py +++ b/src/main/python/shapes/shapes.py @@ -26,6 +26,18 @@ orientationEnum = [ Qt.Vertical ] +#For extending Lines for repositioned Rectangular Line Grips +rLGPlus = {} +f = open('./shapes/rLGPlus.txt','r') +dataRead = f.readlines()[1:] +for line in dataRead: + + if not line.__contains__(',') : + rLGPlus[line.strip()] = [] + else: + grips = line.strip().split(',') + rLGPlus[list(rLGPlus.keys())[-1]].append(grips) + class ItemLabel(QGraphicsTextItem): """Extends PyQt5's QGraphicsPathItem to create text label for svg item """ @@ -97,11 +109,11 @@ class SizeGripItem(QGraphicsPathItem): def __init__(self, index, direction=Qt.Horizontal, parent=None): super(SizeGripItem, self).__init__(parent=parent) # set graphical setting - self.setFlag(QGraphicsItem.ItemIsSelectable, True) + #self.setFlag(QGraphicsItem.ItemIsSelectable, True) self.setFlag(QGraphicsItem.ItemIsMovable, True) self.setFlag(QGraphicsItem.ItemSendsGeometryChanges, True) self.setAcceptHoverEvents(True) - self.setPen(QPen(QColor("black"), 0)) + self.setPen(QPen(Qt.NoPen)) self.setZValue(2) # property direction self._direction = (orientationEnum.index(direction) + self.parentItem().rotation) % 4 @@ -121,22 +133,45 @@ class SizeGripItem(QGraphicsPathItem): else: return orientationEnum[self._direction] - def updatePath(self): + def updatePath(self,m_index): """updates path of size grip item """ - width = height = 0 - if self.direction is Qt.Horizontal: - height = self.parentItem().boundingRect().height() - else: - width = self.parentItem().boundingRect().width() + bx = self.parentItem().boundingRect().x() + by = self.parentItem().boundingRect().y() + height = self.parentItem().boundingRect().height() + width = self.parentItem().boundingRect().width() + path = QPainterPath() - path.addRect(QRectF(-width / 2, -height / 2, width, height)) + if(m_index == 0):#top + by = by+10 + path.moveTo(bx+(width/2)-10,by) + path.lineTo(bx+(width/2)+10,by) + path.lineTo(bx+(width/2),by-20) + path.lineTo(bx+(width/2)-10,by) + if(m_index == 1):#left + bx = bx+10 + path.moveTo(bx,by+(height/2)-10) + path.lineTo(bx,by+(height/2)+10) + path.lineTo(bx-20,by+(height/2)) + path.lineTo(bx,by+(height/2)-10) + if(m_index == 2):#bottom + by = by-10 + path.moveTo(bx+(width/2)-10,by+height) + path.lineTo (bx+(width/2)+10,by+height) + path.lineTo (bx+(width/2),by+height+20) + path.lineTo (bx+(width/2)-10,by+height) + if(m_index == 3):#right + bx = bx-10 + path.moveTo(bx+width,by+(height/2)-10) + path.lineTo(bx+width,by+(height/2)+10) + path.lineTo(bx+width+20,by+(height/2)) + path.lineTo(bx+width,by+(height/2)-10) self.setPath(path) def updatePosition(self): """updates position of grip items """ - self.updatePath() + self.updatePath(self.m_index) pos = self.point(self.m_index) self.setEnabled(False) self.setPos(pos) @@ -206,13 +241,14 @@ class SizeGripItem(QGraphicsPathItem): def show(self): # make self visible - self.setPen(QPen(QColor("black"), 2)) + self.setPen(QPen(QColor(128, 128, 128,150), 2)) + super(SizeGripItem,self).show() def hide(self): # hide self by setting pen to transparent - if not self.parentItem().isSelected(): - self.setPen(QPen(Qt.transparent)) - self.setBrush(Qt.transparent) + self.setPen(QPen(Qt.NoPen)) + self.setBrush(Qt.transparent) + super(SizeGripItem,self).hide() class LineGripItem(QGraphicsPathItem): @@ -328,7 +364,7 @@ class LineGripItem(QGraphicsPathItem): return # initialize a line and add on scene # restrict circle grip to one line - if self.size is None and len(self.lines) > 0: + if self.size is None and len(self.lines) < 0: pass else: startPoint = self.parentItem().mapToScene(self.pos()) # first point of line @@ -361,12 +397,13 @@ class LineGripItem(QGraphicsPathItem): # hide grip of previous hovered item if self.previousHoveredItem and item != self.previousHoveredItem and \ item not in self.previousHoveredItem.lineGripItems: - self.previousHoveredItem.hideGripItem() + self.previousHoveredItem.hideLineGripItem() + #self.previousHoveredItem.hideSizeGripItem() super().mouseMoveEvent(mouseEvent) # show grip of current hoverde item if isinstance(item, NodeItem): self.previousHoveredItem = item - item.showGripItem() + item.showLineGripItem() def mouseReleaseEvent(self, mouseEvent): """Handle all mouse release for this item""" @@ -399,6 +436,32 @@ class LineGripItem(QGraphicsPathItem): if self.tempLine.startGripItem.parentItem() != self.tempLine.endGripItem.parentItem(): # update line with end point so it sets final path self.tempLine.updateLine(endPoint=endPoint) + #Adjusting line for repositioned retangular grips + if self.parentItem().__class__.__name__ in list(rLGPlus.keys()): + for tgrip in rLGPlus[self.parentItem().__class__.__name__]: + if(float(tgrip[3]) == 0): + if self.m_location == tgrip[0]: + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.tempLine.startPoint.setX(self.tempLine.startPoint.x()+tempx) + self.tempLine.startPoint.setY(self.tempLine.startPoint.y()+tempy) + else: + if self.m_location == tgrip[0] and self.size == float(tgrip[3]): + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.tempLine.startPoint.setX(self.tempLine.startPoint.x()+tempx) + self.tempLine.startPoint.setY(self.tempLine.startPoint.y()+tempy) + if item.parentItem().__class__.__name__ in list(rLGPlus.keys()): + for tgrip in rLGPlus[item.parentItem().__class__.__name__]: + if(float(tgrip[3]) == 0): + if item.m_location == tgrip[0]: + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.tempLine.endPoint.setX(self.tempLine.endPoint.x()+tempx) + self.tempLine.endPoint.setY(self.tempLine.endPoint.y()+tempy) + else: + if item.m_location == tgrip[0] and item.size == float(tgrip[3]): + tempx,tempy = int(tgrip[1]),int(tgrip[2]) + self.tempLine.endPoint.setX(self.tempLine.endPoint.x()+tempx) + self.tempLine.endPoint.setY(self.tempLine.endPoint.y()+tempy) + self.lines.append(self.tempLine) item.lines.append(self.tempLine) tag = 1 @@ -426,8 +489,8 @@ class LineGripItem(QGraphicsPathItem): def show(self): """ shows line grip item """ - self.setPen(QPen(QColor("black"), 2)) - self.setBrush(QColor("cyan")) + self.setPen(QPen(QColor(0,0,0,150), 1.5)) + self.setBrush(QColor(140,199,198,255)) def hide(self): """ hides line grip item @@ -462,6 +525,7 @@ class NodeItem(QGraphicsSvgItem): self.label = None self._rotation = 0 self.flipState = [False, False] + self.activateGrip = False @property def flipH(self): @@ -577,13 +641,17 @@ class NodeItem(QGraphicsSvgItem): def itemChange(self, change, value): """Overloads and extends QGraphicsSvgItem to also update grip items """ + newPos = value # check if item selected is changed if change == QGraphicsItem.ItemSelectedHasChanged: # show grips if selected if value is True: - self.showGripItem() + self.showLineGripItem() + self.showSizeGripItem() else: - self.hideGripItem() + self.hideLineGripItem() + if not self.activateGrip: + self.hideSizeGripItem() return # check if transform changed if change == QGraphicsItem.ItemTransformHasChanged: @@ -594,7 +662,21 @@ class NodeItem(QGraphicsSvgItem): # update grips self.updateLineGripItem() self.updateSizeGripItem() - return + + #restrict movable area of Node Item + + if self.parent() is not None: + rect = self.parent().sceneRect() + width = self.boundingRect().width() + height = self.boundingRect().height() + eWH1 = QPointF(newPos.x()+width,newPos.y()+height) + eWH2 = QPointF(newPos.x()-width,newPos.y()-height) + if not rect.__contains__(eWH1) or not rect.__contains__(eWH2) : + newPos.setX(min(rect.right()-width+40, max(newPos.x(), rect.left()+90))) + newPos.setY(min(rect.bottom()-height, max(newPos.y(), rect.top()+70))) + self.setPos(newPos) + return super(NodeItem,self).itemChange(change, newPos) + # check if item is add on scene if change == QGraphicsItem.ItemSceneHasChanged and self.scene(): # add grips and update them @@ -607,28 +689,47 @@ class NodeItem(QGraphicsSvgItem): def hoverEnterEvent(self, event): """defines shape highlighting on Mouse Over """ - self.showGripItem() + self.showLineGripItem() super(NodeItem, self).hoverEnterEvent(event) def hoverLeaveEvent(self, event): """defines shape highlighting on Mouse Leave """ - self.hideGripItem() + self.hideLineGripItem() + #self.hideSizeGripItem() super(NodeItem, self).hoverLeaveEvent(event) + + def mouseDoubleClickEvent(self, event): + self.activateGrip = not self.activateGrip + if self.activateGrip == False: + self.hideSizeGripItem() + self.parent().update() + else: + self.showSizeGripItem() + super(NodeItem,self).mouseDoubleClickEvent(event) - def showGripItem(self): - """shows grip items of svg item + def showLineGripItem(self): + """shows line grip items of svg item """ for item in self.lineGripItems: item.show() - for item in self.sizeGripItems: - item.show() - def hideGripItem(self): - """hide grip items of svg item + def hideLineGripItem(self): + """hide line grip items of svg item """ for item in self.lineGripItems: item.hide() + + def showSizeGripItem(self): + """shows size grip items of svg item + """ + for item in self.sizeGripItems: + item.show() + + def hideSizeGripItem(self): + """hide size grip items of svg item + """ + self.activateGrip = False for item in self.sizeGripItems: item.hide() @@ -813,9 +914,9 @@ class OilGasOrPulverizedFuelFurnace(NodeItem): self.grips = [ [58.27673386073162, 100, "top"], [0, 19.692723451106, "left"], - [17.2777337415748, 33.3944873323144, "left", 66.7889746646288], - [100, 33.3944873323144, "right", 66.7889746646288], - [57.9723659874, 0, "bottom", 81.389264491796] + [17.2777337415748-5, 33.3944873323144, "left", 66.7889746646288], + [100+5, 33.3944873323144, "right", 66.7889746646288], + [57.9723659874, 0-10, "bottom", 81.389264491796] ] @@ -824,9 +925,9 @@ class SolidFuelFurnace(NodeItem): super(SolidFuelFurnace, self).__init__("svg/Furnaces and Boilers/Solid Fuel Furnace") self.grips = [ [50, 100, "top"], - [0, 33.39352642259468, "left", 66.78705284518936], - [100, 33.39352642259468, "right", 66.78705284518936], - [50, 0, "bottom", 100] + [0-5, 33.39352642259468, "left", 66.78705284518936], + [100+5, 33.39352642259468, "right", 66.78705284518936], + [50, 0-10, "bottom", 100] ] @@ -865,10 +966,10 @@ class HorizontalVessel(NodeItem): def __init__(self): super(HorizontalVessel, self).__init__("svg/Process Vessels/Horizontal Vessel") self.grips = [ - [50, 100, "top", 87.08554680344], + [50, 100+10, "top", 87.08554680344], [0, 50, "left"], [100, 50, "right"], - [50, 0, "bottom", 87.08554680344] + [50, 0-10, "bottom", 87.08554680344] ] @@ -877,8 +978,8 @@ class PackedVessel(NodeItem): super(PackedVessel, self).__init__("svg/Process Vessels/Packed Vessel") self.grips = [ [50, 100, "top"], - [0, 50, "left", 86.703566201060], - [100, 50, "right", 86.703566201060], + [0-10, 50, "left", 86.703566201060], + [100+10, 50, "right", 86.703566201060], [50, 0, "bottom"] ] @@ -895,8 +996,8 @@ class VerticalVessel(NodeItem): super(VerticalVessel, self).__init__("svg/Process Vessels/Vertical Vessel") self.grips = [ [50, 100, "top"], - [0, 50, "left", 86.703566201060], - [100, 50, "right", 86.703566201060], + [0-10, 50, "left", 86.703566201060], + [100+10, 50, "right", 86.703566201060], [50, 0, "bottom"] ] @@ -917,9 +1018,9 @@ class FixedRoofTank(NodeItem): super(FixedRoofTank, self).__init__("svg/Storage Vessels Tanks/Fixed Roof Tank") self.grips = [ [50, 100, "top"], - [0, 50, "left", 100], - [100, 50, "right", 100], - [50, 0, "bottom", 100] + [0-6, 50, "left", 100], + [100+7, 50, "right", 100], + [50, 0-10, "bottom", 100] ] @@ -927,9 +1028,9 @@ class FloatingRoofTank(NodeItem): def __init__(self): super(FloatingRoofTank, self).__init__("svg/Storage Vessels Tanks/Floating Roof Tank") self.grips = [ - [0, 50, "left", 100], - [100, 50, "right", 100], - [50, 0, "bottom", 100] + [0-7, 50, "left", 100], + [100+7, 50, "right", 100], + [50, 0-10, "bottom", 100] ] @@ -937,10 +1038,10 @@ class SeparatorsForLiquidsDecanter(NodeItem): def __init__(self): super(SeparatorsForLiquidsDecanter, self).__init__("svg/Separators/Separators for Liquids, Decanter") self.grips = [ - [50, 100, "top", 100], - [0, 50, "left", 100], - [100, 50, "right", 100], - [50, 0, "bottom", 100] + [50, 100+10, "top", 100], + [0-10, 50, "left", 100], + [100+10, 50, "right", 100], + [50, 0-10, "bottom", 100] ] class GateValve(NodeItem): @@ -965,11 +1066,11 @@ class OneCellFiredHeaterFurnace(NodeItem): super(OneCellFiredHeaterFurnace, self).__init__("svg/Furnaces and Boilers/One Cell Fired Heater, Furnace") self.grips = [ [50, 100, "top"], - [0, 25, "left", 50], + [0-7, 25, "left", 50], [25, 87.5, "left", 25], - [100, 25, "right", 50], + [100+7, 25, "right", 50], [75, 87.5, "right", 25], - [50, 0, "bottom", 100] + [50, 0-10, "bottom", 100] ] @@ -978,12 +1079,12 @@ class TwoCellFiredHeaterFurnace(NodeItem): super(TwoCellFiredHeaterFurnace, self).__init__("svg/Furnaces and Boilers/Two Cell Fired Heater, Furnace") self.grips = [ [50, 100, "top"], - [0, 33.33, "left", 66.66], + [0-5, 33.33, "left", 66.66], [33.33, 91.66, "left", 16.66], - [100, 33.33, "right", 66.66], + [100+5, 33.33, "right", 66.66], [66.66, 91.66, "right", 16.66], - [16.67, 0, "bottom", 33.33], - [83.33, 0, "bottom", 33.33] + [16.67, 0-10, "bottom", 33.33], + [83.33, 0-10, "bottom", 33.33] ] @@ -1011,7 +1112,7 @@ class ContinuousDryer(NodeItem): self.grips = [ [8.13, 35.2, "top"], [98.9, 28, "bottom"], - [50, 100, "top", 60.13] + [50, 100+10, "top", 60.13] ] diff --git a/src/main/python/utils/graphics.py b/src/main/python/utils/graphics.py index 5a44400..80eb5e7 100644 --- a/src/main/python/utils/graphics.py +++ b/src/main/python/utils/graphics.py @@ -1,5 +1,5 @@ from PyQt5.QtCore import Qt, QPointF, pyqtSignal -from PyQt5.QtGui import QPen, QKeySequence +from PyQt5.QtGui import QPen, QKeySequence, QTransform, QCursor from PyQt5.QtWidgets import QGraphicsView, QGraphicsScene, QGraphicsProxyWidget, QGraphicsItem, QUndoStack, QAction, QUndoView from .undo import * @@ -44,6 +44,7 @@ class CustomView(QGraphicsView): graphic = getattr(shapes, obj[0])(*map(lambda x: int(x) if x.isdigit() else x, obj[1:])) graphic.setPos(QDropEvent.pos().x(), QDropEvent.pos().y()) self.scene().addItemPlus(graphic) + graphic.setParent(self) QDropEvent.acceptProposedAction() def wheelEvent(self, QWheelEvent): @@ -105,17 +106,14 @@ class CustomScene(QGraphicsScene): # (slot) used to delete all selected items, and add undo action for each of them if self.selectedItems(): for item in self.selectedItems(): - if(issubclass(item.__class__,shapes.LineGripItem) or issubclass(item.__class__,shapes.SizeGripItem) ): - itemToDelete = item.parentItem() - else: - itemToDelete = item - self.count = 0 - if(issubclass(itemToDelete.__class__,shapes.NodeItem)): - for i in itemToDelete.lineGripItems: - for j in i.lines: - self.count+=1 - self.undoStack.push(deleteCommand(j, self)) - if itemToDelete.__class__ != shapes.line.Grabber: + if issubclass(item.__class__,shapes.NodeItem) or isinstance(item,shapes.Line): + itemToDelete = item + self.count = 0 + if(issubclass(itemToDelete.__class__,shapes.NodeItem)): + for i in itemToDelete.lineGripItems: + for j in i.lines: + self.count+=1 + self.undoStack.push(deleteCommand(j, self)) self.undoStack.push(deleteCommand(itemToDelete, self)) def itemMoved(self, movedItem, lastPos): @@ -147,6 +145,13 @@ class CustomScene(QGraphicsScene): self.movingItem = None #clear movingitem reference return super(CustomScene, self).mouseReleaseEvent(event) + def mouseMoveEvent(self, mouseEvent): + item = self.itemAt(mouseEvent.scenePos().x(), mouseEvent.scenePos().y(), + QTransform()) + if isinstance(item,shapes.SizeGripItem): + item.parentItem().showLineGripItem() + super(CustomScene,self).mouseMoveEvent(mouseEvent) + def reInsertLines(self): currentIndex = self.undoStack.index() i = 2 diff --git a/src/main/python/utils/toolbar.py b/src/main/python/utils/toolbar.py index dbfff22..69618f0 100644 --- a/src/main/python/utils/toolbar.py +++ b/src/main/python/utils/toolbar.py @@ -31,6 +31,7 @@ class toolbar(QDockWidget): self.setWindowFlags(Qt.FramelessWindowHint) self.searchBox = QLineEdit(self.widget) #search box to search through componenets + self.searchBox.setStyleSheet("QLineEdit {background-color: white;color: black}") #set color of searchBox #connect signal to filter slot, add searchbar to toolbar self.searchBox.textChanged.connect(self.searchQuery) |