Add `GodWidget.iter_linked()` interator over linked split charts

history_view
Tyler Goodlet 2022-09-06 21:18:41 -04:00
parent 8e07fda88f
commit 271e378ce3
1 changed files with 10 additions and 5 deletions

View File

@ -19,7 +19,11 @@ High level chart-widget apis.
''' '''
from __future__ import annotations from __future__ import annotations
from typing import Optional, TYPE_CHECKING from typing import (
Iterator,
Optional,
TYPE_CHECKING,
)
from PyQt5 import QtCore, QtWidgets from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import ( from PyQt5.QtCore import (
@ -308,10 +312,11 @@ class GodWidget(QWidget):
self._resizing = False self._resizing = False
def get_cursor(self) -> Cursor: def get_cursor(self) -> Cursor:
c = self._active_cursor return self._active_cursor
assert c
return c
def iter_linked(self) -> Iterator[LinkedSplits]:
for linked in [self.hist_linked, self.rt_linked]:
yield linked
class ChartnPane(QFrame): class ChartnPane(QFrame):