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



58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/qtext/extensions.rb', line 58

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