| 11 | // ********************************************************************** Constructor, destructor |
| 12 | |
| 13 | QHexEdit::QHexEdit(QWidget *parent) : QAbstractScrollArea(parent) |
| 14 | , _addressArea(true) |
| 15 | , _addressWidth(4) |
| 16 | , _asciiArea(true) |
| 17 | , _bytesPerLine(16) |
| 18 | , _hexCharsInLine(47) |
| 19 | , _highlighting(true) |
| 20 | , _overwriteMode(true) |
| 21 | , _readOnly(false) |
| 22 | , _hexCaps(false) |
| 23 | , _dynamicBytesPerLine(false) |
| 24 | , _editAreaIsAscii(false) |
| 25 | , _chunks(new Chunks(this)) |
| 26 | , _cursorPosition(0) |
| 27 | , _lastEventSize(0) |
| 28 | , _undoStack(new UndoStack(_chunks, this)) |
| 29 | , _colorManager(new ColorManager()) |
| 30 | { |
| 31 | #ifdef Q_OS_WIN32 |
| 32 | setFont(QFont("Courier", 10)); |
| 33 | #else |
| 34 | setFont(QFont("Monospace", 10)); |
| 35 | #endif |
| 36 | connect(&_cursorTimer, SIGNAL(timeout()), this, SLOT(updateCursor())); |
| 37 | connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(adjust())); |
| 38 | connect(horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(adjust())); |
| 39 | connect(_undoStack, SIGNAL(indexChanged(int)), this, SLOT(dataChangedPrivate(int))); |
| 40 | |
| 41 | _cursorTimer.setInterval(500); |
| 42 | _cursorTimer.start(); |
| 43 | |
| 44 | setAddressWidth(4); |
| 45 | setAddressArea(true); |
| 46 | setAsciiArea(true); |
| 47 | setOverwriteMode(true); |
| 48 | setHighlighting(true); |
| 49 | setReadOnly(false); |
| 50 | |
| 51 | init(); |
| 52 | } |
| 53 | |
| 54 | QHexEdit::~QHexEdit() |
| 55 | { |
nothing calls this directly
no outgoing calls
no test coverage detected