3

ネットワークを介して他のインスタンスと通信する Qt を使用して、Ruby でアプリケーションを作成したいと考えています。

Qt のイベント ループを DRb または EventMachine と統合するにはどうすればよいですか?

編集:

もっと時間があれば答えを見つけたので投稿します

4

1 に答える 1

6
require 'eventmachine'
require 'Qt4'

app = Qt::Application.new(ARGV)
hello_button = Qt::PushButton.new("Hello EventMachine")
hello_button.resize(100,20)
hello_button.show

EventMachine.run do
  EM.add_periodic_timer(0.01) do
    app.process_events
  end
end
于 2011-08-17T22:12:04.597 に答える