devctrl.gui.exception.uncaught_hook.UncaughtWarningHook#

class UncaughtWarningHook(*args, show_traceback: bool = False, logger: Logger | None = None, **kwargs)[source]#

Bases: QObject

Methods

Attributes

__annotations__ = {}#
__dict__ = mappingproxy({'__module__': 'devctrl.gui.exception.uncaught_hook', '__firstlineno__': 81, '__doc__': 'Mechanism to catch, log and display warnings emitted using ``warnings.warn``.\n\nWarnings are "caught" here. The warning is logged using ``log.warning()`` and additionally passed to which may show an error dialog (see :func:`.show_exception_box`).\n', '_warning_caught': <unbound PYQT_SIGNAL _warning_caught(PyQt_PyObject)>, '__init__': <function UncaughtWarningHook.__init__>, 'showwarning': <function UncaughtWarningHook.showwarning>, '__static_attributes__': ('_logger', '_original_showwarning', 'show_traceback'), '__annotations__': {}})#
__firstlineno__ = 81#
classmethod __getattr__(self, name: str | None) Any#
__init__(*args, show_traceback: bool = False, logger: Logger | None = None, **kwargs)[source]#

Instantiate an excption hook

Parameters:
  • show_traceback – Whether to include the traceback in the exception message.

  • logger – A logger to use. If logger is None, the logger of this module is used.

  • show_exception_func – A function to call when an exception occurs.

__module__ = 'devctrl.gui.exception.uncaught_hook'#
classmethod __new__(*args, **kwargs)#
__static_attributes__ = ('_logger', '_original_showwarning', 'show_traceback')#
__weakref__#

list of weak references to the object

_warning_caught#
classmethod blockSignals(self, b: bool) bool#
classmethod childEvent(self, a0: QChildEvent | None)#
classmethod children(self) list[QObject]#
classmethod connectNotify(self, signal: QMetaMethod)#
classmethod customEvent(self, a0: QEvent | None)#
classmethod deleteLater(self)#
destroyed#
classmethod disconnect(a0: QMetaObject.Connection) bool#
classmethod disconnect(self)
classmethod disconnectNotify(self, signal: QMetaMethod)#
classmethod dumpObjectInfo(self)#
classmethod dumpObjectTree(self)#
classmethod dynamicPropertyNames(self) list[QByteArray]#
classmethod event(self, a0: QEvent | None) bool#
classmethod eventFilter(self, a0: QObject | None, a1: QEvent | None) bool#
classmethod findChild(self, type: type[QObjectT], name: str | None = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObjectT#
classmethod findChild(self, types: tuple[type[QObjectT], ...], name: str | None = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObjectT
classmethod findChildren(self, type: type[QObjectT], name: str | None = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) list[QObjectT]#
classmethod findChildren(self, types: tuple[type[QObjectT], ...], name: str | None = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) list[QObjectT]
classmethod findChildren(self, type: type[QObjectT], re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) list[QObjectT]
classmethod findChildren(self, types: tuple[type[QObjectT], ...], re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) list[QObjectT]
classmethod inherits(self, classname: str | None) bool#
classmethod installEventFilter(self, a0: QObject | None)#
classmethod isQuickItemType(self) bool#
classmethod isSignalConnected(self, signal: QMetaMethod) bool#
classmethod isWidgetType(self) bool#
classmethod isWindowType(self) bool#
classmethod killTimer(self, id: int)#
classmethod metaObject(self) QMetaObject | None#
classmethod moveToThread(self, thread: QThread | None)#
classmethod objectName(self) str#
objectNameChanged#
classmethod parent(self) QObject | None#
classmethod property(self, name: str | None) Any#
classmethod pyqtConfigure(...)#

Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.

classmethod receivers(self, signal: PYQT_SIGNAL) int#
classmethod removeEventFilter(self, a0: QObject | None)#
classmethod sender(self) QObject | None#
classmethod senderSignalIndex(self) int#
classmethod setObjectName(self, name: QByteArray | bytes | bytearray | memoryview | str | None)#
classmethod setParent(self, a0: QObject | None)#
classmethod setProperty(self, name: str | None, value: Any) bool#
showwarning(message: str, category: type[Warning], filename: str, lineno, file=None, line=None)[source]#

Function handling warnings.

classmethod signalsBlocked(self) bool#
classmethod startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int#
staticMetaObject = <PyQt6.QtCore.QMetaObject object>#
classmethod thread(self) QThread | None#
classmethod timerEvent(self, a0: QTimerEvent | None)#
classmethod tr(sourceText: str | None, disambiguation: str | None = None, n: int = -1) str#