# Using qtruby with qtdesigner query

**URL:** <https://www.ruby-forum.com/t/using-qtruby-with-qtdesigner-query/75317>\
**Category:** Ruby\
**Created:** [November 9, 2006, 1:07am UTC](https://www.ruby-forum.com/t/using-qtruby-with-qtdesigner-query/75317 "2006-11-09T01:07:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nigel\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e95f7d/32.png) [@Nigel\_W](https://www.ruby-forum.com/u/Nigel_W)\
**Post date:** [November 9, 2006, 1:07am UTC](https://www.ruby-forum.com/t/using-qtruby-with-qtdesigner-query/75317/1 "2006-11-09T01:07:07Z")

</div>

Hi folks

I’ve recently started experimenting with qtruby and have decided to  
used qtdesigner to do the GUI.

Looking in the example “colortool” the file mainform.rb which is  
generated by rbuic calls a method init() which is then redefined  
in mainform.ui.rb.

My problem is that my equivalent of mainform.rb does not call init().

What do I have to do in qtdesigner to get it to call init().

Cheers  
Nigel

---

<div class="post-metadata">

**Author:** ![Nigel\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e95f7d/32.png) [@Nigel\_W](https://www.ruby-forum.com/u/Nigel_W)\
**Post date:** [November 9, 2006, 9:31am UTC](https://www.ruby-forum.com/t/using-qtruby-with-qtdesigner-query/75317/2 "2006-11-09T09:31:53Z")

</div>

Nigel W. wrote:

> What do I have to do in qtdesigner to get it to call init().  
> You need to use the Edit -\> Slots menu in Qt3 Designer to bring up a  
> dialog called ‘Edit Functions’ (confusing!). Then add a virtual  
> function called init() which takes no arguments, returns void and isn’t  
> a slot. When you use rbuic to generate the ruby code, it will add a  
> call to init() at the end of the initialize method for the form’s  
> class.

– Richard

---

<div class="post-metadata">

**Author:** ![Nigel\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e95f7d/32.png) [@Nigel\_W](https://www.ruby-forum.com/u/Nigel_W)\
**Post date:** [November 9, 2006, 8:20pm UTC](https://www.ruby-forum.com/t/using-qtruby-with-qtdesigner-query/75317/3 "2006-11-09T20:20:06Z")

</div>

On Thu, 9 Nov 2006 17:30:06 +0900  
“removed\_email\_address@domain.invalid” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 
> 
> – Richard

Works for me, thankyou.

Nigel
