16#ifndef QGSPROCESSINGMULTIPLESELECTIONDIALOG_H 
   17#define QGSPROCESSINGMULTIPLESELECTIONDIALOG_H 
   21#include "ui_qgsprocessingmultipleselectiondialogbase.h" 
   25class QStandardItemModel;
 
   28class QgsProcessingModelChildParameterSource;
 
   29class QgsProcessingModelAlgorithm;
 
   39class GUI_EXPORT QgsProcessingMultipleSelectionPanelWidget : 
public QgsPanelWidget, 
private Ui::QgsProcessingMultipleSelectionDialogBase
 
   54    QgsProcessingMultipleSelectionPanelWidget( 
const QVariantList &availableOptions = QVariantList(),
 
   55        const QVariantList &selectedOptions = QVariantList(),
 
   62    void setValueFormatter( 
const std::function< QString( 
const QVariant & )> &
formatter );
 
   64    void setValueFormatter( SIP_PYCALLABLE );
 
   67    Py_BEGIN_ALLOW_THREADS
 
   69    sipCpp->setValueFormatter( [a0]( 
const QVariant &v )->QString
 
   73      PyObject *s = sipCallMethod( NULL, a0, 
"D", &v, sipType_QVariant, NULL );
 
   76      QString *t1 = 
reinterpret_cast<QString *
>( sipConvertToType( s, sipType_QString, 0, SIP_NOT_NONE, &state, &sipIsError ) );
 
   77      if ( sipIsError == 0 )
 
   81      sipReleaseType( t1, sipType_QString, state );
 
   94    QVariantList selectedOptions() 
const;
 
   99    QDialogButtonBox *buttonBox() { 
return mButtonBox; }
 
  106    void acceptClicked();
 
  111    void selectionChanged();
 
  118    void addOption( 
const QVariant &value, 
const QString &title, 
bool selected, 
bool updateExistingTitle = 
false );
 
  121    QListView *listView()
 const { 
return mSelectionList; }
 
  124    QStandardItemModel *mModel = 
nullptr;
 
  126    std::function< QString( 
const QVariant & )> mValueFormatter;
 
  128    void dragEnterEvent( QDragEnterEvent *event ) 
override;
 
  129    void dropEvent( QDropEvent *event ) 
override;
 
  133    void selectAll( 
bool checked );
 
  134    void toggleSelection();
 
  138    QPushButton *mButtonSelectAll = 
nullptr;
 
  139    QPushButton *mButtonClearSelection = 
nullptr;
 
  140    QPushButton *mButtonToggleSelection = 
nullptr;
 
  142    QList< QStandardItem * > currentItems();
 
  144    void populateList( 
const QVariantList &availableOptions, 
const QVariantList &selectedOptions );
 
  146    friend class TestProcessingGui;
 
  152    QList<int> existingMapLayerFromMimeData( 
const QMimeData *data ) 
const;
 
  162class GUI_EXPORT QgsProcessingMultipleSelectionDialog : 
public QDialog
 
  177    QgsProcessingMultipleSelectionDialog( 
const QVariantList &availableOptions = QVariantList(),
 
  178                                          const QVariantList &selectedOptions = QVariantList(),
 
  179                                          QWidget *parent 
SIP_TRANSFERTHIS = 
nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );
 
  186    void setValueFormatter( 
const std::function< QString( 
const QVariant & )> &
formatter );
 
  188    void setValueFormatter( SIP_PYCALLABLE );
 
  191    Py_BEGIN_ALLOW_THREADS
 
  193    sipCpp->setValueFormatter( [a0]( 
const QVariant &v )->QString
 
  197      PyObject *s = sipCallMethod( NULL, a0, 
"D", &v, sipType_QVariant, NULL );
 
  200      QString *t1 = 
reinterpret_cast<QString *
>( sipConvertToType( s, sipType_QString, 0, SIP_NOT_NONE, &state, &sipIsError ) );
 
  201      if ( sipIsError == 0 )
 
  203        res = QString( *t1 );
 
  205      sipReleaseType( t1, sipType_QString, state );
 
  218    QVariantList selectedOptions() 
const;
 
  222    QgsProcessingMultipleSelectionPanelWidget *mWidget = 
nullptr;
 
  233class GUI_EXPORT QgsProcessingMultipleInputPanelWidget : 
public QgsProcessingMultipleSelectionPanelWidget
 
  243                                           const QVariantList &selectedOptions,
 
  244                                           const QList< QgsProcessingModelChildParameterSource > &modelSources,
 
  245                                           QgsProcessingModelAlgorithm *model = 
nullptr,
 
  259    void dragEnterEvent( QDragEnterEvent *event ) 
override;
 
  260    void dropEvent( QDropEvent *event ) 
override;
 
  268    QList<int> existingMapLayerFromMimeData( 
const QMimeData *data ) 
const;
 
  269    void populateFromProject( 
QgsProject *project );
 
  281class GUI_EXPORT QgsProcessingMultipleInputDialog : 
public QDialog
 
  294                                      const QVariantList &selectedOptions,
 
  295                                      const QList< QgsProcessingModelChildParameterSource > &modelSources,
 
  296                                      QgsProcessingModelAlgorithm *model = 
nullptr,
 
  297                                      QWidget *parent 
SIP_TRANSFERTHIS = 
nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );
 
  302    QVariantList selectedOptions() 
const;
 
  311    QgsProcessingMultipleInputPanelWidget *mWidget = 
nullptr;
 
A parameter for processing algorithms which accepts multiple map layers.
 
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...