6 #ifndef SWIFT_GUI_MODELS_LISTMODELFILTER_H
7 #define SWIFT_GUI_MODELS_LISTMODELFILTER_H
19 template <
class ContainerType>
30 virtual ContainerType
filter(
const ContainerType &container)
const = 0;
47 Qt::CaseSensitivity cs = Qt::CaseInsensitive)
const;
55 bool m_enabled =
true;
59 template <
class ContainerType>
virtual bool isEnabled() const
Enabled?
void setEnabled(bool enable)
Enabled?
bool m_valid
is filter valid?
bool stringMatchesFilterExpression(const QString &value, const QString &filter, Qt::CaseSensitivity cs=Qt::CaseInsensitive) const
Standard string search supporting wildcard at begin and end: "*xyz", "abc*".
QString stripWildcard(const QString &value) const
Remove the * wildcards.
virtual swift::misc::CVariant getAsValueObject() const
Return an implementation-specific value object representing the filter.
bool isValid() const
Anything to do?
virtual ~IModelFilter()
Destructor.
IModelFilter(bool enabled=true)
Constructor.
virtual ContainerType filter(const ContainerType &container) const =0
Used container data.
Model filter interface for those who can generate such a filter (e.g. a widget or dialog)
virtual std::unique_ptr< IModelFilter< ContainerType > > createModelFilter() const =0
Get the filter, this is the filter itself, not its widget or dialog.
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
Models to be used with views, mainly QTableView.