Class: AutosavePluginListView

Inherits:
Qt::ListView
  • Object
show all
Defined in:
plugins/autosave/autosave.rb

Overview

TODO:

Put under the correct namespace

Subclass of Qt::ListView which emits a signal whenever the model changes

Instance Method Summary (collapse)

Signal Summary

Instance Method Details

- (Object) model=(mod)

Override of Qt::ListView#model=

Besides calling super, it also connects to the model’s dataChanged signal to the view’s #items_changed signal (and disconnects the old model if necessary).



40
41
42
43
44
45
46
47
48
# File 'plugins/autosave/autosave.rb', line 40

def model= mod
  if model
    model.disconnect SIGNAL('dataChanged(QModelIndex, QModelIndex)'), self, SIGNAL(:items_changed)
  end
  super
  if model
    connect model, SIGNAL('dataChanged(QModelIndex, QModelIndex)'), self, SIGNAL(:items_changed)
  end
end

Signal Details

- items_changed

Signal emitted whenever some of the indexes in the model change