我想知道为什么要使用标记号,以及 1 到 31 个标记号之间有何不同。以及如何添加自定义标记符号,如渐变、像素图或图像等,例如给定图像中的这些蓝色闪光点。:-
标记在以下代码中定义:-
CIRCLE_MARKER_NUM = 0
......
def __init__(self, parent=None):
super(SimplePythonEditor, self).__init__(parent)
self.markerDefine(QsciScintilla.Circle,self.CIRCLE_MARKER_NUM)
self.setMarkerBackgroundColor(QColor(66, 66, 255),self.CIRCLE_MARKER_NUM)
......
def on_margin_clicked(self, nmargin, nline, modifiers):
# Toggle marker for the line the margin was clicked on
if self.markersAtLine(nline) != 0:
self.markerDelete(nline, self.CIRCLE_MARKER_NUM)
else:
self.markerAdd(nline, self.CIRCLE_MARKER_NUM)