[Kde-bindings] QString/QByteArray overloaded method call
Nicolas Vinot
aeris at imirhil.fr
Thu Oct 24 09:01:52 UTC 2013
Hi everybody,
I have some trouble with Qt bindings when a method is overloaded with 2
prototypes with QString and QByteArray at first argument.
For example, I want to use the QSvgWidget, which define
void QSvgWidget::load(const QByteArray& content)
void QSvgWidget::load(const QString& file)
I have to load my data by SVG content and not by SVG filename, so I want to
call the QByteArray method :
@widget = Qt::SvgWidget.new(mainWindow)
svgData = "…"
@widget.load Qt::ByteArray.new(svgData)
But seems the Qt Bindings try to reconvert the QByteArray to QString and call
the wrong QString method :
/home/nicolas/.rbenv/versions/2.0.0-
p247/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in
`load': no implicit conversion of Qt::ByteArray into String (TypeError)
Enclosed to this email a full debug stack of the call, which show 2 Qt call
attempts (QByteArray::toPath and QByteArray::toStr)
Is there any way to specify to the Qt bindings which method I really want to
call in case of ambiguous overloaded methods from a Ruby point of view ?
Regards,
--
Nicolas Vinot
-------------- next part --------------
A non-text attachment was scrubbed...
Name: debug.log
Type: text/x-log
Size: 18158 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20131024/132a046b/attachment.log>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20131024/132a046b/attachment.sig>
More information about the Kde-bindings
mailing list