Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User zhubc123's Avatar
    Join Date
    Mar 2003
    Posts
    30
    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
    Nokia Developer Champion kkrish's Avatar
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,029
    it should work.

    for second question you can check here.

  3. #3
    Nokia Developer Champion savaj's Avatar
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034
    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. about OSS browser support javascript
    By shaun.shen in forum Mobile Web Site Development
    Replies: 1
    Last Post: 2008-11-18, 22:03
  5. 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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved