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