Comments (7)
Starting from this commit: 2a662d4
I have rewrited QHexEditData from scratch in order to support big files (and generic QIODevice objects too).
Now, QHexEditData's constructor is private, and you can load a generic I/O Device or an In-Memory buffer using these three methods:
- QHexEditData::fromFile()
- QHexEditData::fromBuffer()
- QHexEditData::fromDevice()
By looking at your source code, I have seen in setupInstructionEncoding() method these lines of code:
void MainWindow::setupInstructionEncoding()
{
char buf[32];
memset(buf, 0, sizeof(buf));
QBuffer *encodingBuffer;
encodingBuffer = new QBuffer();
encodingBuffer->open(QBuffer::ReadWrite);
encodingBuffer->write(buf, sizeof(buf));
m_encodingData = new QHexEditData(encodingBuffer);
...
}
which can be rewritten as:
void MainWindow::setupInstructionEncoding()
{
/* Create a buffer with length = 32, and fill it with 0x00 */
QByteArray buf(32, 0x00);
/* Associate this buffer with QHexEditData, and take the ownership */
m_encodingData = QHexEditData::fromBuffer(buf);
...
}
from qhexview.
OK, good to hear - I'll take a look at that.
That said, since internalInsert and internalRemove can return NULL, so I think it would be good to check the return value from them.
from qhexview.
With the fromBuffer() stuff, I can now compile, but I still get the crash.
What I do is basically
void MainWindow::setupInstructionEncoding()
{
QByteArray buf(32, 0x0);
m_encodingData = QHexEditData::fromMemory(buf);
[...]
m_encodingHexEdit = new QHexEdit(m_ui->instructionEncodingLineEdit);
m_encodingHexEdit->setData(m_encodingData);
}
void MainWindow::updateInstructionEncoding(const IInstruction* insn)
{
uint8_t buf[32];
[... fill in buf]
m_encodingData->replace(0, 32, QByteArray((const char *)buf, sizeof(buf)));
}
where updateInstructionEncoding is called to fill in the current position. I get a crash in replace(), and get the same behavior when using remove() + insert().
from qhexview.
Ok, I can reproduce this bug, I will fix it in short time!
Sorry for this issue :)
from qhexview.
The commit e7eb910 should fix the bug.
Let me know if it works now.
from qhexview.
Yes, after that commit it works again.
Thanks!
On Sat, Jan 18, 2014 at 6:35 PM, Antonio Davide [email protected]:
The commit e7eb910e7eb91051706c3e02a02e979d6e9b02cc8fcc729should fix the bug.
Let me know if it works now.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-32687448
.
from qhexview.
Great!
from qhexview.
Related Issues (20)
- Hex display width and comments HOT 7
- Unsymmetric page-up vs page-down HOT 1
- Render artefacts on top right of Hex Table HOT 6
- Possible error
- Fractional QFont width on a Pi HOT 4
- Horizontal scroll bar issues HOT 4
- QHexView cannot build HOT 4
- QHexview displays the extension HOT 4
- support change font size using setFont(...) HOT 5
- Renderer does not work well with widget’s width HOT 5
- Add dataChanged signal HOT 1
- Optional radio buttons that switch mode (insert / overwrite) inside header HOT 1
- Configurable mouse wheel scroll speed HOT 1
- Non-blinking cursor HOT 2
- Incorrect cursor selection rendering in ASCII area HOT 8
- QHexView does not support Qt5.7 HOT 5
- QHexDocument::searchForward does not move the cursor past the first result
- QHexView 5.0 Development HOT 94
- Qt6 compatibility (5.0 branch) HOT 2
- 5.0 branch and Qt5 cmake compatibility HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qhexview.