From 68c18a25a6e012189fdf5c24d69ef1fab9d0270a Mon Sep 17 00:00:00 2001 From: Simsys Date: Sat, 16 Mar 2019 17:11:08 +0100 Subject: [PATCH] v0.8.6 --- doc/html/_q_hex_edit_plugin_8h_source.html | 2 +- doc/html/annotated.html | 2 +- doc/html/chunks_8h_source.html | 2 +- doc/html/class_q_hex_edit-members.html | 17 +++++++------- doc/html/class_q_hex_edit.html | 22 ++++++++++++++++++- doc/html/class_q_hex_edit_plugin-members.html | 2 +- doc/html/class_q_hex_edit_plugin.html | 2 +- doc/html/classes.html | 2 +- doc/html/commands_8h_source.html | 2 +- .../dir_68267d1309a1af8e8297ef4c3efbcdba.html | 2 +- doc/html/files.html | 2 +- doc/html/functions.html | 5 ++++- doc/html/functions_func.html | 5 ++++- doc/html/functions_prop.html | 2 +- doc/html/hierarchy.html | 2 +- doc/html/index.html | 4 ++-- doc/html/qhexedit_8h_source.html | 4 ++-- doc/html/search/all_c.js | 1 + doc/html/search/functions_8.js | 1 + doc/release.txt | 6 +++++ setup.py | 2 +- 21 files changed, 62 insertions(+), 27 deletions(-) diff --git a/doc/html/_q_hex_edit_plugin_8h_source.html b/doc/html/_q_hex_edit_plugin_8h_source.html index 349dfa5..e5318bb 100644 --- a/doc/html/_q_hex_edit_plugin_8h_source.html +++ b/doc/html/_q_hex_edit_plugin_8h_source.html @@ -70,7 +70,7 @@ diff --git a/doc/html/annotated.html b/doc/html/annotated.html index 535238a..2e97135 100644 --- a/doc/html/annotated.html +++ b/doc/html/annotated.html @@ -71,7 +71,7 @@ diff --git a/doc/html/chunks_8h_source.html b/doc/html/chunks_8h_source.html index 4ae01b6..05db902 100644 --- a/doc/html/chunks_8h_source.html +++ b/doc/html/chunks_8h_source.html @@ -69,7 +69,7 @@
1 #ifndef CHUNKS_H
2 #define CHUNKS_H
3 
20 #include <QtCore>
21 
22 struct Chunk
23 {
24  QByteArray data;
25  QByteArray dataChanged;
26  qint64 absPos;
27 };
28 
29 class Chunks: public QObject
30 {
31 Q_OBJECT
32 public:
33  // Constructors and file settings
34  Chunks(QObject *parent);
35  Chunks(QIODevice &ioDevice, QObject *parent);
36  bool setIODevice(QIODevice &ioDevice);
37 
38  // Getting data out of Chunks
39  QByteArray data(qint64 pos=0, qint64 count=-1, QByteArray *highlighted=0);
40  bool write(QIODevice &iODevice, qint64 pos=0, qint64 count=-1);
41 
42  // Set and get highlighting infos
43  void setDataChanged(qint64 pos, bool dataChanged);
44  bool dataChanged(qint64 pos);
45 
46  // Search API
47  qint64 indexOf(const QByteArray &ba, qint64 from);
48  qint64 lastIndexOf(const QByteArray &ba, qint64 from);
49 
50  // Char manipulations
51  bool insert(qint64 pos, char b);
52  bool overwrite(qint64 pos, char b);
53  bool removeAt(qint64 pos);
54 
55  // Utility functions
56  char operator[](qint64 pos);
57  qint64 pos();
58  qint64 size();
59 
60 
61 private:
62  int getChunkIndex(qint64 absPos);
63 
64  QIODevice * _ioDevice;
65  qint64 _pos;
66  qint64 _size;
67  QList<Chunk> _chunks;
68 
69 #ifdef MODUL_TEST
70 public:
71  int chunkSize();
72 #endif
73 };
74 
77 #endif // CHUNKS_H
diff --git a/doc/html/class_q_hex_edit-members.html b/doc/html/class_q_hex_edit-members.html index 31ad11c..8cbb69e 100644 --- a/doc/html/class_q_hex_edit-members.html +++ b/doc/html/class_q_hex_edit-members.html @@ -97,17 +97,18 @@ remove(qint64 pos, qint64 len=1)QHexEdit replace(qint64 pos, char ch)QHexEdit replace(qint64 pos, qint64 len, const QByteArray &ba)QHexEdit - selectionColorQHexEdit - selectionToReadableString()QHexEdit - setData(QIODevice &iODevice)QHexEdit - setFont(const QFont &font)QHexEdit - toReadableString()QHexEdit - undo()QHexEditslot - write(QIODevice &iODevice, qint64 pos=0, qint64 count=-1)QHexEdit + selectedData()QHexEdit + selectionColorQHexEdit + selectionToReadableString()QHexEdit + setData(QIODevice &iODevice)QHexEdit + setFont(const QFont &font)QHexEdit + toReadableString()QHexEdit + undo()QHexEditslot + write(QIODevice &iODevice, qint64 pos=0, qint64 count=-1)QHexEdit diff --git a/doc/html/class_q_hex_edit.html b/doc/html/class_q_hex_edit.html index 1b6f23e..913d940 100644 --- a/doc/html/class_q_hex_edit.html +++ b/doc/html/class_q_hex_edit.html @@ -129,6 +129,8 @@   QString selectionToReadableString ()   +QString selectedData () +  void setFont (const QFont &font)   QString toReadableString () @@ -685,6 +687,24 @@

