Qt 5.3.2 / QML on iOS 8, cannot get UIView from QQuickWindow anymore [solved]
-
On iOS 7.x i was used to get the current uiview like this:
@UIView *view = static_cast<UIView *>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow("uiview", window()));
@
or if i want to have it "ARC safe":@UIView *view = (__bridge UIView *)reinterpret_cast<void *>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow("uiview", window()));
@
But on iOS8 this results in "view = nil" :-(I need the uiview in order to get the UIViewController (as most will):
@UIViewController *qtController = [[view window] rootViewController];
@
Sooo, do you know a way to get the uiview (or better the UIViewController) on iOS 8 ?Greetings,
Nils
-
Hi,
iOS 8 has brought a lot of modifications, you should bring this to the interest mailing list. You'll find there Qt's developers/maintainers. This forum is more user oriented.
-
Hello SGaist !
Thanks for the hint.Are you talking of this list( sorry to be ignorant):
http://lists.qt-project.org/mailman/listinfo/interestI don't want to spam the innocent with my problems :-)
Greetings,
Nils
-
Exactly that one yes :)
-
Wiiiiiiiiiizzzzzzz (me, rocketing to join that list, mail you later :-) )
Nils
-
Its solved !
The idiotic thing is: Xcode 6 Debugger showed uiview to be nil and so i thought the crash resulted from that, but in reality view WAS valid and the crash had another trivial reason...There is no better debugging than fprintf... GRRR
:-)
Nils
-
Nice you found out !
qDebug ? :D
Since it's working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)
-
Hi all,
I'm trying to do the same thing but my compiler complains about incomplete type for QPlatformNativeInterface.
What do I need to do to use the code posted by nils?
Qt 5.3, iOS8
PS: SGaist you are the true master of Qt and iOS! Cheers for the great work, your answers have been guiding me a lot this year without you knowing it. :)
-
Hi !
Did you use the include:
#include <QtGui/qpa/qplatformnativeinterface.h>Greetings,
Nils
-
Hi!
Thanks for the fast reply.
file doesn't exist...
-
Ask too fast and find yourself answering yourself...
for posterity :
QT += gui-private
-
hmm, cannot help i used standard downloads 5.3.2 and 5.40 BETA, both offered that file. Try and search for that file on your HDD, i cannot help further i guess.
Greetings,
Nils
-
ahh okay :-) Have Fun !