Results 1 to 20 of 27

Thread: How to access v8's debug API in QJSEngine

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #17
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: How to access v8's debug API in QJSEngine

    Quote Originally Posted by wysota View Post
    That's unlikely as two different engines would have to be maintained simultaneously.
    True, I also don't find that likely. Too bad though, having a high performance engine available would have been nice and that was probably even the original intent.

    Quote Originally Posted by DavidXanatos View Post
    I'm afraid that QScriptEngine will have to bite the dirt first and there will be no replacement in place that would provide decent in app debugging capabilities.
    Well, "first" in this context still means Qt6, it is more likely that QJSEngine's internals will change earlier than that.

    Ideally QQmlEngine would have used QJSEngine and so it could switch to something else while keeping QJSEngine and deprecating QScriptEngine.
    But alas it derives from it, so unless QJSEngine is two different things internally (very unlikely!), it will become an engine optimized for the QML use case.

    My take is that the needs for in-application scripting, especially due to the easy way of accessing application provided infrastructure from scripts, can easily be fulfilled by QScriptEngine.

    Quote Originally Posted by DavidXanatos View Post
    Of cause one could hope they will get rid of QJSEngine all together, keep QScriptEngine for scripting and use v4vm only for QQmlEngine.
    While they obviously can't get rid of QJSEngine as a class, my guess is that it will become an implemetation detail of QQml and QScriptEngine stays the main in-application scripting facility.

    Quote Originally Posted by DavidXanatos View Post
    on a side note: qml and webkit, i haven't looked into it in detail, but are they actually deploying v8 code twice once as part of qml and once as part of web kit? Thats not elegant, there should be a shared v8 library used by all modules.
    WebKit is special, its Qt "frontend" is part of the WebKit, not WebKit part of Qt. So it is more a separate project that is being worked on by some developers who also happen to be developers on Qt-Project.org

    WebKit might also switch to a different JS engine at some point.

    Regarding QML:

    a QML document describes a tree of element, much like XML but with less verbose syntax. Each element type is specified either by another QML document or a C++ class registered with the QML type system. The requirement for the latter is that the class derives, directly or indirectly, from QObject and that it can be created without arguments.

    As Qt developers we often create trees of QObjects, e.g. QWidget trees, QStateMachine with nested states, etc.
    QML can be used to do that in a less hard-coded fashion, e.g. if the tree in question needs to be changable without changing the binary.

    Since all nodes in such a tree are essentially QObject instances, they have the capability of signals, slots and properties. QML allows to call slots, connect to signals and read/write properties. One really nice feature is that properties can not only be assigned a fixed value but an expression containing other properties and that expression is automatically reevaluated whenever one of its contained properties changes its value.

    The latter is of course especially nice in UI code, where e.g. a button's enabled state often depends on some other UI element's content.
    But it can be useful for other object hierachies as well, it is mostly a matter of getting used to this form of state propagation.

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    DavidXanatos (1st June 2013)

Similar Threads

  1. Replies: 1
    Last Post: 10th October 2012, 09:46
  2. Qt + Linux + Eclipse - debug using debug build?
    By will49 in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2012, 07:27
  3. Replies: 4
    Last Post: 30th September 2010, 11:31
  4. DEBUG macro not defined in debug build using vc++
    By piotr.dobrogost in forum Qt Programming
    Replies: 0
    Last Post: 21st July 2009, 14:07
  5. Replies: 11
    Last Post: 22nd March 2006, 20:06

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.