Home »
Python »
PyQt MCQs
Which is the correct code statement to create a canvas in PyQt?
22. Which is the correct code statement to create a canvas in PyQt?
- self.image = QImage(self.size(), QImage.Format_RGB32)
- self.image = QImage()
- self.image = QImage(QImage.Format_RGB32, self.size())
- None of the above
Answer: A) self.image = QImage(self.size(), QImage.Format_RGB32)
Explanation:
The correct code statement to create a canvas in PyQt is:
self.image = QImage(self.size(), QImage.Format_RGB32)