Using as base the logic that is implemented in the solution of @xsquared modifying certain parts we obtain the following: PyQt4 version from PyQt4 import QtCore, QtGui class CollapsibleBox(QtGui.QWidget): def __init__(self, title=””, parent=None): super(CollapsibleBox, self).__init__(parent) self.toggle_button = QtGui.QToolButton( text=title, checkable=True, checked=False ) self.toggle_button.setStyleSheet(“QToolButton { border: none; }”) self.toggle_button.setToolButtonStyle( QtCore.Qt.ToolButtonTextBesideIcon ) self.toggle_button.setArrowType(QtCore.Qt.RightArrow) self.toggle_button.pressed.connect(self.on_pressed) self.toggle_animation = QtCore.QParallelAnimationGroup(self) … Read more