[Kde-bindings] rbuic problem ?

Thibauld Favre tfavre at mandrakesoft.com
Fri Oct 8 08:33:11 UTC 2004


Le Vendredi 8 Octobre 2004 03:26, Richard Dale a écrit :
> > The warnings are when there is an existing method with the same name at
> > the attribute accessor. Not all the instance variables had attribute
> > accessors generated - the layout managers didn't for instance. I think
> > the main widgets should be visible from outside, I don't think that
> > breaks encapsulation. But if there is an attr_reader method, a method
> > with the same name shouldn't be generated to suppress the warning.
>
> I've tried generating a C++ .h and .cpp file from ContratsDlgUI.ui and
> compile it, and I get:
>
> ContratsDlgUi.h:143: declaration of `virtual void ContratsDlgUi::nextExp()'
> ContratsDlgUi.h:72: conflicts with previous declaration `
>    KPushButton*ContratsDlgUi::nextExp'
> ContratsDlgUi.h:144: declaration of `virtual void ContratsDlgUi::nextSup()'
> ContratsDlgUi.h:104: conflicts with previous declaration `
>    KPushButton*ContratsDlgUi::nextSup'
> ContratsDlgUi.h:145: declaration of `virtual void
> ContratsDlgUi::nextProd()' ContratsDlgUi.h:134: conflicts with previous
> declaration `
>    KPushButton*ContratsDlgUi::nextProd'
>
> As opposed to the rbuic:
>
> On Thursday 07 October 2004 16:46, Thibauld Favre wrote:
> > ./ContratsDlgUi.rb:836: warning: method redefined; discarding old nextExp
> > ./ContratsDlgUi.rb:840: warning: method redefined; discarding old nextSup
> > ./ContratsDlgUi.rb:844: warning: method redefined; discarding old
> > nextProd
>
> So I'm not sure this is a bug in rbuic because you get a compile error in
> C++ generated code too for the same reason. I think Qt Designer should
> prevent you from defining an instance variable and slot with the same name.

Aaarrgh :) You're right ! I'm gonna have to modify all my ui, pfff..... Do you 
think I should report a bug to Trolltech ? After all, the applications worked 
before defining the accessors, and as it fails to compile with C++ code, they 
could say that ruby raise an error too...

Otherwise, I updated korundum and the crash disappeared.

Thanks,

Thibauld



More information about the Kde-bindings mailing list