Skip to content

Commit

Permalink
Remove calls to processEvent which are short-circuiting the draw even…
Browse files Browse the repository at this point in the history
…t in Qt4.

Something in our draw event is triggering another draw event during resizing. processEvent immediately moves to the next draw event.
For X11, menus and toolbars became corrupted and crashes occurred. For Mac, the map canvas did not resize at all. The following warnings were appearing on the console: "QWidget::repaint: recursive repaint detected" and "QPixmap::operator=: Cannot assign to pixmap during painting."
Event processing to capture a keyboard cancel command should be reinstated when the source of the recursion is found and fixed.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4753 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed Jan 26, 2006
1 parent 3cb3337 commit 0113308
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/gui/qgsvectorlayer.cpp
Expand Up @@ -417,7 +417,9 @@ void QgsVectorLayer::drawLabels(QPainter * p, QgsRect * viewExtent, QgsMapToPixe
#ifdef QGISDEBUG
std::cerr << "Total features processed is " << featureCount << std::endl;
#endif
qApp->processEvents();
// XXX Something in our draw event is triggering an additional draw event when resizing [TE 01/26/06]
// XXX Calling this will begin processing the next draw event causing image havoc and recursion crashes.
//qApp->processEvents();

}
}
Expand Down Expand Up @@ -876,7 +878,9 @@ void QgsVectorLayer::draw(QPainter * p, QgsRect * viewExtent, QgsMapToPixel * th
// std::cout << "QgsVectorLayer::draw: got " << fet->featureId() << std::endl;
#endif

qApp->processEvents(); //so we can trap for esc press
// XXX Something in our draw event is triggering an additional draw event when resizing [TE 01/26/06]
// XXX Calling this will begin processing the next draw event causing image havoc and recursion crashes.
//qApp->processEvents(); //so we can trap for esc press
if (mDrawingCancelled) return;
// If update threshold is greater than 0, check to see if
// the threshold has been exceeded
Expand Down Expand Up @@ -968,7 +972,9 @@ void QgsVectorLayer::draw(QPainter * p, QgsRect * viewExtent, QgsMapToPixel * th
#ifdef QGISDEBUG
std::cerr << "Total features processed is " << featureCount << std::endl;
#endif
qApp->processEvents();
// XXX Something in our draw event is triggering an additional draw event when resizing [TE 01/26/06]
// XXX Calling this will begin processing the next draw event causing image havoc and recursion crashes.
//qApp->processEvents();
}
else
{
Expand Down

0 comments on commit 0113308

Please sign in to comment.