More compact layout
Posted
by Jesse Aldridge
on Stack Overflow
See other posts from Stack Overflow
or by Jesse Aldridge
Published on 2010-04-26T09:37:03Z
Indexed on
2010/04/26
13:33 UTC
Read the original article
Hit count: 192
In the following code, I'd like to get rid of the margin around the buttons. I'd like to have the buttons stretch all the way to the edge of the frame. How can I do that?
import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
app = QApplication(sys.argv)
window = QWidget()
layout = QVBoxLayout()
layout.setSpacing(0)
window.setLayout(layout)
for i in range(2):
layout.addWidget(QPushButton())
window.show()
app.exec_()
© Stack Overflow or respective owner