Dax89 / QHexView

A versatile Hexadecimal widget for Qt5
MIT License
323 stars 101 forks source link

is modified? #84

Closed diegoiast closed 1 month ago

diegoiast commented 1 month ago

I am looking for a way to know if the document has been modified, and then prompt the user to save it.

I saw no API for it. I tried "document()->canUndo()" - but this returns true even when loading a document, and doing nothing. Any ideas? I tried adding this to QHexDocument() which just crashed my app:

bool isModified() const { m_undostack.isClean(); }

EDIT: The canUndo() issue is a bug in my part. We can ignore it.

Dax89 commented 1 month ago

There is no problem to can add isModified() along with its signal.

document()->canUndo() should return false after a document is loaded, how are you loading data?

Dax89 commented 1 month ago

isModified(), clearModified() and modifiedChanged() signal added in both QHexDocument and QHexView