+

◆ selectedData()

+ +
+
+ + + + + + + +
QString QHexEdit::selectedData ()
+
+

Return the selected content of QHexEdit as QByteArray

+
@@ -1209,7 +1229,7 @@

diff --git a/doc/html/class_q_hex_edit_plugin-members.html b/doc/html/class_q_hex_edit_plugin-members.html index bc41bea..5d9a5db 100644 --- a/doc/html/class_q_hex_edit_plugin-members.html +++ b/doc/html/class_q_hex_edit_plugin-members.html @@ -80,7 +80,7 @@ diff --git a/doc/html/class_q_hex_edit_plugin.html b/doc/html/class_q_hex_edit_plugin.html index 6145afa..eb4ef3b 100644 --- a/doc/html/class_q_hex_edit_plugin.html +++ b/doc/html/class_q_hex_edit_plugin.html @@ -119,7 +119,7 @@ diff --git a/doc/html/classes.html b/doc/html/classes.html index fb8df5b..66ea522 100644 --- a/doc/html/classes.html +++ b/doc/html/classes.html @@ -74,7 +74,7 @@ diff --git a/doc/html/commands_8h_source.html b/doc/html/commands_8h_source.html index 2159c2e..a7328e6 100644 --- a/doc/html/commands_8h_source.html +++ b/doc/html/commands_8h_source.html @@ -69,7 +69,7 @@
1 #ifndef COMMANDS_H
2 #define COMMANDS_H
3 
6 #include <QUndoStack>
7 
8 #include "chunks.h"
9 
28 class UndoStack : public QUndoStack
29 {
30  Q_OBJECT
31 
32 public:
33  UndoStack(Chunks *chunks, QObject * parent=0);
34  void insert(qint64 pos, char c);
35  void insert(qint64 pos, const QByteArray &ba);
36  void removeAt(qint64 pos, qint64 len=1);
37  void overwrite(qint64 pos, char c);
38  void overwrite(qint64 pos, int len, const QByteArray &ba);
39 
40 private:
41  Chunks * _chunks;
42  QObject * _parent;
43 };
44 
47 #endif // COMMANDS_H
diff --git a/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 6815bd4..aef7c36 100644 --- a/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -69,7 +69,7 @@ diff --git a/doc/html/files.html b/doc/html/files.html index 0565cbb..31767dc 100644 --- a/doc/html/files.html +++ b/doc/html/files.html @@ -74,7 +74,7 @@ diff --git a/doc/html/functions.html b/doc/html/functions.html index d4436b7..33b2772 100644 --- a/doc/html/functions.html +++ b/doc/html/functions.html @@ -196,6 +196,9 @@

