diff -r 27f636beebad -r 2c730d5fd177 eric6/WebBrowser/Tools/PrintToPdfDialog.py --- 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")