Class: QML::Interface

Inherits:
Object
  • Object
show all
Defined in:
lib/qml/interface.rb

Class Method Summary collapse

Class Method Details

.call_method(obj, name, args) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/qml/interface.rb', line 4

def self.call_method(obj, name, args)
  begin
    obj.__send__ name, *args
  rescue => error
    notify_error(error)
    nil
  end
end

.notify_error(error) ⇒ Object

Called when an Ruby error is occured in executing Qt code.

Parameters:

  • error

    The error (or the exception)



15
16
17
18
19
# File 'lib/qml/interface.rb', line 15

def self.notify_error(error)
  warn "-- An error occured when running Ruby code from Qt --"
  warn "#{error.class.name}: #{error.message}"
  warn "Backtrace: \n\t#{error.backtrace.join("\n\t")}"
end