The gadgets package#
Various Qt-related helper classes and objects.
The gadgets.extraselectionmanager module#
ExtraSelectionManager managages highlighting of arbitrary sections in a Q(Plain)TextEdit.
- class ExtraSelectionManager(textedit)[source]#
Bases:
SingleInstance
Manages highlighting of arbitrary sections in a Q(Plain)TextEdit.
Stores and highlights lists of QTextCursors on a per-format basis.
Instantiate with:
ExtraSelectionManager.instance(textedit)
This ensures you get the same instance each time, and only one instance is created.
- highlight(text_format, cursors, priority=0, msec=0)[source]#
Highlight the selection of an arbitrary list of QTextCursors.
text_format
is a QTextCharFormat;priority
determines the order of drawing, highlighting with higher priority is drawn over highlighting with lower priority.msec
, if > 0, removes the highlighting after that many milliseconds.