diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2012-12-19 10:23:54 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-02-27 23:55:59 +0100 |
commit | 646b1fd2b65f42327ff81b92ead96c634bec6468 (patch) | |
tree | 5c1c8869e17afb77f980bf8c1897cb48ecc77fb8 /src/plugins/platforms/ios/qioswindow.mm | |
parent | bbb8db9bdb503f4f2c558e5f081c201c09d33d77 (diff) |
iOS: add UIView category to get the QWindow it represents
Adding a simple way to get the QWindow pointer from any UIView
makes writing code where you only have UIView pointers a bit easier.
Perhaps we should also investigate if it is worthwhile to make
this category public to the application, to further enhance
working in a mixed environment.
Change-Id: Ic263003dc7683a8d976024cbbbc2558e8472a790
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/plugins/platforms/ios/qioswindow.mm')
-rw-r--r-- | src/plugins/platforms/ios/qioswindow.mm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 220f30c485..d79c1de461 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -209,6 +209,17 @@ @end +@implementation UIView (QIOS) + +- (QWindow *)qwindow +{ + if ([self isKindOfClass:[EAGLView class]]) + return static_cast<EAGLView *>(self)->m_qioswindow->window(); + return nil; +} + +@end + QT_BEGIN_NAMESPACE QIOSWindow::QIOSWindow(QWindow *window) |