Sha256: a5f2d01d2f929ddcb9546063308471f9b867e49fb8e4eceea44bcf0805ed706f

Contents?: true

Size: 769 Bytes

Versions: 13

Compression:

Stored size: 769 Bytes

Contents

module Clevic

class Delegate < Qt::ItemDelegate
  # Figure out where to put the editor widget, taking into
  # account the sizes of the headers
  # TODO most of the subclasses are probably the same as this
  def updateEditorGeometry( editor, style_option_view_item, model_index )
    rect = style_option_view_item.rect
    rect.set_width( [editor.size_hint.width,rect.width].max )
    rect.set_height( editor.size_hint.height )
    editor.set_geometry( rect )
  end

  # This catches the event that begins the edit process.
  def editorEvent( event, model, style_option_view_item, model_index )
    # See qt Clevic::TableView
    parent.respond_to?( "before_edit_index=" ) && parent.before_edit_index = model_index
    super
  end

end

end

require 'clevic/delegate'

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
clevic-0.14.6 lib/clevic/qt/delegate.rb
clevic-0.14.5 lib/clevic/qt/delegate.rb
clevic-0.14.4 lib/clevic/qt/delegate.rb
clevic-0.14.3 lib/clevic/qt/delegate.rb
clevic-0.14.2 lib/clevic/qt/delegate.rb
clevic-0.14.1 lib/clevic/qt/delegate.rb
clevic-0.14.0 lib/clevic/qt/delegate.rb
clevic-0.13.0.b12 lib/clevic/qt/delegate.rb
clevic-0.13.0.b11 lib/clevic/qt/delegate.rb
clevic-0.13.0.b10 lib/clevic/qt/delegate.rb
clevic-0.13.0.b9 lib/clevic/qt/delegate.rb
clevic-0.13.0.b6 lib/clevic/qt/delegate.rb
clevic-0.13.0.b5 lib/clevic/qt/delegate.rb