Skip to content
Permalink
Browse files

Don't use deprecated QCoreApplication::hasPendingEvents method

This was deprecated by qt for numerous reasons, but mostly because
it was totally misleading in a lot of circumstances.
  • Loading branch information
nyalldawson committed Feb 4, 2020
1 parent 859f741 commit 1f79485f8f6e72c0ea59ec38397f12585bbc24f6
@@ -2553,12 +2553,10 @@ void QgsLayoutDesignerDialog::printAtlas()
proxyTask->setProxyProgress( progress );

#ifdef Q_OS_LINUX
// For some reason on Windows hasPendingEvents() always return true,
// but one iteration is actually enough on Windows to get good interactivity
// One iteration is actually enough on Windows to get good interactivity
// whereas on Linux we must allow for far more iterations.
// For safety limit the number of iterations
int nIters = 0;
while ( QCoreApplication::hasPendingEvents() && ++nIters < 100 )
while ( ++nIters < 100 )
#endif
{
QCoreApplication::processEvents();
@@ -2737,12 +2735,10 @@ void QgsLayoutDesignerDialog::exportAtlasToRaster()
proxyTask->setProxyProgress( progress );

#ifdef Q_OS_LINUX
// For some reason on Windows hasPendingEvents() always return true,
// but one iteration is actually enough on Windows to get good interactivity
// One iteration is actually enough on Windows to get good interactivity
// whereas on Linux we must allow for far more iterations.
// For safety limit the number of iterations
int nIters = 0;
while ( QCoreApplication::hasPendingEvents() && ++nIters < 100 )
while ( ++nIters < 100 )
#endif
{
QCoreApplication::processEvents();
@@ -2894,12 +2890,10 @@ void QgsLayoutDesignerDialog::exportAtlasToSvg()
proxyTask->setProxyProgress( progress );

#ifdef Q_OS_LINUX
// For some reason on Windows hasPendingEvents() always return true,
// but one iteration is actually enough on Windows to get good interactivity
// One iteration is actually enough on Windows to get good interactivity
// whereas on Linux we must allow for far more iterations.
// For safety limit the number of iterations
int nIters = 0;
while ( QCoreApplication::hasPendingEvents() && ++nIters < 100 )
while ( ++nIters < 100 )
#endif
{
QCoreApplication::processEvents();
@@ -3108,12 +3102,10 @@ void QgsLayoutDesignerDialog::exportAtlasToPdf()
proxyTask->setProxyProgress( progress );

#ifdef Q_OS_LINUX
// For some reason on Windows hasPendingEvents() always return true,
// but one iteration is actually enough on Windows to get good interactivity
// One iteration is actually enough on Windows to get good interactivity
// whereas on Linux we must allow for far more iterations.
// For safety limit the number of iterations
int nIters = 0;
while ( QCoreApplication::hasPendingEvents() && ++nIters < 100 )
while ( ++nIters < 100 )
#endif
{
QCoreApplication::processEvents();
@@ -3243,12 +3235,10 @@ void QgsLayoutDesignerDialog::exportReportToRaster()
progressDialog->setLabelText( feedback->property( "progress" ).toString() ) ;

#ifdef Q_OS_LINUX
// For some reason on Windows hasPendingEvents() always return true,
// but one iteration is actually enough on Windows to get good interactivity
// One iteration is actually enough on Windows to get good interactivity
// whereas on Linux we must allow for far more iterations.
// For safety limit the number of iterations
int nIters = 0;
while ( QCoreApplication::hasPendingEvents() && ++nIters < 100 )
while ( ++nIters < 100 )
#endif
{
QCoreApplication::processEvents();
@@ -3361,12 +3351,10 @@ void QgsLayoutDesignerDialog::exportReportToSvg()
progressDialog->setLabelText( feedback->property( "progress" ).toString() ) ;

#ifdef Q_OS_LINUX
// For some reason on Windows hasPendingEvents() always return true,
// but one iteration is actually enough on Windows to get good interactivity
// One iteration is actually enough on Windows to get good interactivity
// whereas on Linux we must allow for far more iterations.
// For safety limit the number of iterations
int nIters = 0;
while ( QCoreApplication::hasPendingEvents() && ++nIters < 100 )
while ( ++nIters < 100 )
#endif
{
QCoreApplication::processEvents();
@@ -3498,12 +3486,10 @@ void QgsLayoutDesignerDialog::exportReportToPdf()
progressDialog->setLabelText( feedback->property( "progress" ).toString() ) ;

#ifdef Q_OS_LINUX
// For some reason on Windows hasPendingEvents() always return true,
// but one iteration is actually enough on Windows to get good interactivity
// One iteration is actually enough on Windows to get good interactivity
// whereas on Linux we must allow for far more iterations.
// For safety limit the number of iterations
int nIters = 0;
while ( QCoreApplication::hasPendingEvents() && ++nIters < 100 )
while ( ++nIters < 100 )
#endif
{
QCoreApplication::processEvents();
@@ -3605,12 +3591,10 @@ void QgsLayoutDesignerDialog::printReport()
progressDialog->setLabelText( feedback->property( "progress" ).toString() ) ;

#ifdef Q_OS_LINUX
// For some reason on Windows hasPendingEvents() always return true,
// but one iteration is actually enough on Windows to get good interactivity
// One iteration is actually enough on Windows to get good interactivity
// whereas on Linux we must allow for far more iterations.
// For safety limit the number of iterations
int nIters = 0;
while ( QCoreApplication::hasPendingEvents() && ++nIters < 100 )
while ( ++nIters < 100 )
#endif
{
QCoreApplication::processEvents();
@@ -530,12 +530,11 @@ void QgsProcessingAlgorithmDialogBase::processEvents()

// So that we get a chance of hitting the Abort button
#ifdef Q_OS_LINUX
// For some reason on Windows hasPendingEvents() always return true,
// but one iteration is actually enough on Windows to get good interactivity
// One iteration is actually enough on Windows to get good interactivity
// whereas on Linux we must allow for far more iterations.
// For safety limit the number of iterations
int nIters = 0;
while ( QCoreApplication::hasPendingEvents() && ++nIters < 100 )
while ( ++nIters < 100 )
#endif
{
QCoreApplication::processEvents();
@@ -143,12 +143,10 @@ bool QgsValidityCheckResultsWidget::runChecks( int type, const QgsValidityCheckC
proxyTask->setProxyProgress( progress );

#ifdef Q_OS_LINUX
// For some reason on Windows hasPendingEvents() always return true,
// but one iteration is actually enough on Windows to get good interactivity
// One iteration is actually enough on Windows to get good interactivity
// whereas on Linux we must allow for far more iterations.
// For safety limit the number of iterations
int nIters = 0;
while ( QCoreApplication::hasPendingEvents() && ++nIters < 100 )
while ( ++nIters < 100 )
#endif
{
QCoreApplication::processEvents();

0 comments on commit 1f79485

Please sign in to comment.
You can’t perform that action at this time.