QGalleryUnionFilter operator ||(
        const QGalleryUnionFilter &filter1, const QGalleryUnionFilter &filter2)
{
    QGalleryUnionFilter filter = filter1;
    filter.append(filter2);
    return filter;
}
Beispiel #2
0
QGalleryFilter QDeclarativeGalleryFilterUnion::filter() const
{
    QGalleryUnionFilter unionFilter;

    typedef QList<QDeclarativeGalleryFilterBase *>::const_iterator iterator;
    for (iterator it = m_filters.begin(), end = m_filters.end(); it != end; ++it) {
        QGalleryFilter filter = (*it)->filter();
        switch (filter.type()) {
        case QGalleryFilter::MetaData:
            unionFilter.append(filter.toMetaDataFilter());
            break;
        case QGalleryFilter::Union:
            unionFilter.append(filter.toUnionFilter());
            break;
        case QGalleryFilter::Intersection:
            unionFilter.append(filter.toIntersectionFilter());
            break;
        default:
            break;
        }
    }
    return unionFilter;
}