Enabling auto-rotation

Enabling auto-rotation

Hello, when testing my application on the ExoPC with MeeGo, it ignores display rotations that do work in other applications. How to enable automatic display rotation for my application? In the internet I found e. g. #ifdef Q_WS_MAEMO_5 w.setAttribute(Qt::WA_Maemo5AutoOrientation, true); #endif but this doesn't work for me. Best regards and thanks for tips Andreas
publicaciones de 14 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

Hello,

still I did not get the automatic display rotation to work.

I tried to find out something with the Qt docu, but as far as I understood the automatic rotation should work without any code change needed. Therefore I don't understand why this is not working for my app. :-(

That's my simple main method - nothing special here. What additional setting I have to add to get an automatic display rotation applied to my app?
int main(int argc, char *argv[])
{
QApplication a(argc, argv);

MainWindow w;
w.showMaximized();

return a.exec();
}

Best regards and thanks in advance
Andreas

Hi Andreasa,

I am also facing similar problem, did you get any solution regarding that Orientation problem?

Thanks-
Kiran

Hello Kiran,

unfortunately I do not have a solution for this issue yet.

Maybe somebody else here has an idea about that.

Best regards
Andreas

Hi Andreas,

Thanks for the reply. I will check and if I get solution, I will write it back.

Regards-
Kiran

Hello Kiran,

that would be great, thank you!

Best regards
Andreas

Hi Andreas:

i do not believe MAMEO pragma flags will work on MeeGo.

Can you look into this class:

http://doc.qt.nokia.com/4.7-snapshot/qgraphicsrotation.html

and see if this can be applied to your code?

--vincent

Hello Vincent,

yes, I've saw the class already, but it just looks not the right way for me.

Because what I am searching for is just a way the application is rotated automatically when the device is rotated as e. g. also the AppUp client application itself.

So there should just be a flag or something like that telling MeeGo that it can rotate this application if needed automatically.

Best regards
Andreas

I willl look into it and get back to you.

Hello Vincent,

thank you very much.

Best regards
Andreas

Hello everybody,

is it not the MSceneManager that handle most of the Rotation Scene process ?
for example it has this method,
/*!
* Returns the current orientation. It's a convenience method with
* which you can get the orientation without querying the application window.
*/
M::Orientation orientation() const;

and some signal , slot to force the rotation

david

Hello David,

thanks for your reply.

And how I can tell this MSceneManager to just rotate the application when the sensor detects a device rotation (the same way as it's done with other applications (like the AppUp client itself) on the device)?

Best regards
Andreas

Hello Andreas,

i guess probably like does the widget gallery demo

applicationWindow()->setOrientationAngleLocked(false);
applicationWindow()->setOrientationLocked(false);
} else if (mode == portrait) {
applicationWindow()->setOrientationAngleLocked(false);
applicationWindow()->setOrientationAngle(M::Angle270);
applicationWindow()->setOrientationLocked(true);
} else if (mode == landscape) {
applicationWindow()->setOrientationAngleLocked(false);
applicationWindow()->setOrientationAngle(M::Angle0);
applicationWindow()->setOrientationLocked(true);
} else if (mode == angle0) {

and of course a connect to the public slot of the sceneManager :
void orientationAboutToChange(M::Orientation orientation);
void orientationAngleChanged(M::OrientationAngle orientationAngle);

that will be how i will try do to it .
Kind regards

david

Hello David,

thank you, I'll try that.

Best regards
Andreas

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya