[Solved] Setting model from C++ does not work on Androd ...
... but it does work on Desktop
Ok, I am using Qt 5.4.1 (the latest) If I try to set a string list model from C++ it fails on actual Android device (Nexus 5), The screen is just black. However the same code runs fine on my Ubuntu Desktop.
Here is my code:
@int main(int argc, char *argv)
QApplication app(argc, argv);
list << "one" << "two" << "three" << "four";
QObject *topLevel = engine.rootObjects().value(0);
QQuickWindow *window = qobject_cast<QQuickWindow *>(topLevel);
width: 300; height: 200
Any idea as to why this fails on Andoid ?
Thank for any help here,
AFAIK, Android doesnot support multiple windows. Any reason you are casting it to QQuickWindow ? QQmlAppEngine is in anyway going to load and display it.
Thank your for fixing the problem. That was just ignorance on my part