[Qt-interest] Overloaded operator as slot

Scott Sibley sisibley at gmail.com
Sun Nov 1 03:33:08 CET 2009


>From what I've gathered overloaded operators can't be slots. It would be
handy if they could be -- in at least one case, the () operator. In QtScript
the functor could be used on the Javascript side of things, instead of a
method of the object. So "meminfo.Meminfo('Active')" becomes simply
"meminfo('Active')". I imagine there are other scenarios where overloaded
operators as slots might be useful. Some would be useless on the Javascript
side, for instance the << and >> operators.

Now there may be another way of providing a method (without the prefixed
object notation) similar to the functor. If there is, please let me know.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091031/e3d3b1c9/attachment.html 


More information about the Qt-interest-old mailing list