Class: Qt::Base
Instance Method Summary collapse
-
#override_cursor(cursor_constant, &block) ⇒ Object
use the cursor constant for the application override cursor while the block is executing.
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
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/qtext/extensions.rb', line 62 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 |