Fix some issues in qclass.cpp template

Change-Id: I7fa4500b3f323439832d36d641db7a5c65967787
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>