30 mMenu =
new QMenu(
this );
31 connect( mMenu, SIGNAL( aboutToShow() ),
this, SLOT( aboutToShowMenu() ) );
40 mFilterFlags &= flags;
41 mAvailableFilterFlags = flags;
42 mDefaultFilterFlags = mDefaultFilterFlags & flags;
48 mDefaultFilterFlags = flags & mAvailableFilterFlags;
54 QgsSearchWidgetWrapper::FilterFlags newFlags;
59 if ( !( mAvailableFilterFlags & flag ) )
73 if ( !( mAvailableFilterFlags & flag ) )
83 mFilterFlags = newFlags;
90 if ( !( flag & mAvailableFilterFlags ) )
95 if ( flag & mFilterFlags )
96 mFilterFlags &= ~flag;
105 mFilterFlags &= ~exclusiveFlag;
108 mFilterFlags |= flag;
118 if ( mFilterFlags & flag )
124 void QgsSearchWidgetToolButton::aboutToShowMenu()
127 bool fieldActive =
false;
130 if ( !( mAvailableFilterFlags & flag ) )
137 connect( action, SIGNAL(
triggered(
bool ) ),
this, SLOT( actionSelected() ) );
140 if ( mFilterFlags & flag )
151 if ( mMenu->
actions().count() > 0 )
163 if ( !( mAvailableFilterFlags & flag ) )
170 connect( action, SIGNAL(
triggered(
bool ) ),
this, SLOT( actionSelected() ) );
173 if ( mFilterFlags & flag )
178 void QgsSearchWidgetToolButton::actionSelected()
184 void QgsSearchWidgetToolButton::searchWidgetValueChanged()
194 QgsSearchWidgetWrapper::FilterFlags newFlags;
197 if ( !( mAvailableFilterFlags & flag ) || !( mFilterFlags & flag ) )
201 mFilterFlags = newFlags;
212 if ( mDefaultFilterFlags & flag )
220 void QgsSearchWidgetToolButton::updateState()
226 if ( mFilterFlags & flag )
234 if ( mFilterFlags & flag )
QString join(const QString &separator) const
QString tr(const char *sourceText, const char *disambiguation, int n)
void setData(const QVariant &userData)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)