module ModelUtils

Public Instance Methods

inserting_rows(parent, first, last) { || ... } click to toggle source

Helper method to insert model rows from within a block. This method ensures that the appropriate begin/end functions are called.

# File lib/rui/toolkits/qtbase/qt.rb, line 483
def inserting_rows(parent, first, last)
  if first > last
    yield
  else
    begin
      begin_insert_rows(parent || Qt::ModelIndex.new, first, last)
      yield
    ensure
      end_insert_rows
    end
  end
end
removing_rows(parent, first, last) { || ... } click to toggle source

Helper method to delete model rows from within a block. This method ensures that the appropriate begin/end functions are called.

# File lib/rui/toolkits/qtbase/qt.rb, line 466
def removing_rows(parent, first, last)
  if first > last
    yield
  else
    begin
      begin_remove_rows(parent || Qt::ModelIndex.new, first, last)
      yield
    ensure
      end_remove_rows
    end
  end
end