×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    30

    Does QML for Meego support javascript?

    Hi.

    I intend to display time in Meego QML:
    Here is the tcmtime.js file for fetching and returning current time:

    function gettime() {
    var currenttime;
    var today=new Date();
    var hh=today.getHours();
    var mm=today.getMinutes();
    var ss=today.getSeconds();
    currenttime=hh+":"+mm+":"+ss;
    return currenttime;
    }

    In MainPage.qml file, the js file is imported and used, howerver, the import is wrong "qrc:/qml/MainPage.qml:1:24: Invalid import qualifier ID "

    import "tcmtime.js" as ctime
    import QtQuick 1.1
    import com.meego 1.0


    Page {
    id: mainPage
    tools: commonTools
    Label {
    id: label
    anchors.centerIn: parent

    text: "current time: "+ctime.gettime();
    visible: true
    }
    }

    QT+= declarative is in .pro file, tcmtime.js is added into .qrc file as well.

    Any mistake?

    Another question is how to get current time in main.c then pass it to main.qml file?

    Thanks in advance!

    zbc

  2. #2
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: Does QML for Meego support javascript?

    it should work.

    for second question you can check here.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  3. #3
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Does QML for Meego support javascript?

    Yes, QML for Meego support javascript. Make sure that your "tcmtime.js" file is at same directory level that your .qml file is, otherwise provide relative path, like "mydir/tcmtime.js".

Similar Threads

  1. QtWRT support in MeeGo 1.2 ?
    By Handout in forum Nokia N9
    Replies: 2
    Last Post: 2011-08-19, 12:46
  2. MeeGo Support
    By somnathbanik in forum General Development Questions
    Replies: 5
    Last Post: 2010-10-06, 14:27
  3. Javascript Support for S60 Browser
    By swetha_t in forum Browsing and Mark-ups
    Replies: 2
    Last Post: 2009-07-10, 10:01
  4. JavaScript Support for 7610
    By mobiletask in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-10-25, 17:19

Posting Permissions

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