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

QTreeView/QTreeWidget is really slow and unresponsive when run under MacOS/X with QWindowsStyle

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P2: Important
    • None
    • 4.6.2
    • GUI: Look'n'Feel
    • None
    • MacOS/X 10.6.2 running on a Mac Pro (8 core, 2GB RAM)
    • macOS

    Description

      When use the QTreeView class on a Mac, with the app's style set to QWindowsStyle, the GUI is really slow/laggy/jerky as I resize the window, resize column headers, scroll the view, etc. Doing any of those things also causes one core of my Mac's CPU to shoot up to 90+%. If the QWindowsStyle is not applied, however, then the GUI is quite responsive and CPU load stays negligible.

      To reproduce:

      1) Add the following lines to $QTDIR/examples/itemviews/simpletreemodel/main.cpp:

      app.setStyle(new QWindowsStyle); // add this just after the QApplication object is declared

      view.expandAll(); // add this just before view.show()

      2) Compile and run the application, and see what the app's GUI performance is like (as described above)

      3) Command out the app.setStyle() command (above) and then recompile and test the GUI performance is like again. It should be a LOT faster/smoother now.

      Relevant part of the shark report - looks like the windows style hits a particularly slow path in the Core Graphics paint engine.

       
      	73.8%	73.8%	QtGui	qt_mac_drawCGImage(CGContext*, CGRect const*, CGImage*)
      	0.0%	73.7%	QtGui	 qt_mac_draw_pattern(void*, CGContext*)
      	0.0%	73.7%	QtGui	  QCoreGraphicsPaintEnginePrivate::drawPath(unsigned char, CGPath*)
      	0.0%	72.9%	QtGui	   QCoreGraphicsPaintEngine::drawRects(QRectF const*, int)
      	0.0%	72.9%	QtGui	    QPaintEngine::drawRects(QRect const*, int)
      	0.0%	72.9%	QtGui	     QPainter::drawRects(QRect const*, int)
      	0.0%	72.0%	QtGui	      QPainter::fillRect(QRect const&, QBrush const&)
      	0.0%	72.0%	QtGui	       QWindowsStyle::drawPrimitive(QStyle::PrimitiveElement, QStyleOption const*, QPainter*, QWidget const*) const
      	0.0%	72.0%	QtGui	        QTreeView::drawBranches(QPainter*, QRect const&, QModelIndex const&) const
      	0.0%	72.0%	QtGui	         QTreeView::drawRow(QPainter*, QStyleOptionViewItem const&, QModelIndex const&) const
      	0.0%	72.0%	QtGui	          QTreeView::drawTree(QPainter*, QRegion const&) const
      	0.0%	72.0%	QtGui	           QTreeView::paintEvent(QPaintEvent*)
      
      

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            jfriesne Jeremy Friesner
            Votes:
            12 Vote for this issue
            Watchers:
            15 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes