Clean up some redundant code and fix annotations

This commit is contained in:
Veronica Berglyd Olsen
2023-11-29 16:05:14 +01:00
parent 1d1dae0c7e
commit b526315084
8 changed files with 29 additions and 57 deletions
-13
View File
@@ -38,7 +38,6 @@ from urllib.request import pathname2url
from PyQt5.QtGui import QDesktopServices
from PyQt5.QtCore import QCoreApplication, QUrl
from PyQt5.QtWidgets import QWidget, qApp
from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout
from novelwriter.error import logException
@@ -508,18 +507,6 @@ def openExternalPath(path: Path) -> bool:
return False
# =============================================================================================== #
# Other Functions
# =============================================================================================== #
def getGuiItem(objName: str) -> QWidget | None:
"""Returns a QtWidget based on its objectName."""
for qWidget in qApp.topLevelWidgets():
if qWidget.objectName() == objName:
return qWidget
return None
# =============================================================================================== #
# Classes
# =============================================================================================== #