22 #include <QMessageBox>    33   mCondCombo->addItem( tr( 
"has the tag" ), QVariant( 
"tag" ) );
    34   mCondCombo->addItem( tr( 
"has a part of name matching" ), QVariant( 
"name" ) );
    35   mCondCombo->addItem( tr( 
"does NOT have the tag" ), QVariant( 
"!tag" ) );
    36   mCondCombo->addItem( tr( 
"has NO part of name matching" ), QVariant( 
"!name" ) );
    50   return mCondCombo->currentData().toString();
    55   return mCondLineEdit->text();
    60   mCondCombo->setCurrentIndex( mCondCombo->findData( QVariant( constraint ) ) );
    65   mCondLineEdit->setText( param );
    70   mRemoveBtn->setVisible( !hide );
    82   connect( buttonBox, &QDialogButtonBox::accepted, 
this, &QgsSmartGroupEditorDialog::buttonBox_accepted );
    86   mAndOrCombo->addItem( tr( 
"ALL the constraints" ), QVariant( 
"AND" ) );
    87   mAndOrCombo->addItem( tr( 
"any ONE of the constraints" ), QVariant( 
"OR" ) );
    89   mLayout = 
new QGridLayout( mConditionsBox );
    97   return mNameLineEdit->text();
   151   return mAndOrCombo->currentData().toString();
   156   QStringList constraints;
   157   constraints << QStringLiteral( 
"tag" ) << QStringLiteral( 
"name" ) << QStringLiteral( 
"!tag" ) << QStringLiteral( 
"!name" );
   164   Q_FOREACH ( 
const QString &constr, constraints )
   166     QStringList params = map.values( constr );
   167     Q_FOREACH ( 
const QString ¶m, params )
   185   mAndOrCombo->setCurrentIndex( mAndOrCombo->findData( QVariant( op ) ) );
   190   mNameLineEdit->setText( name );
   193 void QgsSmartGroupEditorDialog::buttonBox_accepted()
   195   if ( mNameLineEdit->text().isEmpty() )
   197     QMessageBox::critical( 
this, tr( 
"Edit Smart Group" ), tr( 
"The smart group name field is empty. Kindly provide a name." ) );
 void setParameter(const QString ¶m)
sets the given param 
 
QMap< int, QgsSmartGroupCondition * > mConditionMap
 
QgsSmartGroupEditorDialog(QgsStyle *style, QWidget *parent=nullptr)
 
QgsSmartConditionMap conditionMap()
returns the condition map 
 
static QString iconPath(const QString &iconFile)
Returns path to the desired icon file. 
 
void hideRemoveButton(bool hide)
sets the remove button hidden state to 'hide' 
 
void addCondition()
function to create a new ConditionBox and update UI 
 
QString smartgroupName()
returns the value from mNameLineEdit 
 
QString parameter()
returns the parameter 
 
QString constraint()
returns the constraint key 
 
void removeCondition(int)
slot to remove the condition with id int 
 
void setOperator(const QString &)
sets the operator AND/OR 
 
void setConstraint(const QString &constraint)
sets the given constraint 
 
void setSmartgroupName(const QString &)
sets the smart group Name 
 
QgsSmartGroupCondition(int id, QWidget *parent=nullptr)
 
void setConditionMap(const QgsSmartConditionMap &)
sets up the GUI for the given conditionmap 
 
QMultiMap< QString, QString > QgsSmartConditionMap
A multimap to hold the smart group conditions as constraint and parameter pairs. 
 
QString conditionOperator()
returns the AND/OR condition