On Tue, Apr 13, 2010 at 2:52 PM, Peter Matuchniak
<[email protected]> wrote:
> Hello Colin
>
> Thanks for the input. Although it compiles fine and appears to run without
> any errors, I don't actually see the QML page appear (i.e. myqml.qml is never
> displayed).
>
> I'm using Qt 4.7 that I built from source on Ubuntu.
>
Ok, I guess that code in main.cpp never actually displays the widget.
I took that from the QDeclarative documentation, but I'm not sure what
its use is if it doesn't display anything. Try this main.cpp:
#include "foo.h"
#include <QDeclarativeView>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QDeclarativeView *view = new QDeclarativeView();
view->rootContext()->setContextProperty("myFoo", new Foo);
view->setSource(QUrl("myqml.qml"));
view->show();
return app.exec();
}
Colin
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml