(self, x, y)
| 740 | self.viewport().update() |
| 741 | |
| 742 | def addressFromLocation(self, x, y): |
| 743 | if y < 0: |
| 744 | y = 0 |
| 745 | if x < 0: |
| 746 | x = 0 |
| 747 | if x > self.cols: |
| 748 | x = self.cols |
| 749 | if (y + self.topLine) >= len(self.lines): |
| 750 | return self.getEnd() |
| 751 | if self.lines[y + self.topLine].separator: |
| 752 | return self.lines[y + self.topLine].address - 1 |
| 753 | result = self.lines[y + self.topLine].address + x |
| 754 | if result >= (self.lines[y + self.topLine].address + self.lines[y + self.topLine].length): |
| 755 | if (y + self.topLine) == (len(self.lines) - 1): |
| 756 | return self.getEnd() |
| 757 | else: |
| 758 | return self.lines[y + self.topLine].address + self.lines[y + self.topLine].length - 1 |
| 759 | return result |
| 760 | |
| 761 | def mousePressEvent(self, event): |
| 762 | if event.button() != Qt.LeftButton: |
no test coverage detected