×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    18

    Box2d Plugin Working for desktop but not in the Symbian

    Hi everybody

    I installed the Box2d plugin for QML. I ran an example that came with the zip file. Every example ran in desktop but when I tried to run it my Nokia 5530 XpressMusic, it said:
    "module "Box2D" is not installed
    import Box2D 1.0
    ^ "

    I tried the following but it didn't help:
    I copied the whole project folder Box2d to "......\QtSDK\Symbian\SDKs\Symbian1Qt473\epoc32\data\z\resource\qt\imports" & then tried to build the project but it ended with an error.
    (Please note that I tried similar thing for desktop i.e copied the folder to "........\QtSDK\Desktop\Qt\4.7.3\mingw\imports" & built. It worked)
    How do I fix this problem? I want Box2d to work in Symbian as well.

  2. #2
    Nokia Developer Expert
    Join Date
    Oct 2007
    Posts
    441

    Re: Box2d Plugin Working for desktop but not in the Symbian

    Hi

    could you let me know the link to Box2D you use? Perhaps you need to install QML plugin on your device that is declared as "import Box2D 1.0" -- do you have that in that package

    Please check https://projects.developer.nokia.com/mototrialracer that demonstrates Box2D use in QML. recently i have checked the project on symbian , it works out-of-box

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    18

    Re: Box2d Plugin Working for desktop but not in the Symbian


  4. #4
    Nokia Developer Expert
    Join Date
    Oct 2007
    Posts
    441

    Re: Box2d Plugin Working for desktop but not in the Symbian

    Hi

    i failed to make it visible from QML, it seems those guys who supports MototrialRacer game failed either because the same source code is just statically linked to the project. But their code is enhanced in comparison to code in git repo you have pointed, judging by one more QML type "WeldJoint":

    mototrial racer game : https://projects.developer.nokia.com/mototrialracer
    Code:
    void Box2DPlugin::registerTypes(const char *uri)
    {
        Q_ASSERT(QLatin1String(uri) == QLatin1String("Box2D"));
    
        qmlRegisterType<Box2DWorld>(uri, 1, 0, "World");
        qmlRegisterType<Box2DBody>(uri, 1, 0, "Body");
        qmlRegisterType<Box2DFixture>();
        qmlRegisterType<Box2DBox>(uri, 1, 0, "Box");
        qmlRegisterType<Box2DCircle>(uri, 1, 0, "Circle");
        qmlRegisterType<Box2DPolygon>(uri, 1, 0, "Polygon");
        qmlRegisterType<Box2DDebugDraw>(uri, 1, 0, "DebugDraw");
        qmlRegisterType<Box2DJoint>();
        qmlRegisterType<Box2DDistanceJoint>(uri, 1, 0, "DistanceJoint");
        qmlRegisterType<Box2DPrismaticJoint>(uri, 1, 0, "PrismaticJoint");
        qmlRegisterType<Box2DRevoluteJoint>(uri, 1, 0, "RevoluteJoint");
        qmlRegisterType<Box2DWeldJoint>(uri, 1, 0, "WeldJoint");
    }

    http://gitorious.org/qml-box2d/qml-box2d/trees/master :
    Code:
    void Box2DPlugin::registerTypes(const char *uri)
    {
        Q_ASSERT(QLatin1String(uri) == QLatin1String("com.nokia.Box2D"));
    
        qmlRegisterType<Box2DWorld>(uri, 1, 0, "World");
        qmlRegisterType<Box2DBody>(uri, 1, 0, "Body");
        qmlRegisterType<Box2DFixture>();
        qmlRegisterType<Box2DBox>(uri, 1, 0, "Box");
        qmlRegisterType<Box2DCircle>(uri, 1, 0, "Circle");
        qmlRegisterType<Box2DPolygon>(uri, 1, 0, "Polygon");
        qmlRegisterType<Box2DDebugDraw>(uri, 1, 0, "DebugDraw");
        qmlRegisterType<Box2DJoint>();
        qmlRegisterType<Box2DDistanceJoint>(uri, 1, 0, "DistanceJoint");
        qmlRegisterType<Box2DPrismaticJoint>(uri, 1, 0, "PrismaticJoint");
        qmlRegisterType<Box2DRevoluteJoint>(uri, 1, 0, "RevoluteJoint");
    }

    even if i advice you to examine MotoTrialRacer project , anyway you can keep trying to make it visible on QML side in Symbian. Dot forget update the project profile with the following lines otherwise it is broken on Symbian:
    Code:
    symbian: {
        MMP_RULES += EXPORTUNFROZEN
        TARGET.EPOCALLOWDLLDATA = 1
    
        pluginFiles.sources = $${TARGET}.dll
        pluginFiles.path = $$QT_IMPORTS_BASE_DIR/$$DESTDIR
        DEPLOYMENT += pluginFiles
    }

Similar Threads

  1. Box2d QML Plugin
    By engrnaveed in forum [Archived] Qt Quick
    Replies: 2
    Last Post: 2012-04-27, 09:13
  2. Replies: 1
    Last Post: 2010-06-16, 12:27
  3. Need of a working browser plugin
    By afelon in forum Symbian
    Replies: 10
    Last Post: 2008-02-15, 05:28
  4. Java vs. C++, Desktop plugin?
    By mitcheloc in forum Mobile Java General
    Replies: 3
    Last Post: 2007-10-23, 08:09
  5. Working with desktop shortcuts
    By i_dachev in forum Symbian
    Replies: 0
    Last Post: 2004-06-28, 07:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×