Providing Qt modules inside QtScript
-
I would still recommend you to take a more serious language. Python I think you should come. here is a list of available modules qt
"pyQt":http://pyqt.sourceforge.net/Docs/PyQt5/introduction.html#pyqt5-components
"pyside":http://www.pyside.org/ if you need LGPL License.from my own experience I can say that the prevalence of programming language is important. QScript not very common version of js so it is not as well tested / evaluated as a python or other, and support for it will be more difficult to obtain.
-
I also recommend you try the luaplus
"see this":http://gamedev.stackexchange.com/questions/8994/accessing-c-class-members-with-luaplus -
I found PyQt and PySide as well, 2 or 3 nights ago, and I was reading some pages about each. I was almost going for PySide, but then I noticed it only supports Qt 4.8 at most while my application is meant for Qt 5... Also I need LGPL so PyQt is a no-go as well since bindings for Qt5 are only available with a commercial license.
I'm not really into toLua++ and similar tools, I think that some manual work and proper testing is better than some auto-generated bindings. However, I seem to be left no other choice so I might give it a try... I have given up trying to find a way to bind Qt modules in the QtScript environment. It's a shame Qt devels didn't think of that themselves, I could see it as a very badass addition that would simply blow people's mind. -
Using Qt is a mandatory requirement?
If not, we can continue to communicate via email.
Otherwise, let's see what did not work with.
If you need support for a finite amount of classes qt + form creation through the script, it's a trivial task.
Just remember, the program on script like any script when a certain level of complexity turns into porridge. -
Yes, Qt is mandatory since these plugins should be able create widgets in a main window that I provide, other than being able to communicate over Internet and manage multimedia content.
I would need at least the core, widgets, multimedia and network modules. The XML and SQL modules woud be very handy so count them in as well. I dont need qml support, probably opengl neither...
It's obvious a script can't afford to run as fast as a compiled application but the usage of the plugins is limited to small widget-like apps. Also, i really love qt and the way it is/works, si why not using it inside the scripts as well :-) -
Also, i really love qt
I thought so -) , i'm love it too.
Now I'll see what problem can be with core, widgets, multimedia and network modules.
Then i send example project for you. -
I partly understand the question. automatically transferred to the script only those parts of the qobject for which The generated meta-information. ie member of a class is declared as:
@public:
QMenu toolsMenu;@
will not be rescheduled. But if you declare it as:
@public:
Q_PROPERTY(QMenu toolsMenu MEMBER toolsMenu)
QMenu toolsMenu;@
then everything is OK. also need to be the type of object that was registered in the meta-object system
@Q_DECLARE_METATYPE(QMenu)@in result I mean two solutions:
1 change of attitude of the moc-compiler that he created the meta information for all parts of the object (this is unlikely, but it is tempting)
2 write simple wrappers for the basic kernel objects, like this:
@class QScriptDir : public QObject, public QDir
{
Q_OBJECT
public slots:
QStringList entryList(...){ return QDir::entryList(...); }
/* or more correctly */
public:
Q_INVOKABLE QStringList entryList(...){ return QDir::entryList(...); }
};@
incidentally for the object qdir is necessary in any case because it is not an qobject at all
I think in total will have to use the second option as the more correct, safe and portable. especially for a good lexer will not be difficult to write these wrappers automatically, with minor adjustments. approximately one week we will be enjoying the interface is fully implemented in the qscript. -
As it turns out the answer to the question is "there is no click-do way". I guess I've understood it long ago but I kind of just needed someone to tell me that.
Although it looks tempting to make the MOC do the work for you, I think it will just screw things up with way too much wrapper code and may possibly bring side-effects too.
The second solution is basically what they're suggesting when saying "write wrapper objects". I am considering to go trough it and see if it's worth it. But what if spend a week or more just doing this thing and then it may simply turn out not be worth it? I am studying some solutions to link a (any) scripting language to some C++ code that simply does what I need without the need for wrapper objects. Both solutions will have ups and downs, I just have to find out which is better.Thank you very much for the work you've done rst256. I will post again here as soon as I test some ideas going trough my mind right now, but I will need some time because I have to study for some university exams these days. Catch you later ;)
-
I wish you good luck on exams.
And I while take care of our scripting problem. -
"qtlua":http://www.nongnu.org/libqtlua/
no full support for qt core classes, but has its own i/o system a plurality of modules.
although I would have preferred to continue to develop qscript, because of the great love of js.