diff --git a/labelImg.py b/labelImg.py index efd8a2976..12ac91845 100755 --- a/labelImg.py +++ b/labelImg.py @@ -210,7 +210,7 @@ def __init__(self, default_filename=None, default_prefdef_class_file=None, defau self.file_dock.setFeatures(QDockWidget.DockWidgetFloatable) self.dock_features = QDockWidget.DockWidgetClosable | QDockWidget.DockWidgetFloatable - self.dock.setFeatures(self.dock.features() ^ self.dock_features) + self.dock.setFeatures(self.dock.features() ^ int(self.dock_features)) # Actions action = partial(new_action, self) diff --git a/libs/canvas.py b/libs/canvas.py index ca7986ff3..5793219d9 100644 --- a/libs/canvas.py +++ b/libs/canvas.py @@ -165,7 +165,7 @@ def mouseMoveEvent(self, ev): return # Polygon copy moving. - if Qt.RightButton & ev.buttons(): + if bool(Qt.RightButton) & bool(ev.buttons()): if self.selected_shape_copy and self.prev_point: self.override_cursor(CURSOR_MOVE) self.bounded_move_shape(self.selected_shape_copy, pos) @@ -176,7 +176,7 @@ def mouseMoveEvent(self, ev): return # Polygon/Vertex moving. - if Qt.LeftButton & ev.buttons(): + if bool(Qt.LeftButton) & bool(ev.buttons()): if self.selected_vertex(): self.bounded_move_vertex(pos) self.shapeMoved.emit()