Merge branch 'main' into dev

This commit is contained in:
Veronica Berglyd Olsen
2024-01-27 17:04:44 +01:00
23 changed files with 3219 additions and 2805 deletions
+10 -1
View File
@@ -27,7 +27,7 @@ from __future__ import annotations
import logging
from time import time
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, TypeVar
from pathlib import Path
from PyQt5.QtCore import QObject, QRunnable, QThreadPool, pyqtSignal
@@ -43,6 +43,8 @@ if TYPE_CHECKING: # pragma: no cover
logger = logging.getLogger(__name__)
NWWidget = TypeVar("NWWidget", bound=QWidget)
class SharedData(QObject):
@@ -230,6 +232,13 @@ class SharedData(QObject):
)
return Path(projFile) if projFile else None
def findTopLevelWidget(self, kind: type[NWWidget]) -> NWWidget | None:
"""Find a top level widget."""
for widget in self.mainGui.children():
if isinstance(widget, kind):
return widget
return None
##
# Signal Proxy
##