Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-18192

Crash when invoking blockBoundingRect over a QTextDocument documentLayout

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.7.4
    • 4.7.2
    • GUI: Text handling
    • None
    • fda299f55dd5aeb2d075f6f5c842f75c9f559f9c

    Description

      Qt crashes when executing this program

      #include <QAbstractTextDocumentLayout>
      #include <QApplication>
      #include <QDebug>
      #include <QTextBlock>
      #include <QTextDocument>
      
      int main (int argc, char *argv[])
      {
      	QApplication a(argc, argv);
      	QTextDocument d;
      	QTextBlock b;
      	if (d.documentLayout())
      	{
      		qDebug() << "Layout not null";
      		d.documentLayout()->blockBoundingRect(b);
      	}
      }
      

      If it is expected i would like you do improve the documentation explaining that blockBoundingRect will crash on empty QTextBlocks

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            tsdgeos Albert Astals Cid
            Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes