[Qt-interest] Scripting support for Qt/C++ application

Konstantin Tokarev annulen at yandex.ru
Thu Nov 3 08:53:32 CET 2011


31.10.2011, 05:33, "Syam Krishnan" <syamcr at gmail.com>:
> Hi..
>
>   I'm using Qt 4.5 on RHEL 5 to develop a dynamic data simulator application. I need scripting support to allow the user to easily manipulate the test cases.
> My first choice is of course Javascript (ECMAScript) that comes bundled with Qt. I've been experimenting and from what I have seen so far, using Javascript with Qt is quite simple.
>
> I would like to know if this has any serious performance impact. I mean, when I invoke a script from C++, it'll typically call several methods of my Qt C++ classes. Is this going to be reasonably fast or is it a highly inefficient process. I know I'm not quoting any real performance numbers here, but I want to know if this is a grossly OK thing to do.
>
> My other choices would be to use SWIG to interface with Python. I don't really know how easy or fast that is. It's just something I found when searching on the internet for scripting support for C++ applications.
>
> Note that I'd like to use Qt 4.5 itself if it can be helped.
>
> Any help/suggestions are highly appreciated.

I propose you to integrate Lua (with help of QtLua[1] or directly using C API). Lua is lightning fast, very lightweight (~200K), and does not require any 3rd party dependencies. Language is very easy and is even suitable for non-programmers. Scripts can be compiled to bytecode and redistributed.

[1] http://www.nongnu.org/libqtlua/
-- 
Regards,
Konstantin



More information about the Qt-interest-old mailing list