From d568b5c64d2e0b0e0bb7fe0fb1e797e6afd2aed0 Mon Sep 17 00:00:00 2001 From: donnKey Date: Thu, 27 Jan 2022 15:12:42 -0800 Subject: [PATCH] Bug fix: can't click on any item sometimes: For example, enable preview immediately after recognizing a page: the whole page is selected and clicks do nothing. --- qt/src/hocr/OutputEditorHOCR.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qt/src/hocr/OutputEditorHOCR.cc b/qt/src/hocr/OutputEditorHOCR.cc index cd230f39..3e37f885 100644 --- a/qt/src/hocr/OutputEditorHOCR.cc +++ b/qt/src/hocr/OutputEditorHOCR.cc @@ -598,12 +598,13 @@ void OutputEditorHOCR::showItemProperties(const QModelIndex& index, const QModel QRect minBBox; if(currentItem->itemClass() == "ocr_page") { minBBox = currentItem->bbox(); + m_tool->clearSelection(); } else { for(const HOCRItem* child : currentItem->children()) { minBBox = minBBox.united(child->bbox()); } + m_tool->setSelection(currentItem->bbox(), minBBox); } - m_tool->setSelection(currentItem->bbox(), minBBox); } }