Code does not compile with Qt4
first problem is
ui->classBox->setCurrentText(type); // works with Qt5 only
Other problems are related to QStringRef
According to the documentation
this class has no member names toInt
or toFloat
What should we do now? Stick with qt5 and ignore qt4? (hard decision)