Results 1 to 5 of 5

Thread: Does Qt cache ECMAScripted QML values?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    1
    Platforms
    Windows

    Default Does Qt cache ECMAScripted QML values?

    Hi.

    This question might be a bit of a long shot, but.. I'm writing some GUI classes in Java that use a similar system to Qt where properties can be scripted. For example, I can set the position of a Widget to be based on the size of itself or a parent Widget, by exposing the Widget object(s) to the scripting language. Here's an example (JSON & JavaScript):
    Qt Code:
    1. "offset" : {
    2. "x" : "-(me.getSize().getX() / 2)",
    3. "y" : "-(me.getSize().getY() / 2)"
    4. },
    To copy to clipboard, switch view to plain text mode 
    I noticed that calling the script every frame is really slow - the FPS goes from ~3000 to ~150. I have thought about various ways to cache the values of the properties that are scripted, but the solution always involves having some kind of listeners that observe the values held by the objects that the scripts rely on, which I think will end up really messy.

    So, I'm wondering if Qt does anything in terms of caching the result of scripted QML properties? I know C++ is different to Java in terms of performance, but I thought I'd ask anyway.

    Cheers.
    Last edited by wysota; 28th January 2012 at 12:30.

Similar Threads

  1. Replies: 0
    Last Post: 31st July 2010, 17:27
  2. Replies: 3
    Last Post: 12th May 2010, 13:11
  3. slowness QGraphicsView setScene
    By rk123 in forum Qt Programming
    Replies: 4
    Last Post: 1st April 2010, 18:22
  4. Can Qt handle pdf documents???
    By webquinty in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 23rd March 2009, 15:16
  5. How to Handle new Qt?
    By ashukla in forum General Programming
    Replies: 3
    Last Post: 3rd March 2008, 11:50

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
  •  
Qt is a trademark of The Qt Company.