6 """ |
6 """ |
7 Module implementing a movement (goto) widget for the hex editor. |
7 Module implementing a movement (goto) widget for the hex editor. |
8 """ |
8 """ |
9 |
9 |
10 |
10 |
11 from PyQt5.QtCore import pyqtSlot, Qt, QRegExp |
11 from PyQt5.QtCore import pyqtSlot, Qt, QRegularExpression |
12 from PyQt5.QtGui import QRegExpValidator |
12 from PyQt5.QtGui import QRegularExpressionValidator |
13 from PyQt5.QtWidgets import QWidget |
13 from PyQt5.QtWidgets import QWidget |
14 |
14 |
15 from .Ui_HexEditGotoWidget import Ui_HexEditGotoWidget |
15 from .Ui_HexEditGotoWidget import Ui_HexEditGotoWidget |
16 |
16 |
17 import UI.PixmapCache |
17 import UI.PixmapCache |
36 |
36 |
37 self.__editor = editor |
37 self.__editor = editor |
38 |
38 |
39 # keep this in sync with the logic in on_gotoButton_clicked() |
39 # keep this in sync with the logic in on_gotoButton_clicked() |
40 self.__formatAndValidators = { |
40 self.__formatAndValidators = { |
41 "hex": (self.tr("Hex"), QRegExpValidator((QRegExp("[0-9a-f:]*")))), |
41 "hex": (self.tr("Hex"), QRegularExpressionValidator( |
42 "dec": (self.tr("Dec"), QRegExpValidator((QRegExp("[0-9]*")))), |
42 QRegularExpression("[0-9a-f:]*"))), |
|
43 "dec": (self.tr("Dec"), QRegularExpressionValidator( |
|
44 QRegularExpression("[0-9]*"))), |
43 } |
45 } |
44 formatOrder = ["hex", "dec"] |
46 formatOrder = ["hex", "dec"] |
45 |
47 |
46 self.__currentFormat = "" |
48 self.__currentFormat = "" |
47 |
49 |