I am using PyQT4 to create a sample application for a prospective client. I am looking for some way to put a border around a specific widget. Please give me some pointers to look for.
updated :
class CentralWidget(QtGui.QWidget):
def __init__(self, mainWindow):
super(CentralWidget, self).__init__()
self.create(mainWindow)
Above code defines the widget.
According to the stylesheet documentation, QWidget does not support the border property (but it seems to have changed since this answer was originally published, in 2011).
If your widget is a container of other widgets, then you should use QFrame, as it will allow you to call
setFrameStyleandsetLineWidth. It is preferable over callingsetStyleSheet, since style-sheet will make all child widgets inherit the border property.Here it is a complete example: