In this code, I have arranged four buttons in the QVBoxLayout and the result is in the picture The buttons covered the whole window. I made another window also
QVBoxLayout