Sha256: 346ea8302b4e69dce2b884daac17b3ea395027d57717093bbd6e20da7e7b637a
Contents?: true
Size: 1.43 KB
Versions: 2
Compression:
Stored size: 1.43 KB
Contents
require 'Qt4' module Qt class KeyEvent def inspect "<Qt::KeyEvent text=#{text} key=#{key}" end end end module Clevic class ItemDelegate < Qt::ItemDelegate attr_reader :field def initialize( parent, field ) super( parent ) @field = field end def attribute field.attribute end def entity_class field.entity_class end def find_options field.find_options end # Figure out where to put the editor widget, taking into # account the sizes of the headers 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 ) #~ end # This is called when one of the EditTriggers is pressed. So # it's only good for opening a generic keystroke editor, not # a specific one, eg a calendar-style date editor. #~ def createEditor( parent_widget, style_option_view_item, model_index ) #~ end # Set the data for the given editor widget #~ def setEditorData( editor_widget, model_index ) #~ end # Set the data for the given model and index from the given #~ def setModelData( editor_widget, abstract_item_model, model_index ) #~ end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
clevic-0.12.0 | lib/clevic/item_delegate.rb |
clevic-0.11.1 | lib/clevic/item_delegate.rb |