uint PropertySheetIconValue::compare(const PropertySheetIconValue &other) const
 {
     uint diffMask = mask() | other.mask();
     for (int i = 0; i < 8; i++) {
         uint flag = 1 << i;
         if (diffMask & flag) { // if state is set in both icons, compare the values
             const ModeStateKey state = stateMap()->state(flag);
             if (pixmap(state.first, state.second) == other.pixmap(state.first, state.second))
                 diffMask &= ~flag;
         }
     }
     return diffMask;
 }
Пример #2
0
    QDESIGNER_SHARED_EXPORT QDebug operator<<(QDebug d, const PropertySheetIconValue &p)
    {
        typedef PropertySheetIconValue::ModeStateToPixmapMap::const_iterator ModeStateToPixmapMapConstIt;

        QDebug nospace = d.nospace();
        nospace << "PropertySheetIconValue theme='" << p.theme() << "' ";

        const PropertySheetIconValue::ModeStateToPixmapMap &paths = p.paths();
        const ModeStateToPixmapMapConstIt cend = paths.constEnd();
        for (ModeStateToPixmapMapConstIt it = paths.constBegin(); it != cend; ++it)
            nospace << " mode=" << it.key().first << ",state=" << it.key().second
                       << ",'" << it.value().path() << '\'';
        nospace << " mask=0x" << QString::number(p.mask(), 16);
        return d;
    }
Пример #3
0
 uint PropertySheetIconValue::compare(const PropertySheetIconValue &other) const
 {
     uint diffMask = mask() | other.mask();
     for (int i = 0; i < 8; i++) {
         const uint flag = 1 << i;
         if (diffMask & flag) { // if state is set in both icons, compare the values
             const QPair<QIcon::Mode, QIcon::State> state = subPropertyFlagToIconModeState(flag);
             if (pixmap(state.first, state.second) == other.pixmap(state.first, state.second))
                 diffMask &= ~flag;
         }
     }
     if ((diffMask & ThemeIconMask) && theme() == other.theme())
         diffMask &= ~ThemeIconMask;
     return diffMask;
 }