Results 1 to 5 of 5

Thread: QML and javascripts

  1. #1
    Join Date
    Aug 2011
    Posts
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QML and javascripts

    Hi,

    is there any proper way to parse html stuff using QML and javascripts?

    br,

  2. #2
    Join Date
    Mar 2012
    Posts
    7
    Qt products
    Qt4
    Platforms
    Symbian S60 Maemo/MeeGo

    Default Re: QML and javascripts

    Hi,

    you can parse html with javascript functions and access/use those functions in QML. Specifically QML does not provide you any for parsing html content
    Some suggestions on how to parse html in JS are here

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QML and javascripts

    Quote Originally Posted by matsukan View Post
    Hi,

    is there any proper way to parse html stuff using QML and javascripts?
    I don't think doing that from QML or JavaScript is a good idea. Why don't you expose a C++ component to QtQuick that does what you want?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Aug 2011
    Posts
    38
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QML and javascripts

    Why? If html data already fetched from qml side why to send received html stuff c++ side and again back to qml side.

    is there any performance issues when using Javascripts? I would like try parse html stuff using javascripts.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QML and javascripts

    JavaScript language is much more limited than what Qt offers in C++ world. If you just want to parse DOM then go ahead and use JavaScript. If you expect input that does not have to be clean and valid XML, using C++ might give better results. The point is that QML is meant to be a UI environment. Of course you can implement the logic in JavaScript but only a simple one.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.