Checkbox and radio form fields

This commit is contained in:
Jakub Melka
2020-05-02 18:04:25 +02:00
parent bfb26c4807
commit f604dd77b2
14 changed files with 584 additions and 23 deletions

View File

@ -277,6 +277,7 @@ PDFViewerMainWindow::PDFViewerMainWindow(QWidget* parent) :
m_annotationManager->setFormManager(m_formManager);
m_pdfWidget->setFormManager(m_formManager);
connect(m_formManager, &pdf::PDFFormManager::actionTriggered, this, &PDFViewerMainWindow::onActionTriggered);
connect(m_formManager, &pdf::PDFFormManager::documentModified, this, &PDFViewerMainWindow::onDocumentModified);
connect(m_pdfWidget->getDrawWidgetProxy(), &pdf::PDFDrawWidgetProxy::drawSpaceChanged, this, &PDFViewerMainWindow::onDrawSpaceChanged);
connect(m_pdfWidget->getDrawWidgetProxy(), &pdf::PDFDrawWidgetProxy::pageLayoutChanged, this, &PDFViewerMainWindow::onPageLayoutChanged);
@ -982,6 +983,13 @@ void PDFViewerMainWindow::onDocumentReadingFinished()
updateActionsAvailability();
}
void PDFViewerMainWindow::onDocumentModified(pdf::PDFDocumentPointer document, pdf::PDFModifiedDocument::ModificationFlags flags)
{
m_pdfDocument = document;
pdf::PDFModifiedDocument modifiedDocument(m_pdfDocument.data(), m_optionalContentActivity, flags);
setDocument(modifiedDocument);
}
void PDFViewerMainWindow::setDocument(pdf::PDFModifiedDocument document)
{
if (document.hasReset())