Browse Source

Fixed error/bug when hitting the CTRL Modifier key before entering the main window with the mouse.

master
Christian Voigt 1 year ago
parent
commit
21839bb5df
  1. 7
      world_regions_widget/__init__.py
  2. 2
      world_regions_widget/region_label_collection.py

7
world_regions_widget/__init__.py

@ -151,7 +151,12 @@ class WorldRegionsWidget(QScrollArea):
def trigger_cursor_change(self, event=None):
modifiers = QApplication.keyboardModifiers()
if modifiers == Qt.ControlModifier or (event is not None and event.key() in (16777249, 16777250)):
if self.currently_hovered_region.is_marked:
try:
currently_hovered_region_is_marked = self.currently_hovered_region.is_marked
except AttributeError:
currently_hovered_region_is_marked = None
if currently_hovered_region_is_marked:
self.setCursor(self.cursor_remove_region)
else:
self.setCursor(self.cursor_add_region)

2
world_regions_widget/region_label_collection.py

@ -5,8 +5,6 @@ from PyQt5.QtWidgets import (
from .region_label import RegionLabel
from formatter import Formatter
class RegionLabelCollection(QGridLayout):
label_collection = dict

Loading…
Cancel
Save