Add "const QString key = QLatin1String("StateMachineViewer/imageDir");"

Otherwise it seems good.
For me you can commit it.