Skip to content

Commit 53418df

Browse files
committed
wip
1 parent cf8aa90 commit 53418df

File tree

5 files changed

+20
-2
lines changed

5 files changed

+20
-2
lines changed

pydm/data_plugins/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def plugin_for_address(address: str) -> Optional[PyDMPlugin]:
9191
if protocol:
9292
initialize_plugins_if_needed()
9393
try:
94-
return plugin_modules[str(protocol)]
94+
return plugin_modules[(str(protocol)).lower()]
9595
except KeyError:
9696
logger.exception("Could not find protocol for %r", address)
9797
# Catch all in case of improper plugin specification

pydm/tests/widgets/test_base.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,13 @@ def mock_exec_(*args):
197197
monkeypatch.setattr(QMenu, "exec_", mock_exec_)
198198

199199
mouse_event = QMouseEvent(
200-
QMouseEvent.MouseButtonRelease, pydm_label.rect().center(), Qt.RightButton, Qt.RightButton, Qt.ShiftModifier
200+
QMouseEvent.MouseButtonRelease,
201+
pydm_label.rect().center(), # localPos
202+
pydm_label.rect().center(), # windowPos
203+
pydm_label.rect().center(), # screenPos
204+
Qt.RightButton,
205+
Qt.RightButton,
206+
Qt.ShiftModifier
201207
)
202208
pydm_label.open_context_menu(mouse_event)
203209
assert "Context Menu displayed." in caplog.text

pydm/widgets/base.py

+6
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,9 @@ def __init__(self, init_channel=None):
675675
self._connected = False
676676
self.alarmSeverityChanged(self.ALARM_DISCONNECTED)
677677

678+
def eventFilter(self, obj, event):
679+
return super().eventFilter(obj, event)
680+
678681
def widget_ctx_menu(self):
679682
"""
680683
Fetch the Widget specific context menu which will be populated with additional tools by `assemble_tools_menu`.
@@ -1386,6 +1389,9 @@ def __init__(self, init_channel=None):
13861389
self._monitor_disp = False
13871390
super().__init__(init_channel=init_channel)
13881391

1392+
def eventFilter(self, obj, event):
1393+
return super().eventFilter(obj, event)
1394+
13891395
def init_for_designer(self):
13901396
"""
13911397
Method called after the constructor to tweak configurations for

pydm/widgets/label.py

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ def __init__(self, parent=None, init_channel=None):
6161
# (so we can avoid pyside6 throwing an error, see func def for more info)
6262
PostParentClassInitSetup(self)
6363

64+
def eventFilter(self, obj, event):
65+
return PyDMWidget.eventFilter(self, obj, event)
66+
6467
@Property(bool)
6568
def enableRichText(self):
6669
return self._enable_rich_text

pydm/widgets/scale.py

+3
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ def __init__(self, parent: Optional[QWidget] = None, init_channel: Optional[str]
412412
# (so we can avoid pyside6 throwing an error, see func def for more info)
413413
PostParentClassInitSetup(self)
414414

415+
def eventFilter(self, obj, event):
416+
return PyDMWidget.eventFilter(self. obj, event)
417+
415418
def update_labels(self) -> None:
416419
"""
417420
Update the limits and value labels with the correct values.

0 commit comments

Comments
 (0)