eric6/WebBrowser/Tools/PrintToPdfDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
--- a/eric6/WebBrowser/Tools/PrintToPdfDialog.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/WebBrowser/Tools/PrintToPdfDialog.py	Tue Mar 02 17:17:09 2021 +0100
@@ -42,7 +42,7 @@
             "All Files (*)"))
         if not os.path.isabs(filePath):
             documentsPath = QStandardPaths.writableLocation(
-                QStandardPaths.DocumentsLocation)
+                QStandardPaths.StandardLocation.DocumentsLocation)
             if documentsPath:
                 filePath = os.path.join(documentsPath, filePath)
             else:
@@ -50,7 +50,8 @@
         self.pdfFilePicker.setText(filePath, toNative=True)
         
         self.__currentPageLayout = QPageLayout(
-            QPageSize(QPageSize.A4), QPageLayout.Portrait,
+            QPageSize(QPageSize.PageSizeId.A4),
+            QPageLayout.Orientation.Portrait,
             QMarginsF(0.0, 0.0, 0.0, 0.0))
         
         self.__updatePageLayoutLabel()
@@ -64,7 +65,7 @@
         printer.setPageLayout(self.__currentPageLayout)
         
         dlg = QPageSetupDialog(printer, self)
-        if dlg.exec() == QDialog.Accepted:
+        if dlg.exec() == QDialog.DialogCode.Accepted:
             self.__currentPageLayout = printer.pageLayout()
             self.__updatePageLayoutLabel()
     
@@ -72,7 +73,10 @@
         """
         Private method to update the page layout label.
         """
-        if self.__currentPageLayout.orientation() == QPageLayout.Portrait:
+        if (
+            self.__currentPageLayout.orientation() ==
+            QPageLayout.Orientation.Portrait
+        ):
             orientation = self.tr("Portrait")
         else:
             orientation = self.tr("Landscape")

eric ide

mercurial