[Kde-bindings] C++ implicit type conversion rules?

Richard Dale rdale at foton.es
Thu Aug 9 11:08:20 UTC 2007


In plasma applets code there tend to be a lot of implicit conversions between 
QSizeF <=> QSize, and QRectF <=> QRect, which need to be done explicitly in 
ruby. I've searched with google, but still don't really understand the c++ 
rules. I thought you needed an operator assignment method like this in QUrl 
to make it work:

QUrl &operator =(const QString &url);

But I get the impression that just this constructor would allow a QString to 
be passed everywhere that a QUrl is expected:

QUrl(const QString &url);

I that is so, then we can add some implicit type conversion operator methods 
to the Qyoto C# code by writing a script to pull out all the constructors 
with single arguments that aren't copy constructors.

-- Richard



More information about the Kde-bindings mailing list