- r -

    - s -

      +
    • selectedData() +: QHexEdit +
    • selectionColor : QHexEdit
    • @@ -233,7 +236,7 @@

      - w -

        diff --git a/doc/html/functions_func.html b/doc/html/functions_func.html index d99739b..dfbdaeb 100644 --- a/doc/html/functions_func.html +++ b/doc/html/functions_func.html @@ -104,6 +104,9 @@
      • replace() : QHexEdit
      • +
      • selectedData() +: QHexEdit +
      • selectionToReadableString() : QHexEdit
      • @@ -126,7 +129,7 @@ diff --git a/doc/html/functions_prop.html b/doc/html/functions_prop.html index ce6b8e0..1ebadec 100644 --- a/doc/html/functions_prop.html +++ b/doc/html/functions_prop.html @@ -111,7 +111,7 @@ diff --git a/doc/html/hierarchy.html b/doc/html/hierarchy.html index ea6792e..0b689b9 100644 --- a/doc/html/hierarchy.html +++ b/doc/html/hierarchy.html @@ -75,7 +75,7 @@ diff --git a/doc/html/index.html b/doc/html/index.html index 77d7391..1af4e8c 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -63,14 +63,14 @@

        QHexEdit is a binary editor widget for Qt.

        -
        Version
        Version 0.8.5
        +
        Version
        Version 0.8.6
        qhexedit.png
        diff --git a/doc/html/qhexedit_8h_source.html b/doc/html/qhexedit_8h_source.html index c0b6cfe..e16f021 100644 --- a/doc/html/qhexedit_8h_source.html +++ b/doc/html/qhexedit_8h_source.html @@ -66,11 +66,11 @@
        qhexedit.h
        -
        1 #ifndef QHEXEDIT_H
        2 #define QHEXEDIT_H
        3 
        4 #include <QAbstractScrollArea>
        5 #include <QPen>
        6 #include <QBrush>
        7 
        8 #include "chunks.h"
        9 #include "commands.h"
        10 
        11 #ifdef QHEXEDIT_EXPORTS
        12 #define QHEXEDIT_API Q_DECL_EXPORT
        13 #elif QHEXEDIT_IMPORTS
        14 #define QHEXEDIT_API Q_DECL_IMPORT
        15 #else
        16 #define QHEXEDIT_API
        17 #endif
        18 
        59 class QHEXEDIT_API QHexEdit : public QAbstractScrollArea
        60 {
        61  Q_OBJECT
        62 
        66  Q_PROPERTY(bool addressArea READ addressArea WRITE setAddressArea)
        67 
        68 
        71  Q_PROPERTY(QColor addressAreaColor READ addressAreaColor WRITE setAddressAreaColor)
        72 
        78  Q_PROPERTY(qint64 addressOffset READ addressOffset WRITE setAddressOffset)
        79 
        82  Q_PROPERTY(int addressWidth READ addressWidth WRITE setAddressWidth)
        83 
        86  Q_PROPERTY(bool asciiArea READ asciiArea WRITE setAsciiArea)
        87 
        89  Q_PROPERTY(int bytesPerLine READ bytesPerLine WRITE setBytesPerLine)
        90 
        95  Q_PROPERTY(qint64 cursorPosition READ cursorPosition WRITE setCursorPosition)
        96 
        102  Q_PROPERTY(QByteArray data READ data WRITE setData NOTIFY dataChanged)
        103 
        107  Q_PROPERTY(bool hexCaps READ hexCaps WRITE setHexCaps)
        108 
        111  Q_PROPERTY(bool dynamicBytesPerLine READ dynamicBytesPerLine WRITE setDynamicBytesPerLine)
        112 
        115  Q_PROPERTY(bool highlighting READ highlighting WRITE setHighlighting)
        116 
        121  Q_PROPERTY(QColor highlightingColor READ highlightingColor WRITE setHighlightingColor)
        122 
        128  Q_PROPERTY(bool overwriteMode READ overwriteMode WRITE setOverwriteMode)
        129 
        134  Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor)
        135 
        141  Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
        142 
        144  Q_PROPERTY(QFont font READ font WRITE setFont)
        145 
        146 public:
        150  QHexEdit(QWidget *parent=0);
        151 
        152  // Access to data of qhexedit
        153 
        158  bool setData(QIODevice &iODevice);
        159 
        163  QByteArray dataAt(qint64 pos, qint64 count=-1);
        164 
        168  bool write(QIODevice &iODevice, qint64 pos=0, qint64 count=-1);
        169 
        170 
        171  // Char handling
        172 
        178  void insert(qint64 pos, char ch);
        179 
        184  void remove(qint64 pos, qint64 len=1);
        185 
        191  void replace(qint64 pos, char ch);
        192 
        193 
        194  // ByteArray handling
        195 
        201  void insert(qint64 pos, const QByteArray &ba);
        202 
        209  void replace(qint64 pos, qint64 len, const QByteArray &ba);
        210 
        211 
        212  // Utility functions
        217  qint64 cursorPosition(QPoint point);
        218 
        221  void ensureVisible();
        222 
        228  qint64 indexOf(const QByteArray &ba, qint64 from);
        229 
        233  bool isModified();
        234 
        240  qint64 lastIndexOf(const QByteArray &ba, qint64 from);
        241 
        244  QString selectionToReadableString();
        245 
        249  void setFont(const QFont &font);
        250 
        253  QString toReadableString();
        254 
        255 
        256 public slots:
        260  void redo();
        261 
        265  void undo();
        266 
        267 signals:
        268 
        270  void currentAddressChanged(qint64 address);
        271 
        273  void currentSizeChanged(qint64 size);
        274 
        276  void dataChanged();
        277 
        279  void overwriteModeChanged(bool state);
        280 
        281 
        283 public:
        284  ~QHexEdit();
        285 
        286  // Properties
        287  bool addressArea();
        288  void setAddressArea(bool addressArea);
        289 
        290  QColor addressAreaColor();
        291  void setAddressAreaColor(const QColor &color);
        292 
        293  qint64 addressOffset();
        294  void setAddressOffset(qint64 addressArea);
        295 
        296  int addressWidth();
        297  void setAddressWidth(int addressWidth);
        298 
        299  bool asciiArea();
        300  void setAsciiArea(bool asciiArea);
        301 
        302  int bytesPerLine();
        303  void setBytesPerLine(int count);
        304 
        305  qint64 cursorPosition();
        306  void setCursorPosition(qint64 position);
        307 
        308  QByteArray data();
        309  void setData(const QByteArray &ba);
        310 
        311  void setHexCaps(const bool isCaps);
        312  bool hexCaps();
        313 
        314  void setDynamicBytesPerLine(const bool isDynamic);
        315  bool dynamicBytesPerLine();
        316 
        317  bool highlighting();
        318  void setHighlighting(bool mode);
        319 
        320  QColor highlightingColor();
        321  void setHighlightingColor(const QColor &color);
        322 
        323  bool overwriteMode();
        324  void setOverwriteMode(bool overwriteMode);
        325 
        326  bool isReadOnly();
        327  void setReadOnly(bool readOnly);
        328 
        329  QColor selectionColor();
        330  void setSelectionColor(const QColor &color);
        331 
        332 protected:
        333  // Handle events
        334  void keyPressEvent(QKeyEvent *event);
        335  void mouseMoveEvent(QMouseEvent * event);
        336  void mousePressEvent(QMouseEvent * event);
        337  void paintEvent(QPaintEvent *event);
        338  void resizeEvent(QResizeEvent *);
        339  virtual bool focusNextPrevChild(bool next);
        340 private:
        341  // Handle selections
        342  void resetSelection(qint64 pos); // set selectionStart and selectionEnd to pos
        343  void resetSelection(); // set selectionEnd to selectionStart
        344  void setSelection(qint64 pos); // set min (if below init) or max (if greater init)
        345  int getSelectionBegin();
        346  int getSelectionEnd();
        347 
        348  // Private utility functions
        349  void init();
        350  void readBuffers();
        351  QString toReadable(const QByteArray &ba);
        352 
        353 private slots:
        354  void adjust(); // recalc pixel positions
        355  void dataChangedPrivate(int idx=0); // emit dataChanged() signal
        356  void refresh(); // ensureVisible() and readBuffers()
        357  void updateCursor(); // update blinking cursor
        358 
        359 private:
        360  // Name convention: pixel positions start with _px
        361  int _pxCharWidth, _pxCharHeight; // char dimensions (dependend on font)
        362  int _pxPosHexX; // X-Pos of HeaxArea
        363  int _pxPosAdrX; // X-Pos of Address Area
        364  int _pxPosAsciiX; // X-Pos of Ascii Area
        365  int _pxGapAdr; // gap left from AddressArea
        366  int _pxGapAdrHex; // gap between AddressArea and HexAerea
        367  int _pxGapHexAscii; // gap between HexArea and AsciiArea
        368  int _pxCursorWidth; // cursor width
        369  int _pxSelectionSub; // offset selection rect
        370  int _pxCursorX; // current cursor pos
        371  int _pxCursorY; // current cursor pos
        372 
        373  // Name convention: absolute byte positions in chunks start with _b
        374  qint64 _bSelectionBegin; // first position of Selection
        375  qint64 _bSelectionEnd; // end of Selection
        376  qint64 _bSelectionInit; // memory position of Selection
        377  qint64 _bPosFirst; // position of first byte shown
        378  qint64 _bPosLast; // position of last byte shown
        379  qint64 _bPosCurrent; // current position
        380 
        381  // variables to store the property values
        382  bool _addressArea; // left area of QHexEdit
        383  QColor _addressAreaColor;
        384  int _addressWidth;
        385  bool _asciiArea;
        386  qint64 _addressOffset;
        387  int _bytesPerLine;
        388  int _hexCharsInLine;
        389  bool _highlighting;
        390  bool _overwriteMode;
        391  QBrush _brushSelection;
        392  QPen _penSelection;
        393  QBrush _brushHighlighted;
        394  QPen _penHighlighted;
        395  bool _readOnly;
        396  bool _hexCaps;
        397  bool _dynamicBytesPerLine;
        398 
        399  // other variables
        400  bool _editAreaIsAscii; // flag about the ascii mode edited
        401  int _addrDigits; // real no of addressdigits, may be > addressWidth
        402  bool _blink; // help get cursor blinking
        403  QBuffer _bData; // buffer, when setup with QByteArray
        404  Chunks *_chunks; // IODevice based access to data
        405  QTimer _cursorTimer; // for blinking cursor
        406  qint64 _cursorPosition; // absolute position of cursor, 1 Byte == 2 tics
        407  QRect _cursorRect; // physical dimensions of cursor
        408  QByteArray _data; // QHexEdit's data, when setup with QByteArray
        409  QByteArray _dataShown; // data in the current View
        410  QByteArray _hexDataShown; // data in view, transformed to hex
        411  qint64 _lastEventSize; // size, which was emitted last time
        412  QByteArray _markedShown; // marked data in view
        413  bool _modified; // Is any data in editor modified?
        414  int _rowsShown; // lines of text shown
        415  UndoStack * _undoStack; // Stack to store edit actions for undo/redo
        417 };
        418 
        419 #endif // QHEXEDIT_H
        Definition: qhexedit.h:59
        +
        1 #ifndef QHEXEDIT_H
        2 #define QHEXEDIT_H
        3 
        4 #include <QAbstractScrollArea>
        5 #include <QPen>
        6 #include <QBrush>
        7 
        8 #include "chunks.h"
        9 #include "commands.h"
        10 
        11 #ifdef QHEXEDIT_EXPORTS
        12 #define QHEXEDIT_API Q_DECL_EXPORT
        13 #elif QHEXEDIT_IMPORTS
        14 #define QHEXEDIT_API Q_DECL_IMPORT
        15 #else
        16 #define QHEXEDIT_API
        17 #endif
        18 
        59 class QHEXEDIT_API QHexEdit : public QAbstractScrollArea
        60 {
        61  Q_OBJECT
        62 
        66  Q_PROPERTY(bool addressArea READ addressArea WRITE setAddressArea)
        67 
        68 
        71  Q_PROPERTY(QColor addressAreaColor READ addressAreaColor WRITE setAddressAreaColor)
        72 
        78  Q_PROPERTY(qint64 addressOffset READ addressOffset WRITE setAddressOffset)
        79 
        82  Q_PROPERTY(int addressWidth READ addressWidth WRITE setAddressWidth)
        83 
        86  Q_PROPERTY(bool asciiArea READ asciiArea WRITE setAsciiArea)
        87 
        89  Q_PROPERTY(int bytesPerLine READ bytesPerLine WRITE setBytesPerLine)
        90 
        95  Q_PROPERTY(qint64 cursorPosition READ cursorPosition WRITE setCursorPosition)
        96 
        102  Q_PROPERTY(QByteArray data READ data WRITE setData NOTIFY dataChanged)
        103 
        107  Q_PROPERTY(bool hexCaps READ hexCaps WRITE setHexCaps)
        108 
        111  Q_PROPERTY(bool dynamicBytesPerLine READ dynamicBytesPerLine WRITE setDynamicBytesPerLine)
        112 
        115  Q_PROPERTY(bool highlighting READ highlighting WRITE setHighlighting)
        116 
        121  Q_PROPERTY(QColor highlightingColor READ highlightingColor WRITE setHighlightingColor)
        122 
        128  Q_PROPERTY(bool overwriteMode READ overwriteMode WRITE setOverwriteMode)
        129 
        134  Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor)
        135 
        141  Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
        142 
        144  Q_PROPERTY(QFont font READ font WRITE setFont)
        145 
        146 public:
        150  QHexEdit(QWidget *parent=0);
        151 
        152  // Access to data of qhexedit
        153 
        158  bool setData(QIODevice &iODevice);
        159 
        163  QByteArray dataAt(qint64 pos, qint64 count=-1);
        164 
        168  bool write(QIODevice &iODevice, qint64 pos=0, qint64 count=-1);
        169 
        170 
        171  // Char handling
        172 
        178  void insert(qint64 pos, char ch);
        179 
        184  void remove(qint64 pos, qint64 len=1);
        185 
        191  void replace(qint64 pos, char ch);
        192 
        193 
        194  // ByteArray handling
        195 
        201  void insert(qint64 pos, const QByteArray &ba);
        202 
        209  void replace(qint64 pos, qint64 len, const QByteArray &ba);
        210 
        211 
        212  // Utility functions
        217  qint64 cursorPosition(QPoint point);
        218 
        221  void ensureVisible();
        222 
        228  qint64 indexOf(const QByteArray &ba, qint64 from);
        229 
        233  bool isModified();
        234 
        240  qint64 lastIndexOf(const QByteArray &ba, qint64 from);
        241 
        244  QString selectionToReadableString();
        245 
        248  QString selectedData();
        249 
        253  void setFont(const QFont &font);
        254 
        257  QString toReadableString();
        258 
        259 
        260 public slots:
        264  void redo();
        265 
        269  void undo();
        270 
        271 signals:
        272 
        274  void currentAddressChanged(qint64 address);
        275 
        277  void currentSizeChanged(qint64 size);
        278 
        280  void dataChanged();
        281 
        283  void overwriteModeChanged(bool state);
        284 
        285 
        287 public:
        288  ~QHexEdit();
        289 
        290  // Properties
        291  bool addressArea();
        292  void setAddressArea(bool addressArea);
        293 
        294  QColor addressAreaColor();
        295  void setAddressAreaColor(const QColor &color);
        296 
        297  qint64 addressOffset();
        298  void setAddressOffset(qint64 addressArea);
        299 
        300  int addressWidth();
        301  void setAddressWidth(int addressWidth);
        302 
        303  bool asciiArea();
        304  void setAsciiArea(bool asciiArea);
        305 
        306  int bytesPerLine();
        307  void setBytesPerLine(int count);
        308 
        309  qint64 cursorPosition();
        310  void setCursorPosition(qint64 position);
        311 
        312  QByteArray data();
        313  void setData(const QByteArray &ba);
        314 
        315  void setHexCaps(const bool isCaps);
        316  bool hexCaps();
        317 
        318  void setDynamicBytesPerLine(const bool isDynamic);
        319  bool dynamicBytesPerLine();
        320 
        321  bool highlighting();
        322  void setHighlighting(bool mode);
        323 
        324  QColor highlightingColor();
        325  void setHighlightingColor(const QColor &color);
        326 
        327  bool overwriteMode();
        328  void setOverwriteMode(bool overwriteMode);
        329 
        330  bool isReadOnly();
        331  void setReadOnly(bool readOnly);
        332 
        333  QColor selectionColor();
        334  void setSelectionColor(const QColor &color);
        335 
        336 protected:
        337  // Handle events
        338  void keyPressEvent(QKeyEvent *event);
        339  void mouseMoveEvent(QMouseEvent * event);
        340  void mousePressEvent(QMouseEvent * event);
        341  void paintEvent(QPaintEvent *event);
        342  void resizeEvent(QResizeEvent *);
        343  virtual bool focusNextPrevChild(bool next);
        344 private:
        345  // Handle selections
        346  void resetSelection(qint64 pos); // set selectionStart and selectionEnd to pos
        347  void resetSelection(); // set selectionEnd to selectionStart
        348  void setSelection(qint64 pos); // set min (if below init) or max (if greater init)
        349  qint64 getSelectionBegin();
        350  qint64 getSelectionEnd();
        351 
        352  // Private utility functions
        353  void init();
        354  void readBuffers();
        355  QString toReadable(const QByteArray &ba);
        356 
        357 private slots:
        358  void adjust(); // recalc pixel positions
        359  void dataChangedPrivate(int idx=0); // emit dataChanged() signal
        360  void refresh(); // ensureVisible() and readBuffers()
        361  void updateCursor(); // update blinking cursor
        362 
        363 private:
        364  // Name convention: pixel positions start with _px
        365  int _pxCharWidth, _pxCharHeight; // char dimensions (dependend on font)
        366  int _pxPosHexX; // X-Pos of HeaxArea
        367  int _pxPosAdrX; // X-Pos of Address Area
        368  int _pxPosAsciiX; // X-Pos of Ascii Area
        369  int _pxGapAdr; // gap left from AddressArea
        370  int _pxGapAdrHex; // gap between AddressArea and HexAerea
        371  int _pxGapHexAscii; // gap between HexArea and AsciiArea
        372  int _pxCursorWidth; // cursor width
        373  int _pxSelectionSub; // offset selection rect
        374  int _pxCursorX; // current cursor pos
        375  int _pxCursorY; // current cursor pos
        376 
        377  // Name convention: absolute byte positions in chunks start with _b
        378  qint64 _bSelectionBegin; // first position of Selection
        379  qint64 _bSelectionEnd; // end of Selection
        380  qint64 _bSelectionInit; // memory position of Selection
        381  qint64 _bPosFirst; // position of first byte shown
        382  qint64 _bPosLast; // position of last byte shown
        383  qint64 _bPosCurrent; // current position
        384 
        385  // variables to store the property values
        386  bool _addressArea; // left area of QHexEdit
        387  QColor _addressAreaColor;
        388  int _addressWidth;
        389  bool _asciiArea;
        390  qint64 _addressOffset;
        391  int _bytesPerLine;
        392  int _hexCharsInLine;
        393  bool _highlighting;
        394  bool _overwriteMode;
        395  QBrush _brushSelection;
        396  QPen _penSelection;
        397  QBrush _brushHighlighted;
        398  QPen _penHighlighted;
        399  bool _readOnly;
        400  bool _hexCaps;
        401  bool _dynamicBytesPerLine;
        402 
        403  // other variables
        404  bool _editAreaIsAscii; // flag about the ascii mode edited
        405  int _addrDigits; // real no of addressdigits, may be > addressWidth
        406  bool _blink; // help get cursor blinking
        407  QBuffer _bData; // buffer, when setup with QByteArray
        408  Chunks *_chunks; // IODevice based access to data
        409  QTimer _cursorTimer; // for blinking cursor
        410  qint64 _cursorPosition; // absolute position of cursor, 1 Byte == 2 tics
        411  QRect _cursorRect; // physical dimensions of cursor
        412  QByteArray _data; // QHexEdit's data, when setup with QByteArray
        413  QByteArray _dataShown; // data in the current View
        414  QByteArray _hexDataShown; // data in view, transformed to hex
        415  qint64 _lastEventSize; // size, which was emitted last time
        416  QByteArray _markedShown; // marked data in view
        417  bool _modified; // Is any data in editor modified?
        418  int _rowsShown; // lines of text shown
        419  UndoStack * _undoStack; // Stack to store edit actions for undo/redo
        421 };
        422 
        423 #endif // QHEXEDIT_H
        Definition: qhexedit.h:59
        diff --git a/doc/html/search/all_c.js b/doc/html/search/all_c.js index 69767d3..abd963f 100644 --- a/doc/html/search/all_c.js +++ b/doc/html/search/all_c.js @@ -1,5 +1,6 @@ var searchData= [ + ['selecteddata',['selectedData',['../class_q_hex_edit.html#ac1f9ac4d3ec5bedabd3aeedda3191b20',1,'QHexEdit']]], ['selectioncolor',['selectionColor',['../class_q_hex_edit.html#ac0b628f34316aff9e18fc73a738250d7',1,'QHexEdit']]], ['selectiontoreadablestring',['selectionToReadableString',['../class_q_hex_edit.html#a2ada1230ace92da4e1f006b88ab3b503',1,'QHexEdit']]], ['setdata',['setData',['../class_q_hex_edit.html#ab5221718179da17cbcd9db3bf6574df7',1,'QHexEdit']]], diff --git a/doc/html/search/functions_8.js b/doc/html/search/functions_8.js index 83a2489..64d22d0 100644 --- a/doc/html/search/functions_8.js +++ b/doc/html/search/functions_8.js @@ -1,5 +1,6 @@ var searchData= [ + ['selecteddata',['selectedData',['../class_q_hex_edit.html#ac1f9ac4d3ec5bedabd3aeedda3191b20',1,'QHexEdit']]], ['selectiontoreadablestring',['selectionToReadableString',['../class_q_hex_edit.html#a2ada1230ace92da4e1f006b88ab3b503',1,'QHexEdit']]], ['setdata',['setData',['../class_q_hex_edit.html#ab5221718179da17cbcd9db3bf6574df7',1,'QHexEdit']]], ['setfont',['setFont',['../class_q_hex_edit.html#a57221461a9c9e1b2c0e1882788ac9911',1,'QHexEdit']]] diff --git a/doc/release.txt b/doc/release.txt index 4530dba..251b054 100644 --- a/doc/release.txt +++ b/doc/release.txt @@ -1,3 +1,9 @@ +Release 0.8.6, 2019-03-16 +------------------------- +- Bug fix: select data above 2GB +- add selectedData() method +- minor changes + Release 0.8.5, 2018-12-12 ------------------------- - Dynamic bytesPerLine property diff --git a/setup.py b/setup.py index c07d9b0..3272f94 100644 --- a/setup.py +++ b/setup.py @@ -114,7 +114,7 @@ def _sip_sipfiles_dir(self): setup( name='QHexEdit', - version='0.8.5', + version='0.8.6', ext_modules=[ Extension( "qhexedit",