qtoolbutton pyqt5

Solutions on MaxInterview for qtoolbutton pyqt5 by the best coders in the world

showing results for - "qtoolbutton pyqt5"
Skylar
04 Jun 2018
1def __init__(self,parent=None):
2        super(AdjustableTextEditWithFold,self).__init__(parent)
3
4        self.is_fold=True
5        self.fold_above_nl=2
6
7        self.fold_button=QtWidgets.QToolButton()
8        self.fold_button.setArrowType(Qt.DownArrow)
9        font_height=self.fontMetrics().height()
10        self.fold_button.setFixedWidth(int(font_height))
11        self.fold_button.setFixedHeight(int(font_height))
12        self.fold_button.clicked.connect(self.toggleFold)
13        self.fold_button.setStyleSheet('''
14        QToolButton {
15            border: 1px solid rgb(190,190,190);
16            background-color: rgb(190,190,190);
17            border-radius: %dpx;
18            color: white;
19            }
20
21        QToolButton:pressed {
22            border-style: inset;
23            }
24        ''' %(int(font_height/2))
25        )