QScript add a specific == operator
-
wrote on 27 Apr 2015, 08:52 last edited by
Hello !
I am currently playing with the functionalities provided by the QScript module. I would like to evaluate a simple expression like 'val 1' == 'val 2'. Is it possible to indicate to QScript what it should use to perform the equality comparison ? In C++, I should have reimplemented the operator== for the specified types.
Thanks a lot for your answers !
-
wrote on 28 Apr 2015, 23:43 last edited by SysTech
I honestly can't answer your question directly as I have not tried to do any operator overloading in QScript. I can say however while it is not the same thing you can extend QScript providing and registering your own functions. So you can have something in your code like:
if( compareValue( A, B ) ) then do something
You'd write and register compareValue to do whatever you need. Yes yes... not operator overloading but it would world to get your comparison to work the way you want. I'm doing something like this now in my scripts.
1/2