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

Possibly unused code #66

Closed
tianjiaoding opened this issue Feb 14, 2018 · 5 comments
Closed

Possibly unused code #66

tianjiaoding opened this issue Feb 14, 2018 · 5 comments
Milestone

Comments

@tianjiaoding
Copy link

listLayout.addWidget(self.editButton)#, 0, Qt.AlignCenter)

in labelme/app.py
line 117 - 125
listLayout = QVBoxLayout() listLayout.setContentsMargins(0, 0, 0, 0) listLayout.addWidget(self.labelList) self.editButton = QToolButton() self.editButton.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) self.labelListContainer = QWidget() self.labelListContainer.setLayout(listLayout) listLayout.addWidget(self.editButton)#, 0, Qt.AlignCenter) listLayout.addWidget(self.labelList)

  1. The listLayout added self.labelList twice.
  2. The listLayout added self.editButton, but I didn't see the button in the polygon labels dock. I tested by drawing multiple polygons and delete them, however, there's no sign of this button. Maybe I didn't cover the right usage.
  3. The app works the same if I delete the last two lines of the snippet.

git blame shows that the code was introduced like 6 years ago. The readability will be improved if unused code is deleted.

@tianjiaoding
Copy link
Author

My apologies. I just turned on advanced mode and saw the edit button. However, I don't quite understand the purpose of adding self.labelList twice. Could someone please explain this a little bit?

@wkentaro wkentaro self-assigned this Mar 4, 2018
@wkentaro
Copy link
Owner

wkentaro commented Mar 4, 2018

Hmm, sorry, but that's not where I wrote. And I can't explain it at this moment.

@wkentaro wkentaro added the help wanted Extra attention is needed label Mar 17, 2018
@wkentaro wkentaro removed their assignment Mar 24, 2018
wkentaro added a commit that referenced this issue Apr 10, 2018
@wkentaro
Copy link
Owner

I found you're right, and the line can be removed.
This will be resolved via #121

wkentaro added a commit that referenced this issue Apr 10, 2018
@tianjiaoding
Copy link
Author

tianjiaoding commented Apr 10, 2018 via email

@wkentaro
Copy link
Owner

Yeah, nice catch. Thanks!

@wkentaro wkentaro removed the help wanted Extra attention is needed label Apr 15, 2018
@wkentaro wkentaro added this to the 2.11.0 milestone May 2, 2018
wkentaro added a commit that referenced this issue Dec 26, 2018
codebaragi23 pushed a commit to codebaragi23/mindAT that referenced this issue Dec 23, 2020
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

No branches or pull requests

2 participants