Destruction of container of QGlyphRuns fails
-
Hi All,
I'm trying to navigate through the set of glyphs in QTextEdit widget, but cannot overcome the following issue: after the list of QGlyphRuns is retrieved, it cannot be destuctured.
Here is the code for getting list of QGlyphRuns:
When glyphs is getting destructed I get _BLOCK_TYPE_IS_VALID assertion failed. I've been trying a several ways to launch the code above:
@QTextDocument* doc = ui->textEdit->document();
QTextBlock block = doc->begin();
while(block.isValid())
{
QTextLayout* tl = block.layout();
{
QList<QGlyphRun> glyphs = tl->glyphRuns();
// the exception raises here, upon exiting the block
}
block = block.next();
}
@When glyphs is getting destructed I get _BLOCK_TYPE_IS_VALID assertion failed. I've been trying a several ways to launch the code above:
- simple slot
- slot handled in a separate thread (with and without use of moveToThread function)
- as an event handler (the event is fired by postEvent method of QApplicaiton)
But none of those helped to get rid of the exception. The only case when it doesn't arise is when the code above is called from MainWindows constructor (after calling ui->setupUI()).
I'm using QT 4.8 non-commercial with MSVC++2010 express. Does anybody have a clue why it happens? And how to workaround it?
Thanks in advance.
-
Perhaps you should file a bug. Your use of QGlyphRun seems totally valid.
-
Thanks Andre,
I've just filed a bug. Now trying to find workaround...
-
Please add a link to the bugreport here and a link to this discussion to the bugreport.
-
the bug is filed here:
https://bugreports.qt-project.org/browse/QTBUG-24920?focusedCommentId=175025#comment-175025 -
I have found out that the problem is caused by use of "release" QT libraries in "debug" version of the project. After switching to the "debug" version the exception has gone.