(self)
return frame
Constructs a central widget for the window consisting of a two-by-two
            grid of labels, each of which will contain an image. We restrict the
            size of the labels to 256 pixels, and ensure that the window cannot
            be resized.
Constructs a central widget for the window consisting of a two-by-two
            grid of labels, each of which will contain an image. We restrict the
            size of the labels to 256 pixels, and ensure that the window cannot
            be resized.
Constructs a central widget for the window consisting of a two - by - two grid of labels each of which will contain an image . We restrict the size of the labels to 256 pixels and ensure that the window cannot be resized .
def createCentralWidget(self):
        """ Constructs a central widget for the window consisting of a two-by-two
            grid of labels, each of which will contain an image. We restrict the
            size of the labels to 256 pixels, and ensure that the window cannot
            be resized.
        """
        frame = QFrame(self)
        grid = QGridLayout(frame)
        grid.setSpacing(8)
        grid.setContentsMargins(4, 4, 4, 4)

        self.layout().setSizeConstraint(QLayout.SetFixedSize)

        labelSize = QSize(256, 256)

        self.finalWidget = FinalWidget(frame, "Final image", labelSize)

        self.cyanWidget = ScreenWidget(frame, Qt.cyan, "Cyan",
                ScreenWidget.Cyan, labelSize)
        self.magentaWidget = ScreenWidget(frame, Qt.magenta, "Magenta",
                ScreenWidget.Magenta, labelSize)
        self.yellowWidget = ScreenWidget(frame, Qt.yellow, "Yellow",
                ScreenWidget.Yellow, labelSize)

        self.cyanWidget.imageChanged.connect(self.createImage)
        self.magentaWidget.imageChanged.connect(self.createImage)
        self.yellowWidget.imageChanged.connect(self.createImage)

        grid.addWidget(self.finalWidget, 0, 0, Qt.AlignTop | Qt.AlignHCenter)
        grid.addWidget(self.cyanWidget, 0, 1, Qt.AlignTop | Qt.AlignHCenter)
        grid.addWidget(self.magentaWidget, 1, 0, Qt.AlignTop | Qt.AlignHCenter)
        grid.addWidget(self.yellowWidget, 1, 1, Qt.AlignTop | Qt.AlignHCenter)

        return frame
def createCentralWidget ( self ) : frame = QFrame ( self ) grid = QGridLayout ( frame ) grid . setSpacing ( 8 ) grid . setContentsMargins ( 4 , 4 , 4 , 4 ) self . layout ( ) . setSizeConstraint ( QLayout . SetFixedSize ) labelSize = QSize ( 256 , 256 ) self . finalWidget = FinalWidget ( frame , "Final image" , labelSize ) self . cyanWidget = ScreenWidget ( frame , Qt . cyan , "Cyan" , ScreenWidget . Cyan , labelSize ) self . magentaWidget = ScreenWidget ( frame , Qt . magenta , "Magenta" , ScreenWidget . Magenta , labelSize ) self . yellowWidget = ScreenWidget ( frame , Qt . yellow , "Yellow" , ScreenWidget . Yellow , labelSize ) self . cyanWidget . imageChanged . connect ( self . createImage ) self . magentaWidget . imageChanged . connect ( self . createImage ) self . yellowWidget . imageChanged . connect ( self . createImage ) grid . addWidget ( self . finalWidget , 0 , 0 , Qt . AlignTop | Qt . AlignHCenter ) grid . addWidget ( self . cyanWidget , 0 , 1 , Qt . AlignTop | Qt . AlignHCenter ) grid . addWidget ( self . magentaWidget , 1 , 0 , Qt . AlignTop | Qt . AlignHCenter ) grid . addWidget ( self . yellowWidget , 1 , 1 , Qt . AlignTop | Qt . AlignHCenter ) return frame