This package contains the core panels
Bases: pyqode.core.api.panel.Panel
Shows messages collected by one or more checker modes
Hide tooltip when leaving the panel region.
Returns the marker that is displayed at the specified line number if any.
Parameters: | line – The marker line. |
---|---|
Returns: | Marker of None |
Return type: | pyqode.core.Marker |
Returns the panel size hint. (fixed with of 16px)
Error icon
Info icon
Warning icon
Bases: pyqode.core.api.panel.Panel
Displays a warning when an encoding error occured and let you reload.
This panel display a warning in case encoding/decoding error and give the user the possibility to try out another encoding, to edit any way or to close the editor.
The panel is automatically shown by pyqode.core.managers.FileManager in case of error so that you don’t have to worry about encoding issues. The only think you might do is to provide to your user a way to specify the default encoding, i.e. the one that is tried before showing this panel.
The panel is a simple widget with a label describing the error, an encoding menu and 3 buttons: Retry, Edit anyway and Cancel. It is strongly inspired by the GEdit encoding panel.
You can change the background color and the label foreground color by setting up the color and foreground properties.
It’s up to the client code to handle cancel requests. To do that simply connect cancel_requested signal to remove the editor from your application.
Fills the panel background.
Signal emitted when the user pressed on cancel. It is up to the client code to handle this event.
Returns the panel color.
Bases: pyqode.core.api.panel.Panel
Displays the document outline and lets the user collapse/expand blocks.
The data represented by the panel come from the text block user state and is set by the SyntaxHighlighter mode.
The panel does not expose any function that you can use directly. To interact with the fold tree, you need to modify text block fold level or trigger state using pyqode.core.api.utils.TextBlockHelper or pyqode.core.api.folding
Collapses all triggers and makes all blocks with fold level > 0 invisible.
Expands all fold triggers.
Find parent scope, if the block is not a fold trigger.
Gets a system color for drawing the fold scope background.
Removes scope decorations and background from the editor and the panel if highlight_caret_scope, else simply update the scope decorations to match the caret scope.
Detect mouser over indicator and highlight the current scope in the editor (up and down decoration arround the foldable text when the mouse is over an indicator).
Parameters: | event – event |
---|
Folds/unfolds the pressed indicator if any.
Add the folding menu to the editor, on install.
Parameters: | editor – editor instance on which the mode has been installed to. |
---|
On state changed we (dis)connect to the cursorPositionChanged signal
Refresh decorations colors. This function is called by the syntax highlighter when the style changed so that we may update our decorations colors according to the new style.
Returns the widget size hint (based on the editor font size)
Toggle a fold trigger block (expand or collapse it).
Parameters: | block – The QTextBlock to expand/collapse |
---|
Custom base color for the fold region background
Returns: | QColor |
---|
Gets/sets the custom icon for the fold indicators.
The list of indicators is interpreted as follow:
(COLLAPSED_OFF, COLLAPSED_ON, EXPANDED_OFF, EXPANDED_ON)
To use this property you must first set native_look to False.
Returns: | tuple(str, str, str, str) |
---|
True to highlight the caret scope automatically.
(Similar to the Highlight blocks in Qt Creator.
Default is False.
Defines whether the panel will use native indicator icons and color or use custom one.
If you want to use custom indicator icons and color, you must first set this flag to False.
signal emitted when a fold trigger state has changed, parameters are the concerned text block and the new state (collapsed or not).
Bases: pyqode.core.api.panel.Panel
Displays the document line numbers.
Cancels line selection.
Computes the lineNumber area width depending on the number of lines in the document
Returns: | Widtg |
---|
Starts selecting
Returns the panel size hint (as the panel is on the left, we only need to compute the width
Bases: PyQt5.QtCore.QObject
A marker is an icon draw on a marker panel at a specific line position and with a possible tooltip.
Gets the marker description.
Gets the icon file name. Read-only.
Gets the marker position (line number) :type: int
Bases: pyqode.core.api.panel.Panel
General purpose marker panel. This panels takes care of drawing icons at a specific line number.
Use addMarker, removeMarker and clearMarkers to manage the collection of displayed makers.
You can create a user editable panel (e.g. a breakpoints panel) by using the following signals:
Adds the marker to the panel.
Parameters: | marker (pyqode.core.modes.Marker) – Marker to add |
---|
Clears the markers list
Hide tooltip when leaving the panel region.
Returns the marker that is displayed at the specified line number if any.
Parameters: | line – The marker line. |
---|---|
Returns: | Marker of None |
Return type: | pyqode.core.Marker |
Removes a marker from the panel
Parameters: | marker (pyqode.core.Marker) – Marker to remove |
---|
Returns the panel size hint. (fixed with of 16px)
Signal emitted when the user clicked in a place where there is no marker.
Decorator. Caches a function’s return value each time it is called. If called later with the same arguments, the cached value is returned (not reevaluated).
Signal emitted when the user clicked on an existing marker.
Bases: pyqode.core.api.panel.Panel, pyqode.core._forms.search_panel_ui.Ui_SearchPanel
Lets the user search and replace text in the current document.
It uses the backend API to search for some text. Search operation is performed in a background process (the backend process)..
The search panel can also be used programatically. To do that, the client code must first requests a search using requestSearch() and connects to search_finished. The results of the search can then be retrieved using cpt_occurences and get_oOccurrences(). The client code may now navigate through occurrences using select_next() or select_previous(), or replace the occurrences with a specific text using replace() or replace_all().
Closes the panel
Returns the list of text occurrences.
An occurrence is a tuple that contains start and end positions.
Returns: | List of tuple(int, int) |
---|
Replaces the selected occurrence.
Parameters: | text – The replacement text. If it is None, the lineEditReplace’s text is used instead. |
---|
Replaces all occurrences in the editor’s document.
Parameters: | text – The replacement text. If None, the content of the lineEdit replace will be used instead |
---|
Requests a search operation.
Parameters: | txt – The text to replace. If None, the content of lineEditSearch is used instead. |
---|
Selects the next occurrence.
Returns: | True in case of success, false if no occurrence could be selected. |
---|
Selects previous occurrence.
Returns: | True in case of success, false if no occurrence could be selected. |
---|
Text decoration background
Occurrences counter
Text decoration foreground
Signal emitted when a search operation finished
Bases: pyqode.core.api.panel.Panel
Displays all checker messages found in the document.
The user can click on a marker to quickly go the the error line.
Gets the height of message marker.
Gets the size of a message marker. :return: QSize
Pains the messages and the visible area on the panel. :param event: paint event infos
The panel has a fixed width of 8 pixels.