• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

document/H04-May-2019-1,4021,085

screenshots/H03-May-2022-

LICENSEH A D04-May-20191 KiB2116

QHexView.priH A D04-May-20191.2 KiB3026

README.mdH A D04-May-20192.4 KiB6454

qhexview.cppH A D04-May-201918 KiB649516

qhexview.hH A D04-May-20191.8 KiB6251

README.md

1QHexView
2========
3QHexView is a hexadecimal widget for Qt5
4
5<p align="center">
6<img height="400" src="https://raw.githubusercontent.com/Dax89/QHexEdit/master/screenshots/QHexView.png"><br>
7 <img src="https://img.shields.io/badge/license-MIT-8e725e.svg?style=flat-square">
8 <a href="https://github.com/ellerbrock/open-source-badges/">
9   <img src="https://badges.frapsoft.com/os/v1/open-source.png?v=103">
10 </a>
11</p>
12
13Features
14-----
15- Customizable data backend (see more below).
16- Document/View based.
17- Unlimited Undo/Redo.
18- Fully Customizable.
19- Fast rendering.
20- Easy to Use.
21
22Buffer Backends
23-----
24These are the available buffer backends:
25- QMemoryBuffer: A simple, flat memory array.
26- QMemoryRefBuffer: QHexView just display the referenced data, editing is disabled.<br>
27<br>
28It's also possible to create new data backends from scratch.
29
30Usage
31-----
32The data is managed by QHexView through QHexDocument class.<br>
33You can load a generic QIODevice using the method fromDevice() of QHexDocument class with various buffer backends.<br>
34Helper methods are provided in order to load a QFile a In-Memory buffer in QHexView:<br>
35```cpp
36// Load data from In-Memory Buffer...
37QHexDocument* document = QHexDocument::fromMemory<QMemoryBuffer>(bytearray);
38// ...from a generic I/O device...
39QHexDocument* document = QHexDocument::fromDevice<QMemoryBuffer>(iodevice);
40/* ...or from File */
41QHexDocument* document = QHexDocument::fromFile<QMemoryBuffer>("data.bin");
42
43QHexView* hexview = new QHexView();
44hexview->setDocument(document);                  // Associate QHexEditData with this QHexEdit
45
46// Document editing
47QByteArray data = document->read(24, 78);        // Read 78 bytes starting to offset 24
48document->insert(4, "Hello QHexEdit");           // Insert a string to offset 4
49document->remove(6, 10);                         // Delete bytes from offset 6 to offset 10
50document->replace(30, "New Data");               // Replace bytes from offset 30 with the string "New Data"
51
52// Metatadata management
53QHexMetadata* hexmetadata = document->metadata();
54
55hexmetadata->background(6, 0, 10, Qt::Red);      // Highlight background to line 6, from 0 to 10
56hexmetadata->foreground(8, 0, 15, Qt::darkBLue); // Highlight foreground to line 8, from 0 to 15
57hexmetadata->comment(16, "I'm a comment!");      // Add a comment to line 16
58hexmetadata->clear();                            // Reset styling
59```
60
61License
62-----
63QHexEdit is released under MIT license
64