<HTML dir=ltr><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#000000 size=2>Hi, </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I wonder if you can help. I'm currently exploring rubyqt in conjunction with the latest QT4 libraries. However, I can't seem to get a TextEdit widget to refresh properly. My code runs correctly when I click the button that has a ruby function assigned to it, but the TextEdit field does not update until the ruby function completes.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Here's the code I'm using:-</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>--------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2>main.rb</FONT></DIV>
<DIV><FONT face=Arial size=2>----------</FONT></DIV>
<DIV>require 'Qt'<BR>require 'dialog.rb'</DIV>
<DIV>app = Qt::Application.new(ARGV)<BR>dialog = Dialog.new<BR>dialog.exec</DIV>
<DIV> </DIV>
<DIV>------</DIV>
<DIV>dialog.rb</DIV>
<DIV>-------</DIV>
<DIV> </DIV>
<DIV>class MyWidget < Qt::Widget<BR>  slots 'go()'<BR>  def initialize(parent = nil)<BR>    super(parent)<BR>    setFixedSize(500, 500)<BR>    @textedit = Qt::TextEdit.new(self)<BR>    @textedit.setGeometry(5, 50, 480, 300)<BR> <BR>    quit = Qt::PushButton.new(('Generate'), self)<BR>    quit.setGeometry(5, 5, 100, 30)<BR>    quit.setFont(Qt::Font.new('Arial', 12, Qt::Font::Bold))<BR>    connect(quit, SIGNAL(:clicked)) <A href="mailto:{@textedit.clear">{@textedit.clear</A>();  go() }<BR>  end<BR>   <BR>  def go<BR>      #   @textedit.clear()<BR>      @textedit.setText("Generating files:-")<BR>      count = 0<BR>      50.times do<BR>        count+=1<BR>        sleep 0.1<BR>        @textedit.append("Generating file: "+count.to_s)    <BR>        puts "hello"<BR>      end<BR>      @textedit.append("Done") <BR>  end<BR>end<BR>app = Qt::Application.new(ARGV)</DIV>
<DIV>widget = MyWidget.new()<BR>widget.show()<BR>app.exec()<BR></DIV>
<DIV><FONT face=Arial size=2>-------------------------------------------------------------------------------------------------</FONT></DIV></BODY></HTML>