fix: 修复bug97212

Description: 鼠标释放的时候重置状态

Log: 与编辑区域有关系
Bug: https://pms.uniontech.com/zentao/bug-view-97212.html
Change-Id: If3ea5ad764d6d4b18292866258d4c54670a3b97d
This commit is contained in:
liuminghang 2021-09-29 15:58:00 +08:00
parent 23bc192c04
commit 8417cc96fd
2 changed files with 13 additions and 1 deletions

View File

@ -162,6 +162,18 @@ void ResultTextView::mousePressEvent(QMouseEvent *e)
QPlainTextEdit::mousePressEvent(e); QPlainTextEdit::mousePressEvent(e);
} }
void ResultTextView::mouseReleaseEvent(QMouseEvent *e)
{
//修复一指滑动导致了ocr无法选择任何文本
if (e->type() == QEvent::MouseButtonRelease && e->source() == Qt::MouseEventSynthesizedByQt) {
qDebug() << "action is over" << m_gestureAction;
m_gestureAction = GA_null;
}
return QPlainTextEdit::mouseReleaseEvent(e);
}
bool ResultTextView::event(QEvent *event) bool ResultTextView::event(QEvent *event)
{ {
if (event->type() == QEvent::Gesture) if (event->type() == QEvent::Gesture)

View File

@ -18,7 +18,7 @@ protected:
void resizeEvent(QResizeEvent *event) override; void resizeEvent(QResizeEvent *event) override;
void mouseMoveEvent(QMouseEvent *e) override; void mouseMoveEvent(QMouseEvent *e) override;
void mousePressEvent(QMouseEvent *e) override; void mousePressEvent(QMouseEvent *e) override;
void mouseReleaseEvent(QMouseEvent *e) override;
bool event(QEvent *event) override; bool event(QEvent *event) override;
//触摸屏功能函数 //触摸屏功能函数
bool gestureEvent(QGestureEvent *event); bool gestureEvent(QGestureEvent *event);