You should use prepared statements and binding values to solve your problem.
Instead of using
qry2.exec(
"SELECT * "
"FROM [BOBs].[dbo].[FitmentTag] "
"WHERE FitmentTagGroupID = '1' "
);
you should use something like this:
qry2.prepare(
"SELECT * "
"FROM [BOBs].[dbo].[FitmentTag] "
"WHERE FitmentTagGroupID = :groupid "
);
qry2.bindValue(":groupid", groupId);
qty2.exec();
Read more here.