instead of querying every ophaalpunt separately to check whether they have an 'aanmelding' or not. Better to query for all aanmeldingen, remember the 'ophaalpuntid' in a QList (or QSet) and check if teh ophaalpuntid is in the QList or not:
if(QList::contains(ophaalpuntid))
{
ophaalpunt has an aanmelding, change color;
}
else
{
ophaalpunt has NO aanmelding, stay normal color;
}
instead of querying every ophaalpunt separately to check whether they have an 'aanmelding' or not. Better to query for all aanmeldingen, remember the 'ophaalpuntid' in a QList (or QSet) and check if teh ophaalpuntid is in the QList or not: