| 73 | QList<PDFDocumentWindow*> PDFDocumentWindow::docList; |
| 74 | |
| 75 | PDFDocumentWindow::PDFDocumentWindow(const QString &fileName, TeXDocumentWindow *texDoc) |
| 76 | : pdfWidget(nullptr) |
| 77 | , scrollArea(nullptr) |
| 78 | , toolButtonGroup(nullptr) |
| 79 | , pageLabel(nullptr) |
| 80 | , scaleLabel(nullptr) |
| 81 | , _fullScreenManager(nullptr) |
| 82 | , _syncHighlight(nullptr) |
| 83 | , openedManually(false) |
| 84 | { |
| 85 | init(); |
| 86 | |
| 87 | if (!texDoc) |
| 88 | openedManually = true; |
| 89 | |
| 90 | loadFile(fileName); |
| 91 | |
| 92 | QMap<QString,QVariant> properties = TWApp::instance()->getFileProperties(curFile); |
| 93 | if (properties.contains(QString::fromLatin1("geometry"))) |
| 94 | restoreGeometry(properties.value(QString::fromLatin1("geometry")).toByteArray()); |
| 95 | else |
| 96 | Tw::Utils::WindowManager::zoomToHalfScreen(this, true); |
| 97 | |
| 98 | if (properties.contains(QString::fromLatin1("state"))) |
| 99 | restoreState(properties.value(QString::fromLatin1("state")).toByteArray(), kPDFWindowStateVersion); |
| 100 | |
| 101 | if (properties.contains(QString::fromLatin1("pdfPageMode"))) |
| 102 | setPageMode(properties.value(QString::fromLatin1("pdfPageMode"), -1).toInt()); |
| 103 | |
| 104 | #if QT_VERSION < QT_VERSION_CHECK(5, 4, 0) |
| 105 | QTimer::singleShot(100, this, SLOT(setDefaultScale())); |
| 106 | #else |
| 107 | QTimer::singleShot(100, this, &PDFDocumentWindow::setDefaultScale); |
| 108 | #endif |
| 109 | |
| 110 | if (texDoc) { |
| 111 | stackUnder(texDoc); |
| 112 | actionSide_by_Side->setEnabled(true); |
| 113 | actionGo_to_Source->setEnabled(true); |
| 114 | sourceDocList.append(texDoc); |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | PDFDocumentWindow::~PDFDocumentWindow() |
| 119 | { |
nothing calls this directly
no test coverage detected