Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add label_list to event filter #134

Merged
merged 1 commit into from
Jan 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions labelCloud/view/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from typing import TYPE_CHECKING, Optional, Set

import pkg_resources
from labelCloud.view.startup_dialog import StartupDialog
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from PyQt5.QtCore import QEvent
from PyQt5.QtGui import QPixmap
Expand All @@ -25,6 +24,7 @@
from ..io.labels.config import LabelConfig
from ..labeling_strategies import PickingStrategy, SpanningStrategy
from .settings_dialog import SettingsDialog # type: ignore
from .startup_dialog import StartupDialog
from .status_manager import StatusManager
from .viewer import GLWidget

Expand Down Expand Up @@ -403,10 +403,10 @@ def set_checkbox_states(self) -> None:
# Collect, filter and forward events to viewer
def eventFilter(self, event_object, event) -> bool:
# Keyboard Events
# if (event.type() == QEvent.KeyPress) and (not self.line_edited_activated()):
if (event.type() == QEvent.KeyPress) and (
event_object == self
): # TODO: Cleanup old filter
if (event.type() == QEvent.KeyPress) and event_object in [
self,
self.label_list, # otherwise steals focus for keyboard shortcuts
]:
self.controller.key_press_event(event)
self.update_bbox_stats(self.controller.bbox_controller.get_active_bbox())
return True # TODO: Recheck pyqt behaviour
Expand Down