May 2019
Intermediate to advanced
542 pages
13h 37m
English
With the form widget created, let's now assemble our main GUI.
Let's start with MainView.__init__():
self.setWindowTitle('Qt Meme Generator') self.max_size = qtc.QSize(800, 600) self.image = qtg.QImage( self.max_size, qtg.QImage.Format_ARGB32) self.image.fill(qtg.QColor('black'))
We're going to begin by setting a window title and then defining a maximum size for our generated meme image. We'll use this to create our QImage object. Since we haven't got an image file at program launch time, we'll just generate a black placeholder image that is of the maximum size, which we do using the fill() method—just as we did with our pixmaps. However, when creating a blank QImage object, we need to specify an image format to use for the ...
Read now
Unlock full access