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