@JonB Solved!! Thank you so much for the help here troubleshooting which made the issue obvious after trying your suggested tests.
As you expected, the QSqlQuery is not the issue as the proper data is being returned;
Test #2
QSqlQuery q; qDebug() << "Prep: " << q.prepare("SELECT ClassCode, SUM(EstimatedChargeablePayroll) AS Total FROM Payroll GROUP BY ClassCode"); qDebug() << "Exec: " << q.exec(); while(q.next()){ QVariant code = q.value(0); QVariant total = q.value(1); qDebug() << code << total; }Results in the correct records being returned.
Prep: true Exec: true QVariant(QString, "5555") QVariant(double, 350000) QVariant(QString, "6666") QVariant(double, 50000)This completely ruled out the QSqlQueryModel issue and forced me to review the rest of the code. The class I've been working on is derived from QSqlQueryModel and has an overridden data() method that was not properly presenting the data to the view. The model was always working in the background it just didn't look like it.
@Christian-Ehrlicher, I was spooling up the example when this dawned on me, but appreciate the assist here.