16 #ifndef QGSPROCESSINGMULTIPLESELECTIONDIALOG_H 17 #define QGSPROCESSINGMULTIPLESELECTIONDIALOG_H 21 #include "ui_qgsprocessingmultipleselectiondialogbase.h" 25 class QStandardItemModel;
37 class GUI_EXPORT QgsProcessingMultipleSelectionDialog :
public QDialog,
private Ui::QgsProcessingMultipleSelectionDialogBase
52 QgsProcessingMultipleSelectionDialog(
const QVariantList &availableOptions = QVariantList(),
53 const QVariantList &selectedOptions = QVariantList(),
54 QWidget *parent
SIP_TRANSFERTHIS =
nullptr, Qt::WindowFlags flags =
nullptr );
61 void setValueFormatter(
const std::function< QString(
const QVariant & )> &formatter );
63 void setValueFormatter( SIP_PYCALLABLE );
66 Py_BEGIN_ALLOW_THREADS
68 sipCpp->setValueFormatter( [a0](
const QVariant &v )->QString
72 PyObject *s = sipCallMethod( NULL, a0,
"D", &v, sipType_QVariant, NULL );
75 QString *t1 =
reinterpret_cast<QString *
>( sipConvertToType( s, sipType_QString, 0, SIP_NOT_NONE, &state, &sipIsError ) );
76 if ( sipIsError == 0 )
80 sipReleaseType( t1, sipType_QString, state );
93 QVariantList selectedOptions()
const;
97 void selectAll(
bool checked );
98 void toggleSelection();
101 std::function< QString( const QVariant & )> mValueFormatter;
103 QPushButton *mButtonSelectAll =
nullptr;
104 QPushButton *mButtonClearSelection =
nullptr;
105 QPushButton *mButtonToggleSelection =
nullptr;
106 QStandardItemModel *mModel =
nullptr;
108 QList< QStandardItem * > currentItems();
110 void populateList(
const QVariantList &availableOptions,
const QVariantList &selectedOptions );
112 friend class TestProcessingGui;
117 #endif // QGSPROCESSINGMULTIPLESELECTIONDIALOG_H