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

Black artifacts when scrolling QTextEdit on Mac

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 4.8.0
    • None
    • OSX Lion
    • macOS

    Description

      When using a text edit as a central widget you get black artifacts on left side of the text edit when scrolling the view. Use for example the following code:

      #include <QtGui/QApplication>
      #include "mainwindow.h"
      #include <QTextEdit>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          MainWindow w;
          QTextEdit *textEdit = new QTextEdit();
          for (int i(0); i < 100; i++)
              textEdit->setPlainText(textEdit->toPlainText() + QString::number(i) + "abc\n");
          w.setCentralWidget(textEdit);
          w.show();
          return a.exec();
      }
      

      The bug has to be related to the mac specific widget drawing optimizations, because if you make the following change to drawRect in qcocoaview_mac.mm, the bug disappears:

      // Comment out the following line of code:
      //qt_mac_clearDirtyOnWidgetInsideDrawWidget = true;
      qwidgetPrivate->drawWidget(qwidget, qrgn, QPoint(), flags, 0);
      qt_mac_clearDirtyOnWidgetInsideDrawWidget = false;
      

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              teahola Tero Ahola (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes