Can we also have a function _exactly_ like this:

~~~C++
bool addMacros(const QHash<QString,QString>& macros) {
    if (mMacros.count()) {
        bool error = false;
        foreach (const QString& key, macros.keys()) {
            error = addMacro(key, macros.value(key)) || error;
        }
        return error;
    }
    mMacros = macros;
    return true;
}
~~~

The usual case for using this Expander will be to already have a set of macros to expand. This set will most of the time be cached (which makes a fair good use of Qt's COW-semantics). Also - most of the time - there will only be one call for adding the macros. The above is the only way, we can ensure to not needlessly rebuild the whole hash from scratch each time.