Class: Qt::Base

Inherits:
Object show all
Defined in:
lib/qtext/extensions.rb

Instance Method Summary collapse

Instance Method Details

#override_cursor(cursor_constant, &block) ⇒ Object

use the cursor constant for the application override cursor while the block is executing. Return the value of the block



64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/qtext/extensions.rb', line 64

def override_cursor( cursor_constant, &block )
  Qt::Application.setOverrideCursor( Qt::Cursor.new( cursor_constant ) )
  exception = nil
  begin
    retval = yield
  rescue Exception => e
    #~ puts e.message
    #~ puts e.backtrace
    exception = e
  end
  Qt::Application.restoreOverrideCursor
  Kernel.raise exception unless exception.nil?
  retval
end