提交 5d79a467 编写于 作者: H HinGwenWoong

Show label count in the dock title

上级 8091e348
...@@ -191,7 +191,8 @@ class MainWindow(QMainWindow): ...@@ -191,7 +191,8 @@ class MainWindow(QMainWindow):
# Connect to itemChanged to detect checkbox changes. # Connect to itemChanged to detect checkbox changes.
self.labelList.itemChanged.connect(self.labelItemChanged) self.labelList.itemChanged.connect(self.labelItemChanged)
self.labelListDock = QDockWidget(getStr('recognitionResult'), self) self.labelListDockName = getStr('recognitionResult')
self.labelListDock = QDockWidget(self.labelListDockName, self)
self.labelListDock.setWidget(self.labelList) self.labelListDock.setWidget(self.labelList)
self.labelListDock.setFeatures(QDockWidget.NoDockWidgetFeatures) self.labelListDock.setFeatures(QDockWidget.NoDockWidgetFeatures)
listLayout.addWidget(self.labelListDock) listLayout.addWidget(self.labelListDock)
...@@ -204,7 +205,8 @@ class MainWindow(QMainWindow): ...@@ -204,7 +205,8 @@ class MainWindow(QMainWindow):
self.BoxList.itemDoubleClicked.connect(self.editBox) self.BoxList.itemDoubleClicked.connect(self.editBox)
# Connect to itemChanged to detect checkbox changes. # Connect to itemChanged to detect checkbox changes.
self.BoxList.itemChanged.connect(self.boxItemChanged) self.BoxList.itemChanged.connect(self.boxItemChanged)
self.BoxListDock = QDockWidget(getStr('detectionBoxposition'), self) self.BoxListDockName = getStr('detectionBoxposition')
self.BoxListDock = QDockWidget(self.BoxListDockName, self)
self.BoxListDock.setWidget(self.BoxList) self.BoxListDock.setWidget(self.BoxList)
self.BoxListDock.setFeatures(QDockWidget.NoDockWidgetFeatures) self.BoxListDock.setFeatures(QDockWidget.NoDockWidgetFeatures)
listLayout.addWidget(self.BoxListDock) listLayout.addWidget(self.BoxListDock)
...@@ -976,6 +978,10 @@ class MainWindow(QMainWindow): ...@@ -976,6 +978,10 @@ class MainWindow(QMainWindow):
action.setEnabled(True) action.setEnabled(True)
self.updateComboBox() self.updateComboBox()
# update show counting
self.BoxListDock.setWindowTitle(self.BoxListDockName + f" ({self.BoxList.count()})")
self.labelListDock.setWindowTitle(self.labelListDockName + f" ({self.labelList.count()})")
def remLabels(self, shapes): def remLabels(self, shapes):
if shapes is None: if shapes is None:
# print('rm empty label') # print('rm empty label')
...@@ -1339,6 +1345,9 @@ class MainWindow(QMainWindow): ...@@ -1339,6 +1345,9 @@ class MainWindow(QMainWindow):
if len(select_indexes) > 0: if len(select_indexes) > 0:
self.file_dock.setWindowTitle(self.fileListName + f" ({select_indexes[0].row() + 1}" self.file_dock.setWindowTitle(self.fileListName + f" ({select_indexes[0].row() + 1}"
f"/{self.fileListWidget.count()})") f"/{self.fileListWidget.count()})")
# update show counting
self.BoxListDock.setWindowTitle(self.BoxListDockName + f" ({self.BoxList.count()})")
self.labelListDock.setWindowTitle(self.labelListDockName + f" ({self.labelList.count()})")
self.canvas.setFocus(True) self.canvas.setFocus(True)
return True return True
...@@ -1745,6 +1754,8 @@ class MainWindow(QMainWindow): ...@@ -1745,6 +1754,8 @@ class MainWindow(QMainWindow):
if self.noShapes(): if self.noShapes():
for action in self.actions.onShapesPresent: for action in self.actions.onShapesPresent:
action.setEnabled(False) action.setEnabled(False)
self.BoxListDock.setWindowTitle(self.BoxListDockName + f" ({self.BoxList.count()})")
self.labelListDock.setWindowTitle(self.labelListDockName + f" ({self.labelList.count()})")
def chshapeLineColor(self): def chshapeLineColor(self):
color = self.colorDialog.getColor(self.lineColor, u'Choose line color', color = self.colorDialog.getColor(self.lineColor, u'Choose line color',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册