Qt 4.8
Public Functions | Protected Variables | List of all members
QUIKitAppDelegate Class Reference
Inheritance diagram for QUIKitAppDelegate:

Public Functions

(void) - updateOrientation:
 

Protected Variables

UIInterfaceOrientation mOrientation
 

Detailed Description

Definition at line 57 of file quikiteventloop.mm.

Functions

◆ updateOrientation:()

- (void) updateOrientation: (NSNotification *)  notification

Definition at line 99 of file quikiteventloop.mm.

99  :(NSNotification *)notification
100 {
101  Q_UNUSED(notification)
102  UIInterfaceOrientation newOrientation = mOrientation;
103  NSString *infoValue = @"";
104  switch ([UIDevice currentDevice].orientation) {
105  case UIDeviceOrientationUnknown:
106  break;
107  case UIDeviceOrientationPortrait:
108  newOrientation = UIInterfaceOrientationPortrait;
109  infoValue = @"UIInterfaceOrientationPortrait";
110  break;
111  case UIDeviceOrientationPortraitUpsideDown:
112  newOrientation = UIInterfaceOrientationPortraitUpsideDown;
113  infoValue = @"UIInterfaceOrientationPortraitUpsideDown";
114  break;
115  case UIDeviceOrientationLandscapeLeft:
116  newOrientation = UIInterfaceOrientationLandscapeRight; // as documentated
117  infoValue = @"UIInterfaceOrientationLandscapeRight";
118  break;
119  case UIDeviceOrientationLandscapeRight:
120  newOrientation = UIInterfaceOrientationLandscapeLeft; // as documentated
121  infoValue = @"UIInterfaceOrientationLandscapeLeft";
122  break;
123  case UIDeviceOrientationFaceUp:
124  case UIDeviceOrientationFaceDown:
125  break;
126  }
127 
128  if (newOrientation == mOrientation)
129  return;
130 
131  // check against supported orientations
132  NSBundle *bundle = [NSBundle mainBundle];
133  NSArray *orientations = [bundle objectForInfoDictionaryKey:@"UISupportedInterfaceOrientations"];
134  if (![orientations containsObject:infoValue])
135  return;
136 
137  mOrientation = newOrientation;
138  [UIApplication sharedApplication].statusBarOrientation = mOrientation;
139  if (QUIKitIntegration::instance()->screens().size() > 0) {
140  QUIKitScreen *screen = static_cast<QUIKitScreen *>(QUIKitIntegration::instance()->screens().at(0));
141  screen->updateInterfaceOrientation();
142  }
143 }
QList< QPlatformScreen * > screens() const
Accessor function to a list of all the screens on the current system.
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
void updateInterfaceOrientation()
Definition: quikitscreen.mm:90
UIInterfaceOrientation mOrientation
static QUIKitIntegration * instance()
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

Properties

◆ mOrientation

- (UIInterfaceOrientation) mOrientation
protected

Definition at line 58 of file quikiteventloop.mm.


The documentation for this class was generated from the following file: