Accelerometer func with Qt