MCPcopy Create free account
hub / github.com/MCSLTeam/MCSL2 / __init__

Method __init__

MCSL2Lib/Widgets/exceptionWidget.py:24–54  ·  view source on GitHub ↗
(self, traceStr)

Source from the content-addressed store, hash-verified

22
23class ExceptionWidget(QWidget):
24 def __init__(self, traceStr):
25 super().__init__()
26 self.exceptionScrollArea = MySmoothScrollArea(self)
27 self.exceptionScrollArea.setGeometry(QRect(50, 10, 480, 150))
28 sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
29 sizePolicy.setHorizontalStretch(0)
30 sizePolicy.setVerticalStretch(0)
31 sizePolicy.setHeightForWidth(self.exceptionScrollArea.sizePolicy().hasHeightForWidth())
32 self.exceptionScrollArea.setSizePolicy(sizePolicy)
33 self.exceptionScrollArea.setMinimumSize(QSize(480, 0))
34 self.exceptionScrollArea.setMaximumSize(QSize(480, 320))
35 self.exceptionScrollArea.setFrameShape(QFrame.NoFrame)
36 self.exceptionScrollArea.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
37 self.exceptionScrollArea.setWidgetResizable(True)
38 self.exceptionScrollAreaWidgetContents = QWidget()
39 self.exceptionScrollAreaWidgetContents.setGeometry(QRect(0, 0, 468, 320))
40 self.verticalLayout_2 = QVBoxLayout(self.exceptionScrollAreaWidgetContents)
41 self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
42 self.exceptionLabel = BodyLabel(self.exceptionScrollAreaWidgetContents)
43 sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)
44 sizePolicy.setHorizontalStretch(0)
45 sizePolicy.setVerticalStretch(0)
46 sizePolicy.setHeightForWidth(self.exceptionLabel.sizePolicy().hasHeightForWidth())
47 self.exceptionLabel.setSizePolicy(sizePolicy)
48 self.exceptionLabel.setMinimumSize(QSize(450, 200))
49 self.exceptionLabel.setMaximumSize(QSize(450, 16777215))
50 self.exceptionLabel.setAlignment(Qt.AlignLeading | Qt.AlignLeft | Qt.AlignTop)
51 self.exceptionLabel.setWordWrap(True)
52 self.verticalLayout_2.addWidget(self.exceptionLabel)
53 self.exceptionScrollArea.setWidget(self.exceptionScrollAreaWidgetContents)
54 self.exceptionLabel.setText(traceStr)

Callers

nothing calls this directly

Calls 2

MySmoothScrollAreaClass · 0.90
addWidgetMethod · 0.45

Tested by

no test coverage detected