I am using the Qt bindings from the qtbindings gem version 4.8.3, on ruby 1.9.3.
Qt::Variant.fromValue(Qt::Object.new) now fails (was working with older versions and/or with ruby 1.8, I honestly am not sure). However, after a bit of digging, it seems that the issue is related to the method resolution logic.
Turning rb_protect off in qvariant_from_value, I get the following backtrace (with it, the error is completely useless for whatever reason ...):
/home/doudou/dev/virgo/.gems/gems/qtbindings-4.8.3.0/lib/Qt/qtruby4.rb:2823:in `get_qinteger': undefined method `value' for #<Object:0x00000001b352d0> (NoMethodError)
from /home/doudou/dev/virgo/.gems/gems/qtbindings-4.8.3.0/lib/Qt/qtruby4.rb:2241:in `initialize'
from /home/doudou/dev/virgo/.gems/gems/qtbindings-4.8.3.0/lib/Qt/qtruby4.rb:2241:in `initialize'
from /home/doudou/dev/virgo/.gems/gems/qtbindings-4.8.3.0/lib/Qt/qtruby4.rb:2639:in `call'
from /home/doudou/dev/virgo/.gems/gems/qtbindings-4.8.3.0/lib/Qt/qtruby4.rb:2639:in `block in try_initialize'
from /home/doudou/dev/virgo/.gems/gems/qtbindings-4.8.3.0/lib/Qt/qtruby4.rb:2638:in `catch'
from /home/doudou/dev/virgo/.gems/gems/qtbindings-4.8.3.0/lib/Qt/qtruby4.rb:2638:in `try_initialize'
Turning on debug output, I then get the following logic:
Searching for QVariant#QVariant
Munged method names:
QVariant$
candidate list:
QVariant* QVariant::QVariant(QVariant::Type) (smoke: 0 index: 5442)
QVariant* QVariant::QVariant(int) (smoke: 0 index: 5447)
QVariant* QVariant::QVariant(unsigned int) (smoke: 0 index: 5448)
QVariant* QVariant::QVariant(long long) (smoke: 0 index: 5449)
QVariant* QVariant::QVariant(unsigned long long) (smoke: 0 index: 5450)
QVariant* QVariant::QVariant(bool) (smoke: 0 index: 5451)
QVariant* QVariant::QVariant(double) (smoke: 0 index: 5452)
QVariant* QVariant::QVariant(float) (smoke: 0 index: 5453)
QVariant* QVariant::QVariant(const QString&) (smoke: 0 index: 5456)
QVariant* QVariant::QVariant(Qt::GlobalColor) (smoke: 0 index: 5478)
matching => smoke: 0 index: 5442
QVariant::Type (U) score: 2
match => smoke: 0 index: 5442 score: 2 chosen: 5442
matching => smoke: 0 index: 5447
int (U) score: 2
****** warning: multiple methods with the same score of 2: 5442 and 5447
match => smoke: 0 index: 5447 score: 2 chosen: 5447
matching => smoke: 0 index: 5448
unsigned int (U) score: 2
****** warning: multiple methods with the same score of 2: 5447 and 5448
match => smoke: 0 index: 5448 score: 2 chosen: 5448
matching => smoke: 0 index: 5449
long long (U) score: 2
****** warning: multiple methods with the same score of 2: 5448 and 5449
match => smoke: 0 index: 5449 score: 2 chosen: 5449
matching => smoke: 0 index: 5450
unsigned long long (U) score: 2
****** warning: multiple methods with the same score of 2: 5449 and 5450
match => smoke: 0 index: 5450 score: 2 chosen: 5450
matching => smoke: 0 index: 5451
bool (U) score: 2
****** warning: multiple methods with the same score of 2: 5450 and 5451
match => smoke: 0 index: 5451 score: 2 chosen: 5451
matching => smoke: 0 index: 5452
double (U) score: 2
****** warning: multiple methods with the same score of 2: 5451 and 5452
match => smoke: 0 index: 5452 score: 2 chosen: 5452
matching => smoke: 0 index: 5453
float (U) score: 2
****** warning: multiple methods with the same score of 2: 5452 and 5453
match => smoke: 0 index: 5453 score: 2 chosen: 5453
matching => smoke: 0 index: 5456
const QString& (U) score: 1
match => smoke: 0 index: 5456 score: 1 chosen: 5453
matching => smoke: 0 index: 5478
Qt::GlobalColor (U) score: 2
****** warning: multiple methods with the same score of 2: 5453 and 5478
match => smoke: 0 index: 5478 score: 2 chosen: 5478
This look very wrong as none of the constructors should match ...
|