def __init__( self, parent ): QScrollArea.__init__(self, parent) self.setFrameShape(QScrollArea.NoFrame) self.setAutoFillBackground(False) self.setWidgetResizable(True) self.setMouseTracking(True) #self.verticalScrollBar().setMaximumWidth(10) widget = QWidget(self) # define custom properties self._rolloutStyle = AccordionWidget.Rounded self._dragDropMode = AccordionWidget.NoDragDrop self._scrolling = False self._scrollInitY = 0 self._scrollInitVal = 0 self._itemClass = AccordionItem layout = QVBoxLayout() layout.setContentsMargins(2, 2, 2, 2) layout.setSpacing(2) layout.addStretch(1) widget.setLayout(layout) self.setWidget(widget)
def __init__( self, accordion, title, widget ): QGroupBox.__init__(self, accordion) # create the layout layout = QVBoxLayout() layout.setContentsMargins(6, 6, 6, 6) layout.setSpacing(0) layout.addWidget(widget) self._accordianWidget = accordion self._rolloutStyle = 2 self._dragDropMode = 0 self.setAcceptDrops(True) self.setLayout(layout) self.setContextMenuPolicy(Qt.CustomContextMenu) self.customContextMenuRequested.connect(self.showMenu) # create custom properties self._widget = widget self._collapsed = False self._collapsible = True self._clicked = False self._customData = {} # set common properties self.setTitle(title)