I believe this should be safe. QMultiMap just adds a new set of overloaded methods to QMap, you'll only get unexpected results if you use a function inside lastKeyOf() which is overloaded in QMultiMap to have different behavior. The only overloaded method with a compatible signature and different behavior that I can see is insert().
Having said that, it may make for more straightforward code to avoid QMultiMap and use QMap only with QMap::insertMulti() instead of QMap::insert().