If you place the definition outside the for, it works nicer:

```
QMap<QString, FacebookUser::ConstPtr>::const_iterator i;
for (i = users.begin(); i != users.end(); ++i) {
    // ...
}
```

However, as you are currently only using the value, not the key, you could also do:

```
foreach (FacebookUser::ConstPtr user, users.values()) {
    // ... use "user" instead of "i.value()" here ...
}
```