Don't use QMap::firstKey() and lastKey(), which introduced in Qt5.2