Unsolved QSyntaxHighlighter rehighlight() ignores changes triggered from another thread
-
Hi
Ran your bug report sample in 5.10.1
Is that the expected non working output ?
-
@aha_1980 said in QSyntaxHighlighter rehighlight() ignores changes triggered from another thread:
The report was one week before christmas, so we effectively have three month since the report. I would not call that never.
Furthermore, if you have a commercial license, let the commercial support add the corresponding tag to the report. Also Qt developers need to pay their flat and get something to eat and drink.
If you don't have, there is more you can do. If 5.6.2 is the last working version, you can try to find the first broken version. Is it 5.7, 5.8, or 5.9? Or was it in a patch release?
You can even go a step further and do git bisect to find the first broken commit. That's all a lot of work that keeps the developer from developing (and fixing bugs).
And last but not least, you are the only watcher of this bug, so I guess it's just a corner case you have hit. There are other bugs that effect a lot of people and that are therefore with higher priority.
Thanks.
The bug first appeared in 5.6.3 and later. Obviously I don't have commercial license otherwise I wouldn't complain on forums but called support directly.
Are you kidding regarding git bisect? I cannot waste days rebuilding Qt all the time with different patches and then running my test against it by hand. It cannot be detected automatically, unfortunately.
Yes, I'm the only watcher, but I wouldn't call it such an edge case - to desire Qt to behave accordingly to specification (when you do
setFormat()
for the format to change).I believe this should be very easy to fix for a person who is familiar with the codebase. Probably just description of the problem would be enough for such person, but there's also a working sample.
-
@mrjj said in QSyntaxHighlighter rehighlight() ignores changes triggered from another thread:
Hi
Ran your bug report sample in 5.10.1
Is that the expected non working output ?
Hi. I will check it in 5.10.1 tomorrow, thanks!
Sometimes if you manually put cursor into the TextEdit it gets updated and turns red, but it's not always like that.
If you can repro it consistently then maybe it's working in 5.10.1 (I wanted to LTS), I'll try tomorrow. -
I tested it and it looks like it works as expected - every 8 seconds the text is marked completely red when I type something.
But the way you check for isOK() is for sure not what you want. You want an atomic here. If you don't trust me, see for example here https://stackoverflow.com/questions/4557979/when-to-use-volatile-with-multi-threading -
@Christian-Ehrlicher said in QSyntaxHighlighter rehighlight() ignores changes triggered from another thread:
I tested it and it looks like it works as expected - every 8 seconds the text is marked completely red when I type something.
But the way you check for isOK() is for sure not what you want. You want an atomic here. If you don't trust me, see for example here https://stackoverflow.com/questions/4557979/when-to-use-volatile-with-multi-threadingHi @Christian-Ehrlicher
Thanks for trying it out. Could you please let me know it works as expected using Qt of which version?
Yeah, I know about atomics, this was just super dirty hack not to rehighlight each second. My real code does not have this garbage. -
@ribtoks said in QSyntaxHighlighter rehighlight() ignores changes triggered from another thread:
The bug first appeared in 5.6.3 and later.
So it is a regression from 5.6.2 to 5.6.3? I wonder why this important information is not stated in the bug report.
Are you kidding regarding git bisect? I cannot waste days rebuilding Qt all the time with different patches and then running my test against it by hand. It cannot be detected automatically, unfortunately.
And therefore you expect others to search for the problem?
-
@aha_1980 I expect "others" who know this particular code to look at the code, not to run
git bisect
and test every other patch. I believe there's a person writing most of theQTextDocument
andQTextDocumentPrivate
and who knows how it works. I don't know how it works and it will probably take me quite some time, not mentioning time to setup build environment for Qt.Qt 5.6.x was LTS where people continuously fix stuff, not break stuff which used to work before. And it's just ridiculous somebody assigned P2 "Critical" to the issue, but nobody cares to fix. I would understand if it was P6 and nobody cared.
-
It works with 5.10.0 / linux for me.
btw: I don't see any significant changes in qsyntaxhighlighter.cpp for the last years -
@Christian-Ehrlicher said in QSyntaxHighlighter rehighlight() ignores changes triggered from another thread:
It works with 5.10.0 / linux for me.
btw: I don't see any significant changes in qsyntaxhighlighter.cpp for the last yearsThe change could be in
QTextDocument
orTextEdit
(the end result is thatTextEdit
does not update the highlighting). I never said the bug is insideQSyntaxHighlighter
. Thanks for checking it btw!For me it does not work on macOS and Windows.
-
Hi,
Got text hightlighted on macOS from time to time on macOS with 5.10 and 5.11 self-built.
-
@SGaist said in QSyntaxHighlighter rehighlight() ignores changes triggered from another thread:
Hi,
from time to time on macOS
Hello. Yes, that's the problem, "from time to time". Thanks for trying it out btw!