mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Annotation tooltips
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
#include "pdfdrawspacecontroller.h"
|
||||
#include "pdfcompiler.h"
|
||||
#include "pdfwidgettool.h"
|
||||
#include "pdfannotation.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QGridLayout>
|
||||
@ -232,6 +233,17 @@ void PDFDrawWidgetBase<BaseWidget>::keyPressEvent(QKeyEvent* event)
|
||||
}
|
||||
}
|
||||
|
||||
if (PDFWidgetAnnotationManager* annotationManager = getPDFWidget()->getDrawWidgetProxy()->getAnnotationManager())
|
||||
{
|
||||
annotationManager->keyPressEvent(this, event);
|
||||
setToolTip(annotationManager->getTooltip());
|
||||
if (event->isAccepted())
|
||||
{
|
||||
updateCursor();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Vertical navigation
|
||||
QScrollBar* verticalScrollbar = m_widget->getVerticalScrollbar();
|
||||
if (verticalScrollbar->isVisible())
|
||||
@ -275,6 +287,17 @@ void PDFDrawWidgetBase<BaseWidget>::mousePressEvent(QMouseEvent* event)
|
||||
}
|
||||
}
|
||||
|
||||
if (PDFWidgetAnnotationManager* annotationManager = getPDFWidget()->getDrawWidgetProxy()->getAnnotationManager())
|
||||
{
|
||||
annotationManager->mousePressEvent(this, event);
|
||||
setToolTip(annotationManager->getTooltip());
|
||||
if (event->isAccepted())
|
||||
{
|
||||
updateCursor();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (event->button() == Qt::LeftButton)
|
||||
{
|
||||
m_mouseOperation = MouseOperation::Translate;
|
||||
@ -301,6 +324,17 @@ void PDFDrawWidgetBase<BaseWidget>::mouseReleaseEvent(QMouseEvent* event)
|
||||
}
|
||||
}
|
||||
|
||||
if (PDFWidgetAnnotationManager* annotationManager = getPDFWidget()->getDrawWidgetProxy()->getAnnotationManager())
|
||||
{
|
||||
annotationManager->mouseReleaseEvent(this, event);
|
||||
setToolTip(annotationManager->getTooltip());
|
||||
if (event->isAccepted())
|
||||
{
|
||||
updateCursor();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
performMouseOperation(event->pos());
|
||||
|
||||
switch (m_mouseOperation)
|
||||
@ -338,6 +372,17 @@ void PDFDrawWidgetBase<BaseWidget>::mouseMoveEvent(QMouseEvent* event)
|
||||
}
|
||||
}
|
||||
|
||||
if (PDFWidgetAnnotationManager* annotationManager = getPDFWidget()->getDrawWidgetProxy()->getAnnotationManager())
|
||||
{
|
||||
annotationManager->mouseMoveEvent(this, event);
|
||||
setToolTip(annotationManager->getTooltip());
|
||||
if (event->isAccepted())
|
||||
{
|
||||
updateCursor();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
performMouseOperation(event->pos());
|
||||
updateCursor();
|
||||
event->accept();
|
||||
@ -395,6 +440,17 @@ void PDFDrawWidgetBase<BaseWidget>::wheelEvent(QWheelEvent* event)
|
||||
}
|
||||
}
|
||||
|
||||
if (PDFWidgetAnnotationManager* annotationManager = getPDFWidget()->getDrawWidgetProxy()->getAnnotationManager())
|
||||
{
|
||||
annotationManager->wheelEvent(this, event);
|
||||
setToolTip(annotationManager->getTooltip());
|
||||
if (event->isAccepted())
|
||||
{
|
||||
updateCursor();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Qt::KeyboardModifiers keyboardModifiers = QApplication::keyboardModifiers();
|
||||
|
||||
PDFDrawWidgetProxy* proxy = m_widget->getDrawWidgetProxy();
|
||||
|
Reference in New Issue
Block a user