Skip to content
Snippets Groups Projects
Commit 0c66d5ea authored by Kentaro Wada's avatar Kentaro Wada
Browse files

Refactor labelme/labelDialog.py

parent a1c1ef65
Branches
No related tags found
No related merge requests found
......@@ -36,9 +36,6 @@ from .lib import newIcon
# - Calculate optimal position so as not to go out of screen area.
BB = QtWidgets.QDialogButtonBox
class LabelQLineEdit(QtWidgets.QLineEdit):
def setListWidget(self, list_widget):
......@@ -63,9 +60,13 @@ class LabelDialog(QtWidgets.QDialog):
layout = QtWidgets.QVBoxLayout()
layout.addWidget(self.edit)
# buttons
self.buttonBox = bb = BB(BB.Ok | BB.Cancel, QtCore.Qt.Horizontal, self)
bb.button(BB.Ok).setIcon(newIcon('done'))
bb.button(BB.Cancel).setIcon(newIcon('undo'))
self.buttonBox = bb = QtWidgets.QDialogButtonBox(
QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel,
QtCore.Qt.Horizontal,
self,
)
bb.button(bb.Ok).setIcon(newIcon('done'))
bb.button(bb.Cancel).setIcon(newIcon('undo'))
bb.accepted.connect(self.validate)
bb.rejected.connect(self.reject)
layout.addWidget(bb)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment