Bug 302672

Summary: qtruby exception when accessing QStyleOption::state (ArgumentError)
Product: [Developer tools] bindings Reporter: Florian Staudacher <florian_staudacher>
Component: generalAssignee: kde-bindings
Status: RESOLVED FIXED    
Severity: major CC: arno
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Florian Staudacher 2012-06-28 00:22:05 UTC
I am using 
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux], compiled with RVM,
and I have compiled qtruby from git (without phonon),
on Fedora 16.

When I try to run the pixelator example I get the following error:
`method_missing': Cannot handle 'QFlags<QStyle::StateFlag>&' as return-type of QStyleOption::state (ArgumentError)

As far as googling for that error message goes, it seems this is generated by smoke...

This is bad, because a packaged example doesn't work(!), 
and it completely breaks the rendering of custom item delegates with a little complexity.

Reproducible: Always

Steps to Reproduce:
1. use ruby 1.9.3 and qtruby from git
2. prepare to run the pixelator example (rcc the resources, etc.)
3. run the pixelator example
Actual Results:  
ruby exited with the above mentioned error

Expected Results:  
show the pixelator example

A very stripped down script, which, for me, reproduces the error every time, would be:

require 'Qt4'
test = Qt::StyleOption.new
puts test.state
Comment 1 Arno Rehn 2012-06-28 15:43:00 UTC
This error is related to smoke and should have been fixed in recent revisions. Please get smokegen from git and rebuild smokeqt (preferably also from git) and tell us if it works :)
The fix should be included in the 4.9 release if smokegen.
Comment 2 Florian Staudacher 2012-06-28 20:40:30 UTC
Thank you for the quick response!

I now got smokegen, smokeqt and qtruby from current git master and built them.
Unfortunately, that doesn't solve the issue. I am still getting the same error.
Comment 3 Arno Rehn 2012-07-02 12:55:36 UTC
I've just tried this myself, works flawlessly:
$ irb
irb(main):001:0> require 'Qt4'
=> true
irb(main):002:0> test = Qt::StyleOption.new
=> #<Qt::StyleOption:0x00000001a71808>
irb(main):003:0> test.state
=> 0
irb(main):004:0>

Are you sure that you're using the new smokegen version to build smokeqt? Does qtruby use the new version of smokeqt?
Comment 4 Florian Staudacher 2012-07-02 16:19:00 UTC
You're right, sorry.
It must have used the version from the package manager instead of the one I built, so I removed the pagages and rebuilt everything. Now it's working fine.

Thank you for your help!