Creating sensor with QOrientationSensor fails with KERN EXEC 3 at symbian S60 5th N97 device. Compass cannot be created, you have to use QSensor with QByteArray orientation("QOrientationSensor") instead and when reading data do static_cast QSensorReading to QOrientationReading.
Here is code snippet to clarify issue:
QSensor* m_orientation;
QSensorReading* m_currentOrientationReading;
m_orientation = new QSensor("QQOrientationSensor", this);
QOrientationReading reading = static_cast<QOrientationReading>(m_currentOrientationReading);
reading->orientation()