[Solved] Having trouble using QDeclarativeView
-
I'm trying to get a QML file to run from my C++ program. I looked on the Nokia website, and they have tips posted on how to do it. I got the following code directly from the Nokia website: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/slides/qml-cpp-integration.pdf
@
#include <QApplication>
#include <QDeclarativeView>
#include <QUrl>int main(int argc, char *argv[])
{
QApplication app(argc, argv);QDeclarativeView view; view.setSource(QUrl("qrc:files/animation.qml")); view.show(); return app.exec();
}
@This seems pretty easy and straightforward, right? I put this in Qt Creator, and I get an error when I try to build: QDeclarativeView: No such file or directory. This is the first among 4 errors.
The closest library I could find is <QtDeclarative/QDeclarativeView>, but when I include this, it doesn't work either. Why doesn't code work that's right on the Nokia website? What am I doing wrong here?