Class: FilteredDataStreamListModel
- Inherits:
-
Qt::SortFilterProxyModel
- Object
- Qt::SortFilterProxyModel
- FilteredDataStreamListModel
- Defined in:
- lib/roby/log/gui/data_displays.rb
Instance Attribute Summary collapse
-
#display ⇒ Object
readonly
Returns the value of attribute display.
-
#stream_combo ⇒ Object
readonly
Returns the value of attribute stream_combo.
-
#streams ⇒ Object
readonly
Returns the value of attribute streams.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #filterAcceptsRow(stream_row, stream_parent) ⇒ Object
-
#initialize(stream_combo, display, type, streams) ⇒ FilteredDataStreamListModel
constructor
A new instance of FilteredDataStreamListModel.
- #selectedStream ⇒ Object
Constructor Details
#initialize(stream_combo, display, type, streams) ⇒ FilteredDataStreamListModel
Returns a new instance of FilteredDataStreamListModel.
70 71 72 73 74 75 76 |
# File 'lib/roby/log/gui/data_displays.rb', line 70 def initialize(stream_combo, display, type, streams) super() @display = display @type = type @streams = streams @stream_combo = stream_combo end |
Instance Attribute Details
#display ⇒ Object (readonly)
Returns the value of attribute display.
69 70 71 |
# File 'lib/roby/log/gui/data_displays.rb', line 69 def display @display end |
#stream_combo ⇒ Object (readonly)
Returns the value of attribute stream_combo.
68 69 70 |
# File 'lib/roby/log/gui/data_displays.rb', line 68 def stream_combo @stream_combo end |
#streams ⇒ Object (readonly)
Returns the value of attribute streams.
67 68 69 |
# File 'lib/roby/log/gui/data_displays.rb', line 67 def streams @streams end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
67 68 69 |
# File 'lib/roby/log/gui/data_displays.rb', line 67 def type @type end |
Instance Method Details
#filterAcceptsRow(stream_row, stream_parent) ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/roby/log/gui/data_displays.rb', line 77 def filterAcceptsRow(stream_row, stream_parent) if s = streams[stream_row] s.type == type else false end end |
#selectedStream ⇒ Object
84 85 86 87 88 |
# File 'lib/roby/log/gui/data_displays.rb', line 84 def selectedStream() index = stream_combo.current_index index = self.index(index, 0, Qt::ModelIndex.new) display.stream = streams[mapToSource(index).row] end |