QtRuby与DRb或EventMachine

den*_*que 3 ruby qt drb qtruby eventmachine

我想使用Qt在Ruby中编写一个应用程序,它将通过网络与其他实例进行通信.

如何将Qt的事件循环与DRb或EventMachine集成?

编辑:

当我有更多时间发布时,我找到了答案

den*_*que 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
Run Code Online (Sandbox Code Playgroud)