33 from python_qt_binding.QtCore
import QEvent, QObject, Signal
37 """Signaler for for filtered events of an icon or title change of a widget.""" 39 hide_signal = Signal(object)
40 show_signal = Signal(object)
42 window_icon_changed_signal = Signal(object)
43 window_title_changed_signal = Signal(object)
46 super(WindowChangedSignaler, self).
__init__(parent)
48 self.setObjectName(
'WindowChangedSignaler__' + self._widget.objectName())
50 self._widget.installEventFilter(self)
53 if self._widget.isVisible():
54 self.show_signal.emit(self.
_widget)
56 self.hide_signal.emit(self.
_widget)
57 self.window_icon_changed_signal.emit(self.
_widget)
58 self.window_title_changed_signal.emit(self.
_widget)
61 if event.type() == QEvent.Hide:
62 self.hide_signal.emit(watched)
64 if event.type() == QEvent.Show:
65 self.show_signal.emit(watched)
67 if event.type() == QEvent.WindowIconChange:
71 self.window_icon_changed_signal.emit(watched)
74 if event.type() == QEvent.WindowTitleChange:
78 self.window_title_changed_signal.emit(watched)
81 return QObject.eventFilter(self, watched, event)
def eventFilter(self, watched, event)
def __init__(self, widget, parent=None)