March 21, 2012

az_personal az_personal
Lab Rat
6 posts

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:

  1. QTextDocument* doc = ui->textEdit->document();
  2. QTextBlock block = doc->begin();
  3. while(block.isValid())
  4. {
  5.     QTextLayout* tl = block.layout();
  6.     {
  7.         QList<QGlyphRun> glyphs = tl->glyphRuns();
  8.         // the exception raises here, upon exiting the block
  9.     }      
  10.     block = block.next();
  11. }

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.

5 replies

March 22, 2012

Andre Andre
Robot Herder
6420 posts

Perhaps you should file a bug. Your use of QGlyphRun seems totally valid.

March 22, 2012

az_personal az_personal
Lab Rat
6 posts

Thanks Andre,

I’ve just filed a bug. Now trying to find workaround…

March 22, 2012

Lukas Geyer Lukas Geyer
Lab Rat
2074 posts

Please add a link to the bugreport here and a link to this discussion to the bugreport.

March 23, 2012

az_personal az_personal
Lab Rat
6 posts

the bug is filed here:
https://bugreports.qt-project.org/browse/QTBUG-24920?focusedCommentId=175025#comment-175025

March 26, 2012

az_personal az_personal
Lab Rat
6 posts

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.

 
  ‹‹ How can I use QX11Info to make a custom dock bar. (like KDE)      [BUG?] containerextension - designer’s plugin example is broken ››

You must log in to post a reply. Not a member yet? Register here!