Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[processing] Port map layer selection combobox widget to c++
And: - fix enable state of selected features only after changing between map layers with/without selections - fix state of selected features only when running an algorithm from the history list, e.g. respect original setting for selected features only (or not) - ensure no duplicate changed signals are sent, and correctly emit changed signals in all applicable circumstances - handle drag and dropped layers from browser panel (UX fix) - soak with unit tests
- Loading branch information
1 parent
9d82273
commit fbd243b
Showing
10 changed files
with
1,110 additions
and
234 deletions.
There are no files selected for viewing
111 changes: 111 additions & 0 deletions
111
python/gui/auto_generated/processing/qgsprocessingmaplayercombobox.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/processing/qgsprocessingmaplayercombobox.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
class QgsProcessingMapLayerComboBox : QWidget | ||
{ | ||
%Docstring | ||
Processing map layer combo box. | ||
|
||
.. warning:: | ||
|
||
Not part of stable API and may change in future QGIS releases. | ||
|
||
.. versionadded:: 3.8 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsprocessingmaplayercombobox.h" | ||
%End | ||
public: | ||
|
||
QgsProcessingMapLayerComboBox( QgsProcessingParameterDefinition *parameter, QWidget *parent = 0 ); | ||
%Docstring | ||
Constructor for QgsProcessingMapLayerComboBox, with the specified ``parameter`` definition. | ||
%End | ||
|
||
void setLayer( QgsMapLayer *layer ); | ||
%Docstring | ||
Sets the combo box to the specified ``layer``, if ``layer`` is compatible with the | ||
widget's parameter definition. | ||
%End | ||
|
||
QgsMapLayer *currentLayer(); | ||
%Docstring | ||
Returns the current layer selected in the combobox, or ``None`` if the selection cannot | ||
be represented as a map layer. | ||
|
||
.. warning:: | ||
|
||
Prefer calling value() instead, as it correctly encapsulates all valid | ||
values which can be represented by the widget. | ||
|
||
.. seealso:: :py:func:`currentText` | ||
%End | ||
|
||
QString currentText(); | ||
%Docstring | ||
Returns the current text of the selected item in the combobox. | ||
|
||
.. warning:: | ||
|
||
Prefer calling value() instead, as it correctly encapsulates all valid | ||
values which can be represented by the widget. | ||
|
||
.. seealso:: :py:func:`currentLayer` | ||
%End | ||
|
||
void setValue( const QVariant &value, QgsProcessingContext &context ); | ||
%Docstring | ||
Sets the ``value`` shown in the widget. | ||
|
||
.. seealso:: :py:func:`value` | ||
%End | ||
|
||
QVariant value() const; | ||
%Docstring | ||
Returns the current value of the widget. | ||
|
||
.. seealso:: :py:func:`setValue` | ||
%End | ||
|
||
signals: | ||
|
||
void valueChanged(); | ||
%Docstring | ||
Emitted whenever the value is changed in the widget. | ||
%End | ||
|
||
void triggerFileSelection(); | ||
%Docstring | ||
Emitted when the widget has triggered a file selection operation (to be | ||
handled in Python for now). | ||
%End | ||
|
||
protected: | ||
|
||
virtual void dragEnterEvent( QDragEnterEvent *event ); | ||
|
||
virtual void dragLeaveEvent( QDragLeaveEvent *event ); | ||
|
||
virtual void dropEvent( QDropEvent *event ); | ||
|
||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/processing/qgsprocessingmaplayercombobox.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.