mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-09 00:08:52 -04:00
Adds drop support for layers in the multiple layer selection widgets to more efficiently select the desired elements. Especially useful in big project of with duplicated layer names.
276 lines
7.6 KiB
Plaintext
276 lines
7.6 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/processing/qgsprocessingmultipleselectiondialog.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
class QgsProcessingMultipleSelectionPanelWidget : QgsPanelWidget
|
|
{
|
|
%Docstring(signature="appended")
|
|
A panel widget for selection of multiple options from a fixed list of options.
|
|
|
|
.. note::
|
|
|
|
Not stable API
|
|
|
|
.. versionadded:: 3.14
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsprocessingmultipleselectiondialog.h"
|
|
%End
|
|
public:
|
|
|
|
QgsProcessingMultipleSelectionPanelWidget( const QVariantList &availableOptions = QVariantList(),
|
|
const QVariantList &selectedOptions = QVariantList(),
|
|
QWidget *parent /TransferThis/ = 0 );
|
|
%Docstring
|
|
Constructor for QgsProcessingMultipleSelectionPanelWidget.
|
|
|
|
The ``availableOptions`` list specifies the list of standard known options for the parameter,
|
|
whilst the ``selectedOptions`` list specifies which options should be initially selected.
|
|
|
|
The ``selectedOptions`` list may contain extra options which are not present in ``availableOptions``,
|
|
in which case they will be also added as existing options within the dialog.
|
|
%End
|
|
|
|
void setValueFormatter( SIP_PYCALLABLE );
|
|
%Docstring
|
|
Sets a callback function to use when encountering an invalid geometry and
|
|
%End
|
|
%MethodCode
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
sipCpp->setValueFormatter( [a0]( const QVariant &v )->QString
|
|
{
|
|
QString res;
|
|
SIP_BLOCK_THREADS
|
|
PyObject *s = sipCallMethod( NULL, a0, "D", &v, sipType_QVariant, NULL );
|
|
int state;
|
|
int sipIsError = 0;
|
|
QString *t1 = reinterpret_cast<QString *>( sipConvertToType( s, sipType_QString, 0, SIP_NOT_NONE, &state, &sipIsError ) );
|
|
if ( sipIsError == 0 )
|
|
{
|
|
res = QString( *t1 );
|
|
}
|
|
sipReleaseType( t1, sipType_QString, state );
|
|
SIP_UNBLOCK_THREADS
|
|
return res;
|
|
} );
|
|
|
|
Py_END_ALLOW_THREADS
|
|
%End
|
|
|
|
|
|
QVariantList selectedOptions() const;
|
|
%Docstring
|
|
Returns the ordered list of selected options.
|
|
%End
|
|
|
|
QDialogButtonBox *buttonBox();
|
|
%Docstring
|
|
Returns the widget's button box.
|
|
%End
|
|
|
|
signals:
|
|
|
|
void acceptClicked();
|
|
%Docstring
|
|
Emitted when the accept button is clicked.
|
|
%End
|
|
|
|
void selectionChanged();
|
|
%Docstring
|
|
Emitted when the selection changes in the widget.
|
|
%End
|
|
|
|
protected:
|
|
|
|
void addOption( const QVariant &value, const QString &title, bool selected, bool updateExistingTitle = false );
|
|
%Docstring
|
|
Adds a new option to the widget.
|
|
%End
|
|
|
|
QListView *listView() const;
|
|
%Docstring
|
|
Returns pointer to the list view
|
|
%End
|
|
|
|
|
|
virtual void dragEnterEvent( QDragEnterEvent *event );
|
|
|
|
%Docstring
|
|
Value formatter
|
|
%End
|
|
virtual void dropEvent( QDropEvent *event );
|
|
|
|
|
|
};
|
|
|
|
|
|
class QgsProcessingMultipleSelectionDialog : QDialog
|
|
{
|
|
%Docstring(signature="appended")
|
|
A dialog for selection of multiple options from a fixed list of options.
|
|
|
|
.. note::
|
|
|
|
Not stable API
|
|
|
|
.. versionadded:: 3.6
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsprocessingmultipleselectiondialog.h"
|
|
%End
|
|
public:
|
|
|
|
QgsProcessingMultipleSelectionDialog( const QVariantList &availableOptions = QVariantList(),
|
|
const QVariantList &selectedOptions = QVariantList(),
|
|
QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = Qt::WindowFlags() );
|
|
%Docstring
|
|
Constructor for :py:class:`QgsProcessingMultipleSelectionPanelWidget`.
|
|
|
|
The ``availableOptions`` list specifies the list of standard known options for the parameter,
|
|
whilst the ``selectedOptions`` list specifies which options should be initially selected.
|
|
|
|
The ``selectedOptions`` list may contain extra options which are not present in ``availableOptions``,
|
|
in which case they will be also added as existing options within the dialog.
|
|
%End
|
|
|
|
|
|
void setValueFormatter( SIP_PYCALLABLE );
|
|
%Docstring
|
|
Sets a callback function to use when encountering an invalid geometry and
|
|
%End
|
|
%MethodCode
|
|
|
|
Py_BEGIN_ALLOW_THREADS
|
|
|
|
sipCpp->setValueFormatter( [a0]( const QVariant &v )->QString
|
|
{
|
|
QString res;
|
|
SIP_BLOCK_THREADS
|
|
PyObject *s = sipCallMethod( NULL, a0, "D", &v, sipType_QVariant, NULL );
|
|
int state;
|
|
int sipIsError = 0;
|
|
QString *t1 = reinterpret_cast<QString *>( sipConvertToType( s, sipType_QString, 0, SIP_NOT_NONE, &state, &sipIsError ) );
|
|
if ( sipIsError == 0 )
|
|
{
|
|
res = QString( *t1 );
|
|
}
|
|
sipReleaseType( t1, sipType_QString, state );
|
|
SIP_UNBLOCK_THREADS
|
|
return res;
|
|
} );
|
|
|
|
Py_END_ALLOW_THREADS
|
|
%End
|
|
|
|
|
|
QVariantList selectedOptions() const;
|
|
%Docstring
|
|
Returns the ordered list of selected options.
|
|
%End
|
|
|
|
};
|
|
|
|
|
|
class QgsProcessingMultipleInputPanelWidget : QgsProcessingMultipleSelectionPanelWidget
|
|
{
|
|
%Docstring(signature="appended")
|
|
A panel widget for selection of multiple inputs from a fixed list of options.
|
|
|
|
.. note::
|
|
|
|
Not stable API
|
|
|
|
.. versionadded:: 3.14
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsprocessingmultipleselectiondialog.h"
|
|
%End
|
|
public:
|
|
|
|
QgsProcessingMultipleInputPanelWidget( const QgsProcessingParameterMultipleLayers *parameter,
|
|
const QVariantList &selectedOptions,
|
|
const QList< QgsProcessingModelChildParameterSource > &modelSources,
|
|
QgsProcessingModelAlgorithm *model = 0,
|
|
QWidget *parent /TransferThis/ = 0 );
|
|
%Docstring
|
|
Constructor for QgsProcessingMultipleInputPanelWidget.
|
|
%End
|
|
|
|
void setProject( QgsProject *project );
|
|
%Docstring
|
|
Sets the project associated with the widget.
|
|
%End
|
|
|
|
protected:
|
|
virtual void dragEnterEvent( QDragEnterEvent *event );
|
|
|
|
virtual void dropEvent( QDropEvent *event );
|
|
|
|
|
|
};
|
|
|
|
|
|
class QgsProcessingMultipleInputDialog : QDialog
|
|
{
|
|
%Docstring(signature="appended")
|
|
A dialog for selection of multiple layer inputs.
|
|
|
|
.. note::
|
|
|
|
Not stable API
|
|
|
|
.. versionadded:: 3.14
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsprocessingmultipleselectiondialog.h"
|
|
%End
|
|
public:
|
|
|
|
QgsProcessingMultipleInputDialog( const QgsProcessingParameterMultipleLayers *parameter,
|
|
const QVariantList &selectedOptions,
|
|
const QList< QgsProcessingModelChildParameterSource > &modelSources,
|
|
QgsProcessingModelAlgorithm *model = 0,
|
|
QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = Qt::WindowFlags() );
|
|
%Docstring
|
|
Constructor for QgsProcessingMultipleInputDialog.
|
|
|
|
The ``selectedOptions`` list may contain extra options which are not present in ``availableOptions``,
|
|
in which case they will be also added as existing options within the dialog.
|
|
%End
|
|
|
|
QVariantList selectedOptions() const;
|
|
%Docstring
|
|
Returns the ordered list of selected options.
|
|
%End
|
|
|
|
void setProject( QgsProject *project );
|
|
%Docstring
|
|
Sets the project associated with the dialog.
|
|
%End
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/processing/qgsprocessingmultipleselectiondialog.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|