How to combine columns in a layout (colspan feature)
Question: I have this code:

    
    
    #!/usr/bin/env python3
    
    from PyQt5.QtWidgets import *
    import sys    
    
    class Window(QWidget):
        def __init__(self):
            QWidget.__init__(self)
    
            layout = QGridLayout()
            self.setLayout(layout)
    
            label_1 = QLabel("label 1")
            layout.addWidget(label_1, 0, 0)
    
            label_2 = QLabel("label 2")
            layout.addWidget(label_2, 0, 1)
    
            label_3 = QLabel("label 3")
            layout.addWidget(label_3, 1, 0)
    
    
    app = QApplication(sys.argv)
    
    screen = Window()
    screen.show()
    
    sys.exit(app.exec_())
    

I have this result:

![image example of current code](http://i.stack.imgur.com/4Hv7L.png)

but I need this:

![image example of code which I need](http://i.stack.imgur.com/ApOhK.png)

How can I do it?


Answer: The fourth and fifth arguments of
[addWidget](http://doc.qt.io/qt-5/qgridlayout.html#addWidget-2) allow you to
specify how many rows and columns to span:

    
    
    label_3 = QLabel("label 3")
    layout.addWidget(label_3, 1, 0, 1, 2)
    

