60class QHEXEDIT_API
QHexEdit :
public QAbstractScrollArea
67 Q_PROPERTY(
bool addressArea READ addressArea WRITE setAddressArea)
74 Q_PROPERTY(qint64 addressOffset READ addressOffset WRITE setAddressOffset)
78 Q_PROPERTY(
int addressWidth READ addressWidth WRITE setAddressWidth)
82 Q_PROPERTY(
bool asciiArea READ asciiArea WRITE setAsciiArea)
85 Q_PROPERTY(
int bytesPerLine READ bytesPerLine WRITE setBytesPerLine)
91 Q_PROPERTY(qint64 cursorPosition READ cursorPosition WRITE setCursorPosition)
98 Q_PROPERTY(QByteArray data READ data WRITE setData NOTIFY dataChanged)
103 Q_PROPERTY(
bool hexCaps READ hexCaps WRITE setHexCaps)
107 Q_PROPERTY(
bool dynamicBytesPerLine READ dynamicBytesPerLine WRITE setDynamicBytesPerLine)
111 Q_PROPERTY(
bool highlighting READ highlighting WRITE setHighlighting)
117 Q_PROPERTY(QColor highlightingColor READ highlightingColor WRITE setHighlightingColor)
124 Q_PROPERTY(
bool overwriteMode READ overwriteMode WRITE setOverwriteMode)
131 Q_PROPERTY(
bool readOnly READ isReadOnly WRITE setReadOnly)
134 Q_PROPERTY(QFont font READ font WRITE setFont)
148 bool setData(QIODevice &iODevice);
153 QByteArray dataAt(qint64 pos, qint64 count=-1);
158 bool write(QIODevice &iODevice, qint64 pos=0, qint64 count=-1);
168 void insert(qint64 pos,
char ch);
174 void remove(qint64 pos, qint64 len=1);
181 void replace(qint64 pos,
char ch);
191 void insert(qint64 pos, const QByteArray &ba);
199 void replace(qint64 pos, qint64 len, const QByteArray &ba);
213 void addUserArea(qint64 posStart, qint64 posEnd, QColor fontColor, QBrush areaStyle);
217 void clearUserAreas();
225 qint64 cursorPosition(QPoint point);
229 void ensureVisible();
236 qint64 indexOf(const QByteArray &ba, qint64 from);
248 qint64 lastIndexOf(const QByteArray &ba, qint64 from);
252 QString selectionToReadableString();
256 QString selectedData();
261 void setFont(const QFont &font);
265 QString toReadableString();
281 void currentAddressChanged(qint64 address);
284 void currentSizeChanged(qint64 size);
290 void overwriteModeChanged(
bool state);
299 void setAddressArea(
bool addressArea);
301 qint64 addressOffset();
302 void setAddressOffset(qint64 addressArea);
305 void setAddressWidth(
int addressWidth);
308 void setAsciiArea(
bool asciiArea);
311 void setBytesPerLine(
int count);
313 qint64 cursorPosition();
314 void setCursorPosition(qint64 position);
317 void setData(const QByteArray &ba);
319 void setHexCaps(const
bool isCaps);
322 void setDynamicBytesPerLine(const
bool isDynamic);
323 bool dynamicBytesPerLine();
326 void setHighlighting(
bool mode);
328 QColor highlightingColor();
329 void setHighlightingColor(const QColor &color);
331 bool overwriteMode();
332 void setOverwriteMode(
bool overwriteMode);
335 void setReadOnly(
bool readOnly);
339 bool event(QEvent *event);
340 void keyPressEvent(QKeyEvent *event);
341 void mouseMoveEvent(QMouseEvent * event);
342 void mousePressEvent(QMouseEvent * event);
343 void paintEvent(QPaintEvent *event);
344 void resizeEvent(QResizeEvent *);
345 virtual
bool focusNextPrevChild(
bool next);
348 void resetSelection(qint64 pos);
349 void resetSelection();
350 void setSelection(qint64 pos);
351 qint64 getSelectionBegin();
352 qint64 getSelectionEnd();
357 QString toReadable(const QByteArray &ba);
361 void dataChangedPrivate(
int idx=0);
367 int _pxCharWidth, _pxCharHeight;
378 qint64 _bSelectionBegin;
379 qint64 _bSelectionEnd;
388 qint64 _addressOffset;
395 bool _dynamicBytesPerLine;
398 bool _editAreaIsAscii;
404 qint64 _cursorPosition;
407 QByteArray _dataShown;
408 QByteArray _hexDataShown;
409 qint64 _lastEventSize;
410 QByteArray _markedShown;
413 UndoStack * _undoStack;
414 ColorManager * _colorManager;