Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Dec 2012

    Question QT cant import js file into build

    I followed this tutorial Porting Simple Android List Application to Symbian with Qt
    to create Database app.
    As I suppose QT have problem with import js file needed to connect to DB.

    When I click and hold any item and select edit I get in console this:
    file:///C:/QtSDK/Simulator/Qt/mingw/imports/com/nokia/symbian.1.1/PageStack.js:132: Error: Error while loading page: file:///C:/Users/Michal/QT/Andjsapp-build-simulator-Simulator_Qt_for_MinGW_4_4__Qt_SDK__Release/qml/Andjsapp/EditPage.qml:3 Script file:///C:/Users/Michal/QT/Andjsapp-build-simulator-Simulator_Qt_for_MinGW_4_4__Qt_SDK__Release/qml/Andjsapp/script.js unavailable
    file:///C:/Users/Michal/QT/Andjsapp-build-simulator-Simulator_Qt_for_MinGW_4_4__Qt_SDK__Release/qml/Andjsapp/script.js:-1 File not found
    But when i add manually js file into:
    It works fine and it display Edit form.

    Is this a QT bug or its impossible to import js file in Symbian projects?
    And how can I import js file when I want to test it on Symbian Device?
    Maybe its one line in *.pro file?
    Any ideas?

    App is available here: https://dl.dropbox.com/u/6412001/Andjsapp.zip

    I know there is tutorial for implement SQLite in c++ but its too complicated for me because I want to use qml for design views.
    Maybe someone can share with me demo app where is used C++ implementation of SQLite and qml forms.

    Best Regards, Michael

  2. #2
    Registered User
    Join Date
    May 2009

    Re: QT cant import js file into build

    It is a minor bug of yours actually. A qml file is searching JS files by default in the same folder it is into. So that makes it the folder {project root folder}/qml/Andjsapp. But your script file is in {project root folder}. So it is logical that it can't be found.

    The best solution would be to:
    - go in the folder {project root folder}/qml/Andjsapp and create a new folder called "scripts"
    - In there add your JS files.
    - In the EditPage.qml change the import from:
    import "script.js" as ShoppingListDb
    import "scripts/script.js" as ShoppingListDb
    -finally remove from the .pro file the following lines:
    OTHER_FILES += \
        qml/Andjsapp/EditPage.qml \
    These are already handled by the qmlapplicationviewer.pri and since your .js files are now in the qml directory of the project you need to worry no more about their deployment.

    Last edited by favoritas37; 2012-12-29 at 09:05. Reason: fixed the code areas

  3. #3
    Registered User
    Join Date
    Dec 2012

    Re: QT cant import js file into build


    Thanks for reply
    I've followed your instructions and now it works.

Similar Threads

  1. Import existing projects but can' build?
    By Nihlathak in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2009-04-05, 13:49
  2. Can't seem to import .mmp file in CW
    By bubb13s in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 7
    Last Post: 2008-11-21, 11:23
  3. Can not import the mmp file
    By SymNLeaner in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 3
    Last Post: 2007-03-09, 00:08
  4. how can i import the .gif and .jpg file in s60?
    By hitman_01 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2006-06-21, 19:53
  5. have two problems in import mmp file and without error in build
    By silver_man82 in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2006-06-03, 04:18

Posting Permissions

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