Reply
Thread Tools
Posts: 13 | Thanked: 20 times | Joined on Feb 2010 @ Chambana
#1
I am able to detect when the screen orientation changes without any issues. I am wondering what the best way to make your application "rotation-friendly" is using Qt.
 

The Following User Says Thank You to mtrower2 For This Useful Post:
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#2
The way I did it is to connect a slot to the QApplication::desktop()->resized() signal. In this slot, you can reorder the widgets depending on whether the application is in portrait mode (height > width) or landscape mode (width > height). You can reorder the widgets by calling the resize() or setGeometry() methods as appropriate (use resize() where possible).
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub
 

The Following 2 Users Say Thank You to marxian For This Useful Post:
Posts: 13 | Thanked: 20 times | Joined on Feb 2010 @ Chambana
#3
@marxian, thanks for this tip. I am having issues getting the widgets to use the entire vertical space when in portrait mode. Is there some widget which controls this? I have tried using this->setGeometry and ui->centralWidget->resize.
 
xerxes2's Avatar
Posts: 513 | Thanked: 651 times | Joined on Feb 2011 @ Sweden
#4
Anyone knows how to force landscape mode?
__________________
But the WM7 "horse" has a blood lineage tracing back to donkeys such as WM6.5, 6.1, 6.0, 5.1 that was fully neglected for too many years and Microsoft did sweet F all to maintain it (still running on Pocket IE4/6!!).
 
Posts: 13 | Thanked: 20 times | Joined on Feb 2010 @ Chambana
#5
Originally Posted by xerxes2 View Post
Anyone knows how to force landscape mode?
Something like this (in main() before you show the form):

#ifdef Q_WS_MAEMO_5
w.setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
#endif

src: http://doc.qt.nokia.com/qt-maemo/maemo5-rotation.html
 

The Following User Says Thank You to mtrower2 For This Useful Post:
xerxes2's Avatar
Posts: 513 | Thanked: 651 times | Joined on Feb 2011 @ Sweden
#6
Thanks man, but I was thinking for meego/harmattan. On Fremantle I'd think landscape is default as I've never heard of any complaints about it.
__________________
But the WM7 "horse" has a blood lineage tracing back to donkeys such as WM6.5, 6.1, 6.0, 5.1 that was fully neglected for too many years and Microsoft did sweet F all to maintain it (still running on Pocket IE4/6!!).
 
xerxes2's Avatar
Posts: 513 | Thanked: 651 times | Joined on Feb 2011 @ Sweden
#7
Found the answer for meego: http://forum.meego.com/archive/index.php/t-2958.html
__________________
But the WM7 "horse" has a blood lineage tracing back to donkeys such as WM6.5, 6.1, 6.0, 5.1 that was fully neglected for too many years and Microsoft did sweet F all to maintain it (still running on Pocket IE4/6!!).
 
xerxes2's Avatar
Posts: 513 | Thanked: 651 times | Joined on Feb 2011 @ Sweden
#8
That might not work on Meego I just found out.
http://forum.meego.com/showthread.php?t=3692

Will test and report back asap when I get the device.
__________________
But the WM7 "horse" has a blood lineage tracing back to donkeys such as WM6.5, 6.1, 6.0, 5.1 that was fully neglected for too many years and Microsoft did sweet F all to maintain it (still running on Pocket IE4/6!!).
 
Reply


 
Forum Jump


All times are GMT. The time now is 12:02.