How to change layout on QMainWindow on maemo when device is rotated?
I'm writing some Python's code on maemo5. when device is rotated i must repack widgets, but I can't change mainwindow's layout. how can I do that on Python? tnanx
Is python works different from c++ .I mean ,are there any different functions.
I don't have any exp on mobile / maemo .
ok, do you know in c++ succsessfully secuense ops?
If you put the contents of the main window in a QWidget, you'll be able to change its layout without having to change the main window's layout.
"QDesktopWidget::resized()":http://doc.qt.nokia.com/4.6/qdesktopwidget.html# should tell you when the screen resolution changes (and it does when rotating the device, since width and height are swapped).
However, if you use Qt layouts, the widgets should automatically adapt to the new screen resolution.
QBoxLayot helps me
Others have cover the layout, the new "Sensor API":http://doc.qt.nokia.com/qtmobility-1.0/sensors-api.html from the Qt Mobility project may be of interest too. In addition to QOrientationSensor, it has QAccelerometer.