(self, name)
| 40 | # provides callbacks for global area events, and must be created with a title. |
| 41 | class HelloGlobalAreaWidget(GlobalAreaWidget): |
| 42 | def __init__(self, name): |
| 43 | global instance_id |
| 44 | GlobalAreaWidget.__init__(self, name) |
| 45 | self.actionHandler = UIActionHandler() |
| 46 | self.actionHandler.setupActionHandler(self) |
| 47 | offset_layout = QHBoxLayout() |
| 48 | offset_layout.addWidget(QLabel("Offset: ")) |
| 49 | self.offset = QLabel(hex(0)) |
| 50 | offset_layout.addWidget(self.offset) |
| 51 | offset_layout.setAlignment(QtCore.Qt.AlignCenter) |
| 52 | datatype_layout = QHBoxLayout() |
| 53 | datatype_layout.addWidget(QLabel("Data Type: ")) |
| 54 | self.datatype = QLabel("") |
| 55 | datatype_layout.addWidget(self.datatype) |
| 56 | datatype_layout.setAlignment(QtCore.Qt.AlignCenter) |
| 57 | layout = QVBoxLayout() |
| 58 | title = QLabel(name, self) |
| 59 | title.setAlignment(QtCore.Qt.AlignCenter) |
| 60 | instance = QLabel("Instance: " + str(instance_id), self) |
| 61 | instance.setAlignment(QtCore.Qt.AlignCenter) |
| 62 | layout.addStretch() |
| 63 | layout.addWidget(title) |
| 64 | layout.addWidget(instance) |
| 65 | layout.addLayout(datatype_layout) |
| 66 | layout.addLayout(offset_layout) |
| 67 | layout.addStretch() |
| 68 | self.setLayout(layout) |
| 69 | instance_id += 1 |
| 70 | self.data = None |
| 71 | |
| 72 | def notifyOffsetChanged(self, offset): |
| 73 | self.offset.setText(hex(offset)) |
nothing calls this directly
no test coverage detected