diff --git a/lib/qglobalshortcut.cc b/lib/qglobalshortcut.cc
index 34ca128cbf0240b273ff8a0ea631d87f33e2fe8e..9b022ef3ba9e57bad169b12af9b772bb311170d2 100644
--- a/lib/qglobalshortcut.cc
+++ b/lib/qglobalshortcut.cc
@@ -85,7 +85,7 @@ bool QGlobalShortcut::unsetKey() {
 
 bool QGlobalShortcut::activate(quint32 id) {
     if (shortcuts_.contains(id)) {
-        foreach (QGlobalShortcut* s, shortcuts_.values(id)) {
+        for (QGlobalShortcut* s: shortcuts_.values(id)) {
             emit s->activated();
         }
         return true;