diff options
-rw-r--r-- | examples/pdfwidgets/pdfviewer/mainwindow.cpp | 2 | ||||
-rw-r--r-- | examples/pdfwidgets/pdfviewer/mainwindow.ui | 44 |
2 files changed, 39 insertions, 7 deletions
diff --git a/examples/pdfwidgets/pdfviewer/mainwindow.cpp b/examples/pdfwidgets/pdfviewer/mainwindow.cpp index d865a8bdd..8ef7a075e 100644 --- a/examples/pdfwidgets/pdfviewer/mainwindow.cpp +++ b/examples/pdfwidgets/pdfviewer/mainwindow.cpp @@ -87,6 +87,8 @@ void MainWindow::open(const QUrl &docLocation) { if (docLocation.isLocalFile()) { m_document->load(docLocation.toLocalFile()); + const auto documentTitle = m_document->metaData(QPdfDocument::Title).toString(); + setWindowTitle(!documentTitle.isEmpty() ? documentTitle : QStringLiteral("PDF Viewer")); } else { qCDebug(lcExample) << docLocation << "is not a valid local file"; QMessageBox::critical(this, tr("Failed to open"), tr("%1 is not a valid local file").arg(docLocation.toString())); diff --git a/examples/pdfwidgets/pdfviewer/mainwindow.ui b/examples/pdfwidgets/pdfviewer/mainwindow.ui index 7070619b9..251591d9a 100644 --- a/examples/pdfwidgets/pdfviewer/mainwindow.ui +++ b/examples/pdfwidgets/pdfviewer/mainwindow.ui @@ -6,17 +6,41 @@ <rect> <x>0</x> <y>0</y> - <width>400</width> - <height>300</height> + <width>700</width> + <height>600</height> </rect> </property> <property name="windowTitle"> - <string>MainWindow</string> + <string>PDF Viewer</string> + </property> + <property name="unifiedTitleAndToolBarOnMac"> + <bool>true</bool> </property> <widget class="QWidget" name="centralWidget"> <layout class="QVBoxLayout" name="verticalLayout"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> <item> <widget class="QScrollArea" name="scrollArea"> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="lineWidth"> + <number>0</number> + </property> <property name="widgetResizable"> <bool>true</bool> </property> @@ -25,8 +49,8 @@ <rect> <x>0</x> <y>0</y> - <width>380</width> - <height>200</height> + <width>700</width> + <height>517</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout_2"/> @@ -40,8 +64,8 @@ <rect> <x>0</x> <y>0</y> - <width>400</width> - <height>19</height> + <width>700</width> + <height>22</height> </rect> </property> <widget class="QMenu" name="menuFile"> @@ -72,6 +96,12 @@ <addaction name="menuHelp"/> </widget> <widget class="QToolBar" name="mainToolBar"> + <property name="movable"> + <bool>false</bool> + </property> + <property name="floatable"> + <bool>false</bool> + </property> <attribute name="toolBarArea"> <enum>TopToolBarArea</enum> </attribute> |