.
This wrapper provides all functionality provided by UIDevice
class.
You can simply determine device orientation
QiOSDevice device;
qDebug() << device.orientation();
or observe device orientation changing
QiOSDevice device;
connect(&device, SIGNAL(deviceOrientationChanged(QiOSDeviceOrientation)), this, SLOT(deviceOrientationChanged(QiOSDeviceOrientation)));
Also you're able to start/stop generating such notifications
QiOSDevice device;
device.beginGeneratingDeviceOrientationNotifications();
///
device.endGeneratingDeviceOrientationNotifications();
Note: on iOS UIDevice
presented as a singleton, so calling beginGeneratingDeviceOrientationNotifications
on particular QiOSDevice
instance will affect this changes for all another instances.
There are two options: QiOSUserInterfaceIdiomPhone
and QiOSUserInterfaceIdiomPad
QiOSDevice device;
qDebug() << device.userInterfaceIdiom();
You're able to retrieve useful metadata about iOS version or a system name.
QiOSDevice device;
qDebug() << device.name();
qDebug() << device.systemName();
qDebug() << device.systemVersion();
qDebug() << device.model();
qDebug() << device.localizedModel();
Contributions are welcome.
Published under MIT license.
See LICENSE
file for details.