Reply
Thread Tools
Posts: 38 | Thanked: 2 times | Joined on Apr 2010 @ Novosibirsk, Russia
#1
Hello!
I need to determine device orientation. How I can doing this? Which class will help me? Or maybe some DBus message? Thanks a lot for answers!
 
w00t's Avatar
Posts: 1,055 | Thanked: 4,107 times | Joined on Oct 2009 @ Norway
#2
If this is for a regular application, you can check window size. Bigger height than width means portrait.

If you're using Qt, see QWidget::size().
__________________
i'm a Qt expert and former Jolla sailor (forever sailing, in spirit).
if you like, read more about me.
if you find me entertaining, or useful, thank me. if you don't, then tell me why.
 
Posts: 13 | Thanked: 12 times | Joined on Apr 2010 @ Finland
#3
Using mce from dbus: http://maemo.org/api_refs/5.0/5.0-fi...928a6ae2fc0c9e


Example for Qt:

QDBusMessage getOrientationMsg = QDBusMessage::createMethodCall(MCE_SERVICE, MCE_REQUEST_PATH, MCE_REQUEST_IF, MCE_DEVICE_ORIENTATION_GET);

QDBusConnection::systemBus().callWithCallback(getO rientationMsg, this, SLOT(updateOrientation(QString, QString, QString, int, int, int)));

this sends orientation data to updateOrientation slot:
updateOrientation(QString orientation, QString stand, QString face, int x, int y, int z)
 

The Following User Says Thank You to tommiasp For This Useful Post:
F2thaK's Avatar
Posts: 4,365 | Thanked: 2,467 times | Joined on Jan 2010 @ Australia Mate
#4
depends on how you hold it..
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 14:42.