1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsqueryresultwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsQueryResultWidget : QWidget
{
%Docstring(signature="appended")
A widget which allows users to enter and run an SQL query on a DB
connection (an instance of
:py:class:`QgsAbstractDatabaseProviderConnection`).
Query results are displayed in a table view. Query execution and result
fetching can be interrupted by pressing the "Stop" push button.
The widget supports a few QueryWidgetMode modes that pre-configure the
widget appearance to be used in different contexts like when updating
the SQL of an existing query layer.
.. note::
the ownership of the connection is transferred to the widget.
.. versionadded:: 3.22
%End
%TypeHeaderCode
#include "qgsqueryresultwidget.h"
%End
public:
enum class QueryWidgetMode
{
SqlQueryMode,
QueryLayerUpdateMode,
};
QgsQueryResultWidget( QWidget *parent = 0, QgsAbstractDatabaseProviderConnection *connection /Transfer/ = 0 );
%Docstring
Creates a QgsQueryResultWidget with the given ``connection``, ownership
is transferred to the widget.
%End
virtual ~QgsQueryResultWidget();
void setSqlVectorLayerOptions( const QgsAbstractDatabaseProviderConnection::SqlVectorLayerOptions &options );
%Docstring
Initializes the widget from ``options``.
%End
void setWidgetMode( QueryWidgetMode widgetMode );
%Docstring
Sets the widget mode to ``widgetMode``, default is SqlQueryMode.
%End
void setConnection( QgsAbstractDatabaseProviderConnection *connection /Transfer/ );
%Docstring
Sets the connection to ``connection``, ownership is transferred to the
widget.
%End
void setQuery( const QString &sql );
%Docstring
Convenience method to set the SQL editor text to ``sql``.
%End
public slots:
void notify( const QString &title, const QString &text, Qgis::MessageLevel level = Qgis::MessageLevel::Info );
%Docstring
Displays a message with ``text`` ``title`` and ``level`` in the widget's
message bar.
%End
void executeQuery();
%Docstring
Starts executing the query.
%End
void showError( const QString &title, const QString &message, bool isSqlError = false );
%Docstring
Hides the result table and shows the error ``title`` and ``message`` in
the message bar or in the SQL error panel is ``isSqlError`` is set.
%End
void tokensReady( const QStringList &tokens ) /Deprecated="Since 3.44. , has no effect"/;
%Docstring
Triggered when the threaded API fetcher has new ``tokens`` to add.
.. deprecated:: 3.44
, has no effect
%End
void copyResults();
%Docstring
Copies the query results to the clipboard, as a formatted table.
.. versionadded:: 3.32
%End
void copyResults( int fromRow, int toRow, int fromColumn, int toColumn );
%Docstring
Copies a range of the query results to the clipboard, as a formatted
table.
.. versionadded:: 3.32
%End
signals:
void createSqlVectorLayer( const QString &providerKey, const QString &connectionUri, const QgsAbstractDatabaseProviderConnection::SqlVectorLayerOptions &options );
%Docstring
Emitted when a new vector SQL (query) layer must be created.
:param providerKey: name of the data provider
:param connectionUri: the connection URI as returned by
:py:func:`QgsAbstractProviderConnection.uri()`
:param options:
%End
void firstResultBatchFetched();
%Docstring
Emitted when the first batch of results has been fetched.
.. note::
If the query returns no results this signal is not emitted.
%End
};
class QgsQueryResultDialog : QDialog
{
%Docstring(signature="appended")
A dialog which allows users to enter and run an SQL query on a DB
connection (an instance of
:py:class:`QgsAbstractDatabaseProviderConnection`).
.. note::
the ownership of the connection is transferred to the dialog.
.. seealso:: :py:class:`QgsQueryResultWidget`
.. versionadded:: 3.44
%End
%TypeHeaderCode
#include "qgsqueryresultwidget.h"
%End
public:
QgsQueryResultDialog( QgsAbstractDatabaseProviderConnection *connection /Transfer/ = 0, QWidget *parent = 0 );
%Docstring
Constructor for QgsQueryResultDialog.
Ownership of the ``connection`` is transferred to the dialog.
%End
QgsQueryResultWidget *resultWidget();
%Docstring
Returns the :py:class:`QgsQueryResultWidget` shown in the dialog.
%End
virtual void closeEvent( QCloseEvent *event );
};
class QgsQueryResultMainWindow : QMainWindow
{
%Docstring(signature="appended")
A main window which allows users to enter and run an SQL query on a DB
connection (an instance of
:py:class:`QgsAbstractDatabaseProviderConnection`).
.. note::
the ownership of the connection is transferred to the window.
.. seealso:: :py:class:`QgsQueryResultWidget`
.. versionadded:: 3.44
%End
%TypeHeaderCode
#include "qgsqueryresultwidget.h"
%End
public:
QgsQueryResultMainWindow( QgsAbstractDatabaseProviderConnection *connection /Transfer/ = 0, const QString &identifierName = QString() );
%Docstring
Constructor for QgsQueryResultMainWindow.
Ownership of the ``connection`` is transferred to the window.
%End
QgsQueryResultWidget *resultWidget();
%Docstring
Returns the :py:class:`QgsQueryResultWidget` shown in the window.
%End
virtual void closeEvent( QCloseEvent *event );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsqueryresultwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|