Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Destruction of container of QGlyphRuns fails
Forum Updated to NodeBB v4.3 + New Features

Destruction of container of QGlyphRuns fails

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 2.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    az_personal
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • A Offline
        A Offline
        az_personal
        wrote on last edited by
        #3

        Thanks Andre,

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

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • A Offline
            A Offline
            az_personal
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • A Offline
              A Offline
              az_personal
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved