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

Applicatio crash when draw text

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 4.8.0
    • None
    • Mac OSX Lion

    Description

      My application crash when use drawtext (under mac osx lion with qt-4.8.0 release)
      It crash when call
      painter->drawText(m_rect, Qt::TextWordWrap | Qt::AlignTop | Qt::AlignHCenter, m_strContent);

      /*************** my code ******************/
      void Comment::Draw(QPainter* painter, const QRectF& clip)
      {
      painter->save();
      painter->setClipRect(clip);
      painter->setPen(QColor(0,0,0,50));

      //Draw text
      painter->setFont(m_font);
      painter->drawText(m_rect, Qt::TextWordWrap | Qt::AlignTop | Qt::AlignHCenter, m_strContent);
      painter->restore();
      }

      /*************** the crash report ******************/

      Code Type: X86-64 (Native)
      Parent Process: launchd [152]

      Date/Time: 2011-12-17 14:37:40.914 +0800
      OS Version: Mac OS X 10.7.2 (11C74)
      Report Version: 9

      Crashed Thread: 0 Dispatch queue: com.apple.main-thread

      Exception Type: EXC_BAD_ACCESS (SIGSEGV)
      Exception Codes: KERN_INVALID_ADDRESS at 0x00007fff5fc00000

      VM Regions Near 0x7fff5fc00000:
      Stack 00007fff5f400000-00007fff5fc00000 [ 8192K] rw-/rwx SM=COW thread 0
      -->
      __TEXT 00007fff6015a000-00007fff6018f000 [ 212K] r-x/rwx SM=COW /usr/lib/dyld

      Application Specific Information:
      objc[282]: garbage collection is OFF

      Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
      0 QtGui 0x00000001005b75e8 QTextEngine::shape(int) const + 1160
      1 QtGui 0x00000001005c3f8f QTextLine::draw(QPainter*, QPointF const&, QTextLayout::FormatRange const*) const + 1087
      2 QtGui 0x00000001004b944c QPainter::setClipRect(QRectF const&, Qt::ClipOperation) + 5500
      3 QtGui 0x00000001004b9a74 QPainter::drawText(QRectF const&, int, QString const&, QRectF*) + 180
      4 tw.idv.swordsoft.Layout 0x0000000100097d55 SwordSoft::Comment::Draw(QPainter*, QRectF const&) + 1221
      5 tw.idv.swordsoft.Layout 0x000000010002a996 MainDoc::Draw(QPainter*, QRectF const&) + 1510
      6 tw.idv.swordsoft.Layout 0x0000000100025f57 MainView::paintEvent(QPaintEvent*

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            sword726 sword726
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes