[SOLVED] Mark QTextDocument as not modified
-
Hello,
I would like to update the modified property in QTextDocument once the contents of a QTextEdit/QPlainTextEdit have been saved to a file. I do not see any obvious way to go about doing that. In my close implementation I would like to check the modified status and show a notice to users that there are unsaved edits. I could of course maintain my own flag(s) and use it for my close implementation, but wanted to make sure I was not missing a built-in feature.
Thanks
Rakesh -
Have you tried "setModified":http://qt-project.org/doc/qt-5/qtextdocument.html#modified-prop ?
-
Yes, I had already tried that, only indirectly though. By constant casting the instance made available through the editor document method. I will test by keeping my own document and setting the editor with that instance.
-
[quote author="sptrakesh" date="1414969970"]By constant casting the instance made available through the editor document method.[/quote]
Huh? The document() method of QTextEdit returns QTextDocument*. What do you need a const cast for? -
Duh, you are right. Just read the const at the wrong place.
-
Found the issue, wrong connection :-(