29 mMenu =
new QMenu(
this );
30 mSetExpressionAction =
new QAction(
tr(
"Edit filter expression" ), mMenu );
31 connect( mSetExpressionAction, SIGNAL(
triggered(
bool ) ),
this, SLOT( onSetLegendFilterExpression() ) );
33 mClearExpressionAction =
new QAction(
tr(
"Clear filter expression" ), mMenu );
34 connect( mClearExpressionAction, SIGNAL(
triggered(
bool ) ),
this, SLOT( onClearFilterExpression() ) );
38 mMenu->
addAction( mClearExpressionAction );
46 connect(
this, SIGNAL(
toggled(
bool ) ),
this, SLOT( onToggle(
bool ) ) );
53 void QgsLegendFilterButton::onToggle(
bool checked )
59 onSetLegendFilterExpression();
64 void QgsLegendFilterButton::onSetLegendFilterExpression()
71 bool emitSignal =
false;
87 void QgsLegendFilterButton::onClearFilterExpression()
95 void QgsLegendFilterButton::updateMenu()
100 mSetExpressionAction->
setText(
QString(
tr(
"Edit filter expression (current: %1)" ) ).arg( mExpression ) );
105 mSetExpressionAction->
setText(
tr(
"Edit filter expression" ) );
116 mExpression = expression;
void setText(const QString &text)
static QIcon getThemeIcon(const QString &theName)
Helper to get a theme icon.
QString tr(const char *sourceText, const char *disambiguation, int n)
bool blockSignals(bool block)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Represents a vector layer which manages a vector based data sets.
A generic dialog for building expression strings.