Skip to content

Conversation

@michaelitvin
Copy link

No description provided.

@maplelost
Copy link

maplelost commented Sep 27, 2024

Great! but you dont't need to add an extra signal to watch the mouseDoubleClick, you can simply add your code above, and it work

    def mouseDoubleClickEvent(self, ev):
        # extra 双击 shape 编辑其名称
        if ev.button() == QtCore.Qt.LeftButton and self.editing() and len(self.selectedShapes or []) == 1:
            STORE.edit_label()
            self.selectShapes([]) # prevent click but cancel, next time not trigger edit
            return
        # extra End

        if self.double_click != "close":
            return

        if (
                self.createMode == "polygon" and self.canCloseShape()
        ) or self.createMode in ["ai_polygon", "ai_mask"]:
            self.finalise()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants