diff --git a/src/plugins/projectexplorer/task.cpp b/src/plugins/projectexplorer/task.cpp
index eabf8063e1849b34538ea9319735c4d362c29506..2f83d14e512d140f36f516d94e3a91f4f12020d4 100644
--- a/src/plugins/projectexplorer/task.cpp
+++ b/src/plugins/projectexplorer/task.cpp
@@ -137,9 +137,9 @@ bool operator<(const Task &a, const Task &b)
         // Can't happen
         return true;
     } else {
-        if (a.category.uniqueIdentifier() < b.category.uniqueIdentifier())
+        if (a.category < b.category)
             return true;
-        if (b.category.uniqueIdentifier() < a.category.uniqueIdentifier())
+        if (b.category < a.category)
             return false;
         return a.taskId < b.taskId;
     }