View Single Post
Jaffa's Avatar
Posts: 2,535 | Thanked: 6,681 times | Joined on Mar 2008 @ UK
#21
Originally Posted by attila77 View Post
libqtm-11 1.1.0-0fn~fremantle7 should have proper(er) import paths. It's still a hack, tho, track http://bugreports.qt.nokia.com/browse/QTMOBILITY-949 if it still causes you pain.

For now, you might need to do something like viewer.engine()->addImportPath(QString("/opt/qtm11/imports"));
I can't get my Qt Mobility working application to work on an actual N900. I've:
  1. Created a blank Qt Quick application in the latest Qt SDK
  2. Uncommented the lines about mobility in the .pro file
  3. Added import QtMobility.sensors 1.1 at the top of my script
  4. Added an Accelerometer component
  5. Run apt-get install libqtm-11-declarative

This works in the simulator, and everything's works as I rotate the screen. So I deployed on to my N900 and I get "module "QtMobility.sensors" is not installed".

I've tried adding the line above to my main.cpp:

Code:
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
    viewer.engine()->addImportPath(QString("/opt/qtm11/imports"));
    viewer.setMainQmlFile(QLatin1String("qml/attitude/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
But now it doesn't compile: invalid use of incomplete type 'struct QDeclarativeEngine'.

Any ideas?
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org