eric6/WebBrowser/PageScreenDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
28 (WebBrowserView) 28 (WebBrowserView)
29 @param parent reference to the parent widget (QWidget) 29 @param parent reference to the parent widget (QWidget)
30 """ 30 """
31 super(PageScreenDialog, self).__init__(parent) 31 super(PageScreenDialog, self).__init__(parent)
32 self.setupUi(self) 32 self.setupUi(self)
33 self.setWindowFlags(Qt.Window) 33 self.setWindowFlags(Qt.WindowType.Window)
34 34
35 self.__view = view 35 self.__view = view
36 self.__createPixmap() 36 self.__createPixmap()
37 self.pageScreenLabel.setPixmap(self.__pagePixmap) 37 self.pageScreenLabel.setPixmap(self.__pagePixmap)
38 38
51 "return res;" 51 "return res;"
52 "})()" 52 "})()"
53 ) 53 )
54 if res is not None: 54 if res is not None:
55 image = QImage(QSize(res["width"], self.__view.height()), 55 image = QImage(QSize(res["width"], self.__view.height()),
56 QImage.Format_ARGB32) 56 QImage.Format.Format_ARGB32)
57 painter = QPainter(image) 57 painter = QPainter(image)
58 self.__view.render(painter) 58 self.__view.render(painter)
59 painter.end() 59 painter.end()
60 60
61 self.__pagePixmap = QPixmap.fromImage(image) 61 self.__pagePixmap = QPixmap.fromImage(image)
112 """ 112 """
113 Private slot to handle clicks of the dialog buttons. 113 Private slot to handle clicks of the dialog buttons.
114 114
115 @param button button that was clicked (QAbstractButton) 115 @param button button that was clicked (QAbstractButton)
116 """ 116 """
117 if button == self.buttonBox.button(QDialogButtonBox.Cancel): 117 if button == self.buttonBox.button(
118 QDialogButtonBox.StandardButton.Cancel
119 ):
118 self.reject() 120 self.reject()
119 elif button == self.buttonBox.button(QDialogButtonBox.Save): 121 elif button == self.buttonBox.button(
122 QDialogButtonBox.StandardButton.Save
123 ):
120 if self.__savePageScreen(): 124 if self.__savePageScreen():
121 self.accept() 125 self.accept()

eric ide

mercurial