×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,349

    Javascript and HTML in QML

    Hi,
    I am new to Qt Quick. I am trying to make a QML app using javascript and html like to do in Web page. I got this link http://wiki.forum.nokia.com/index.ph...es_for_porting which have a javascript code in QML. Is there any example or article which has Javascript and HTML implementation?


    Please suggest me.

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

    Re: Javascript and HTML in QML

    Java script tags are not supported in QML but in case of rich text edit you can some of the html tags like img, <b> etc.

  3. #3
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,349

    Re: Javascript and HTML in QML

    Does it support <div> and <embed> tag, cause I tried its not working with <embed>

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

    Re: Javascript and HTML in QML

    I am not sure because I have not tried more thml tags in that.

  5. #5
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Javascript and HTML in QML

    QML is JSON-based and has no relation to HTML so you cannot use HTML tags in QML. On the other hand JavaScript is not markup language thus it has no tags as such.

  6. #6
    Nokia Developer Champion
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Javascript and HTML in QML

    no can't do, unless you use a webview (which kinda defeats the purpose, imho).
    qml not being html, i don't really see why you are
    trying to make a QML app using javascript and html
    actually

  7. #7
    Nokia Developer Champion
    Join Date
    Aug 2010
    Location
    Ahmedabad
    Posts
    299

    Re: Javascript and HTML in QML

    Quote Originally Posted by somnathbanik View Post
    Hi,
    I am new to Qt Quick. I am trying to make a QML app using javascript and html like to do in Web page. I got this link http://wiki.forum.nokia.com/index.ph...es_for_porting which have a javascript code in QML. Is there any example or article which has Javascript and HTML implementation?


    Please suggest me.
    Try this article http://wiki.forum.nokia.com/index.ph...aScript_in_QML
    Regards,

    Girish Padia

  8. #8
    Registered User
    Join Date
    Apr 2011
    Posts
    3

    Re: Javascript and HTML in QML

    If you use the WebView element you can supply HTML code to display. It will take HTML4 tags. The <embed> tag has been degraded and you should use workarounds.

    From the docs:
    This property holds HTML text set directly
    The html property can be set as a string.
    WebView {
    html: "<p>This is <b>HTML</b>."
    }

Similar Threads

  1. Replies: 5
    Last Post: 2010-12-21, 08:34
  2. JavaScript And Html For 3G Nokia Phone?
    By DancingWave in forum Browsing and Mark-ups
    Replies: 8
    Last Post: 2008-09-23, 11:50

Posting Permissions

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