mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-10 00:04:23 -04:00
This allows the editor to be opened in a proper detached process, avoiding the editor being closed when QGIS is exited. Move to a blocklist for terminal text editors instead of the fragile polling approach (which eg doesn't work if the editor is set to pycharm)
193 lines
5.3 KiB
Plaintext
193 lines
5.3 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/codeeditors/qgscodeeditorwidget.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
class QgsCodeEditorWidget : QgsPanelWidget
|
|
{
|
|
%Docstring(signature="appended")
|
|
A widget which wraps a :py:class:`QgsCodeEditor` in additional functionality.
|
|
|
|
This widget wraps an existing :py:class:`QgsCodeEditor` object in a widget which provides
|
|
additional standard functionality, such as search/replace tools. The caller
|
|
must create an unparented :py:class:`QgsCodeEditor` object (or a subclass of :py:class:`QgsCodeEditor`)
|
|
first, and then construct a :py:class:`QgsCodeEditorWidget` passing this object to the
|
|
constructor.
|
|
|
|
.. note::
|
|
|
|
may not be available in Python bindings, depending on platform support
|
|
|
|
.. versionadded:: 3.38
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgscodeeditorwidget.h"
|
|
%End
|
|
public:
|
|
|
|
QgsCodeEditorWidget( QgsCodeEditor *editor /Transfer/,
|
|
QgsMessageBar *messageBar = 0,
|
|
QWidget *parent /TransferThis/ = 0 );
|
|
%Docstring
|
|
Constructor for QgsCodeEditorWidget, wrapping the specified ``editor`` widget.
|
|
|
|
Ownership of ``editor`` will be transferred to this widget.
|
|
|
|
If an explicit ``messageBar`` is specified then it will be used to provide
|
|
feedback, otherwise an integrated message bar will be used.
|
|
%End
|
|
~QgsCodeEditorWidget();
|
|
|
|
virtual void resizeEvent( QResizeEvent *event );
|
|
|
|
virtual void showEvent( QShowEvent *event );
|
|
|
|
|
|
QgsCodeEditor *editor();
|
|
%Docstring
|
|
Returns the wrapped code editor.
|
|
%End
|
|
|
|
bool isSearchBarVisible() const;
|
|
%Docstring
|
|
Returns ``True`` if the search bar is visible.
|
|
%End
|
|
|
|
QgsMessageBar *messageBar();
|
|
%Docstring
|
|
Returns the message bar associated with the widget, to use for user feedback.
|
|
%End
|
|
|
|
QgsScrollBarHighlightController *scrollbarHighlightController();
|
|
%Docstring
|
|
Returns the scrollbar highlight controller, which can be used to add highlights
|
|
in the code editor scrollbar.
|
|
%End
|
|
|
|
void addWarning( int lineNumber, const QString &warning );
|
|
%Docstring
|
|
Adds a ``warning`` message and indicator to the specified a ``lineNumber``.
|
|
|
|
This method calls :py:func:`QgsCodeEditor.addWarning()`, but also automatically adds
|
|
highlights to the widget scrollbars locating the warning location.
|
|
|
|
.. seealso:: :py:func:`clearWarnings`
|
|
%End
|
|
|
|
void clearWarnings();
|
|
%Docstring
|
|
Clears all warning messages from the editor.
|
|
|
|
This method calls :py:func:`QgsCodeEditor.clearWarnings()`, but also removes
|
|
highlights from the widget scrollbars at the warning locations.
|
|
|
|
.. seealso:: :py:func:`addWarning`
|
|
%End
|
|
|
|
QString filePath() const;
|
|
%Docstring
|
|
Returns the widget's associated file path.
|
|
|
|
.. seealso:: :py:func:`setFilePath`
|
|
|
|
.. seealso:: :py:func:`filePathChanged`
|
|
%End
|
|
|
|
public slots:
|
|
|
|
void showSearchBar();
|
|
%Docstring
|
|
Shows the search bar.
|
|
|
|
.. seealso:: :py:func:`hideSearchBar`
|
|
|
|
.. seealso:: :py:func:`setSearchBarVisible`
|
|
%End
|
|
|
|
void hideSearchBar();
|
|
%Docstring
|
|
Hides the search bar.
|
|
|
|
.. seealso:: :py:func:`showSearchBar`
|
|
|
|
.. seealso:: :py:func:`setSearchBarVisible`
|
|
%End
|
|
|
|
void setSearchBarVisible( bool visible );
|
|
%Docstring
|
|
Sets whether the search bar is ``visible``.
|
|
|
|
.. seealso:: :py:func:`showSearchBar`
|
|
|
|
.. seealso:: :py:func:`hideSearchBar`
|
|
|
|
.. seealso:: :py:func:`setReplaceBarVisible`
|
|
%End
|
|
|
|
void setReplaceBarVisible( bool visible );
|
|
%Docstring
|
|
Sets whether the replace bar is ``visible``.
|
|
|
|
.. seealso:: :py:func:`setSearchBarVisible`
|
|
%End
|
|
|
|
void triggerFind();
|
|
%Docstring
|
|
Triggers a find operation, using the default behavior.
|
|
|
|
This will automatically open the search bar and start a find operation using
|
|
the default behavior, e.g. searching for any selected text in the code editor.
|
|
%End
|
|
|
|
void setFilePath( const QString &path );
|
|
%Docstring
|
|
Sets the widget's associated file ``path``.
|
|
|
|
.. seealso:: :py:func:`filePathChanged`
|
|
|
|
.. seealso:: :py:func:`filePath`
|
|
%End
|
|
|
|
bool openInExternalEditor();
|
|
%Docstring
|
|
Attempts to opens the script from the editor in an external text editor.
|
|
|
|
This requires that the widget has an associated :py:func:`~QgsCodeEditorWidget.filePath` set.
|
|
|
|
:return: ``True`` if the file was opened successfully.
|
|
%End
|
|
|
|
signals:
|
|
|
|
void searchBarToggled( bool visible );
|
|
%Docstring
|
|
Emitted when the visibility of the search bar is changed.
|
|
%End
|
|
|
|
void filePathChanged( const QString &path );
|
|
%Docstring
|
|
Emitted when the widget's associated file path is changed.
|
|
|
|
.. seealso:: :py:func:`setFilePath`
|
|
|
|
.. seealso:: :py:func:`filePath`
|
|
%End
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/codeeditors/qgscodeeditorwidget.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|