make these tiny methods with little excuse to exist private
This commit is contained in:
parent
68fa95686b
commit
af82858bc8
@ -446,10 +446,10 @@ class GradientEditorItem(TickSliderItem):
|
|||||||
|
|
||||||
self.rgbAction = QtGui.QAction(translate("GradiantEditorItem", 'RGB'), self)
|
self.rgbAction = QtGui.QAction(translate("GradiantEditorItem", 'RGB'), self)
|
||||||
self.rgbAction.setCheckable(True)
|
self.rgbAction.setCheckable(True)
|
||||||
self.rgbAction.triggered.connect(self.setColorModeToRGB)
|
self.rgbAction.triggered.connect(self._setColorModeToRGB)
|
||||||
self.hsvAction = QtGui.QAction(translate("GradiantEditorItem", 'HSV'), self)
|
self.hsvAction = QtGui.QAction(translate("GradiantEditorItem", 'HSV'), self)
|
||||||
self.hsvAction.setCheckable(True)
|
self.hsvAction.setCheckable(True)
|
||||||
self.hsvAction.triggered.connect(self.setColorModeToHSV)
|
self.hsvAction.triggered.connect(self._setColorModeToHSV)
|
||||||
|
|
||||||
self.menu = QtGui.QMenu()
|
self.menu = QtGui.QMenu()
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ class GradientEditorItem(TickSliderItem):
|
|||||||
self.updateGradient()
|
self.updateGradient()
|
||||||
self.linkedGradients = {}
|
self.linkedGradients = {}
|
||||||
|
|
||||||
self.sigTicksChanged.connect(self.updateGradientIgnoreArgs)
|
self.sigTicksChanged.connect(self._updateGradientIgnoreArgs)
|
||||||
self.sigTicksChangeFinished.connect(self.sigGradientChangeFinished.emit)
|
self.sigTicksChangeFinished.connect(self.sigGradientChangeFinished.emit)
|
||||||
|
|
||||||
def showTicks(self, show=True):
|
def showTicks(self, show=True):
|
||||||
@ -567,10 +567,10 @@ class GradientEditorItem(TickSliderItem):
|
|||||||
self.sigTicksChanged.emit(self)
|
self.sigTicksChanged.emit(self)
|
||||||
self.sigGradientChangeFinished.emit(self)
|
self.sigGradientChangeFinished.emit(self)
|
||||||
|
|
||||||
def setColorModeToRGB(self):
|
def _setColorModeToRGB(self):
|
||||||
self.setColorMode("rgb")
|
self.setColorMode("rgb")
|
||||||
|
|
||||||
def setColorModeToHSV(self):
|
def _setColorModeToHSV(self):
|
||||||
self.setColorMode("hsv")
|
self.setColorMode("hsv")
|
||||||
|
|
||||||
def colorMap(self):
|
def colorMap(self):
|
||||||
@ -591,7 +591,7 @@ class GradientEditorItem(TickSliderItem):
|
|||||||
self.gradRect.setBrush(QtGui.QBrush(self.gradient))
|
self.gradRect.setBrush(QtGui.QBrush(self.gradient))
|
||||||
self.sigGradientChanged.emit(self)
|
self.sigGradientChanged.emit(self)
|
||||||
|
|
||||||
def updateGradientIgnoreArgs(self, *args, **kwargs):
|
def _updateGradientIgnoreArgs(self, *args, **kwargs):
|
||||||
self.updateGradient()
|
self.updateGradient()
|
||||||
|
|
||||||
def setLength(self, newLen):
|
def setLength(self, newLen):
|
||||||
|
@ -110,8 +110,8 @@ class LinearRegionItem(GraphicsObject):
|
|||||||
for l in self.lines:
|
for l in self.lines:
|
||||||
l.setParentItem(self)
|
l.setParentItem(self)
|
||||||
l.sigPositionChangeFinished.connect(self.lineMoveFinished)
|
l.sigPositionChangeFinished.connect(self.lineMoveFinished)
|
||||||
self.lines[0].sigPositionChanged.connect(self.line0Moved)
|
self.lines[0].sigPositionChanged.connect(self._line0Moved)
|
||||||
self.lines[1].sigPositionChanged.connect(self.line1Moved)
|
self.lines[1].sigPositionChanged.connect(self._line1Moved)
|
||||||
|
|
||||||
if brush is None:
|
if brush is None:
|
||||||
brush = QtGui.QBrush(QtGui.QColor(0, 0, 255, 50))
|
brush = QtGui.QBrush(QtGui.QColor(0, 0, 255, 50))
|
||||||
@ -242,10 +242,10 @@ class LinearRegionItem(GraphicsObject):
|
|||||||
self.prepareGeometryChange()
|
self.prepareGeometryChange()
|
||||||
self.sigRegionChanged.emit(self)
|
self.sigRegionChanged.emit(self)
|
||||||
|
|
||||||
def line0Moved(self):
|
def _line0Moved(self):
|
||||||
self.lineMoved(0)
|
self.lineMoved(0)
|
||||||
|
|
||||||
def line1Moved(self):
|
def _line1Moved(self):
|
||||||
self.lineMoved(1)
|
self.lineMoved(1)
|
||||||
|
|
||||||
def lineMoveFinished(self):
|
def lineMoveFinished(self):
|
||||||
|
@ -785,9 +785,9 @@ class ROI(GraphicsObject):
|
|||||||
|
|
||||||
def removeClicked(self):
|
def removeClicked(self):
|
||||||
## Send remove event only after we have exited the menu event handler
|
## Send remove event only after we have exited the menu event handler
|
||||||
QtCore.QTimer.singleShot(0, self.emitRemoveRequest)
|
QtCore.QTimer.singleShot(0, self._emitRemoveRequest)
|
||||||
|
|
||||||
def emitRemoveRequest(self):
|
def _emitRemoveRequest(self):
|
||||||
self.sigRemoveRequested.emit(self)
|
self.sigRemoveRequested.emit(self)
|
||||||
|
|
||||||
def mouseDragEvent(self, ev):
|
def mouseDragEvent(self, ev):
|
||||||
|
@ -203,15 +203,15 @@ class Parameter(QtCore.QObject):
|
|||||||
self.opts['default'] = None
|
self.opts['default'] = None
|
||||||
|
|
||||||
## Connect all state changed signals to the general sigStateChanged
|
## Connect all state changed signals to the general sigStateChanged
|
||||||
self.sigValueChanged.connect(self.emitValueChanged)
|
self.sigValueChanged.connect(self._emitValueChanged)
|
||||||
self.sigChildAdded.connect(self.emitChildAddedChanged)
|
self.sigChildAdded.connect(self._emitChildAddedChanged)
|
||||||
self.sigChildRemoved.connect(self.emitChildRemovedChanged)
|
self.sigChildRemoved.connect(self._emitChildRemovedChanged)
|
||||||
self.sigParentChanged.connect(self.emitParentChanged)
|
self.sigParentChanged.connect(self._emitParentChanged)
|
||||||
self.sigLimitsChanged.connect(self.emitLimitsChanged)
|
self.sigLimitsChanged.connect(self._emitLimitsChanged)
|
||||||
self.sigDefaultChanged.connect(self.emitDefaultChanged)
|
self.sigDefaultChanged.connect(self._emitDefaultChanged)
|
||||||
self.sigNameChanged.connect(self.emitNameChanged)
|
self.sigNameChanged.connect(self._emitNameChanged)
|
||||||
self.sigOptionsChanged.connect(self.emitOptionsChanged)
|
self.sigOptionsChanged.connect(self._emitOptionsChanged)
|
||||||
self.sigContextMenu.connect(self.emitContextMenuChanged)
|
self.sigContextMenu.connect(self._emitContextMenuChanged)
|
||||||
|
|
||||||
|
|
||||||
#self.watchParam(self) ## emit treechange signals if our own state changes
|
#self.watchParam(self) ## emit treechange signals if our own state changes
|
||||||
@ -511,31 +511,31 @@ class Parameter(QtCore.QObject):
|
|||||||
self.treeStateChanges.append((self, changeDesc, data))
|
self.treeStateChanges.append((self, changeDesc, data))
|
||||||
self.emitTreeChanges()
|
self.emitTreeChanges()
|
||||||
|
|
||||||
def emitValueChanged(self, param, data):
|
def _emitValueChanged(self, param, data):
|
||||||
self.emitStateChanged("value", data)
|
self.emitStateChanged("value", data)
|
||||||
|
|
||||||
def emitChildAddedChanged(self, param, *data):
|
def _emitChildAddedChanged(self, param, *data):
|
||||||
self.emitStateChanged("childAdded", data)
|
self.emitStateChanged("childAdded", data)
|
||||||
|
|
||||||
def emitChildRemovedChanged(self, param, data):
|
def _emitChildRemovedChanged(self, param, data):
|
||||||
self.emitStateChanged("childRemoved", data)
|
self.emitStateChanged("childRemoved", data)
|
||||||
|
|
||||||
def emitParentChanged(self, param, data):
|
def _emitParentChanged(self, param, data):
|
||||||
self.emitStateChanged("parent", data)
|
self.emitStateChanged("parent", data)
|
||||||
|
|
||||||
def emitLimitsChanged(self, param, data):
|
def _emitLimitsChanged(self, param, data):
|
||||||
self.emitStateChanged("limits", data)
|
self.emitStateChanged("limits", data)
|
||||||
|
|
||||||
def emitDefaultChanged(self, param, data):
|
def _emitDefaultChanged(self, param, data):
|
||||||
self.emitStateChanged("default", data)
|
self.emitStateChanged("default", data)
|
||||||
|
|
||||||
def emitNameChanged(self, param, data):
|
def _emitNameChanged(self, param, data):
|
||||||
self.emitStateChanged("name", data)
|
self.emitStateChanged("name", data)
|
||||||
|
|
||||||
def emitOptionsChanged(self, param, data):
|
def _emitOptionsChanged(self, param, data):
|
||||||
self.emitStateChanged("options", data)
|
self.emitStateChanged("options", data)
|
||||||
|
|
||||||
def emitContextMenuChanged(self, param, data):
|
def _emitContextMenuChanged(self, param, data):
|
||||||
self.emitStateChanged("contextMenu", data)
|
self.emitStateChanged("contextMenu", data)
|
||||||
|
|
||||||
def makeTreeItem(self, depth):
|
def makeTreeItem(self, depth):
|
||||||
|
Loading…
Reference in New Issue
Block a user