Skip to content

Commit

Permalink
Deal with QGIS' need to talk
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 29, 2017
1 parent f8f834b commit f4cc870
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
28 changes: 14 additions & 14 deletions src/core/qgsmaprenderercustompainterjob.cpp
Expand Up @@ -32,12 +32,12 @@ QgsMapRendererCustomPainterJob::QgsMapRendererCustomPainterJob( const QgsMapSett
, mActive( false )
, mRenderSynchronously( false )
{
QgsDebugMsg( "QPAINTER construct" );
QgsDebugMsgLevel( "QPAINTER construct", 5 );
}

QgsMapRendererCustomPainterJob::~QgsMapRendererCustomPainterJob()
{
QgsDebugMsg( "QPAINTER destruct" );
QgsDebugMsgLevel( "QPAINTER destruct", 5 );
Q_ASSERT( !mFutureWatcher.isRunning() );
//cancel();
}
Expand All @@ -53,9 +53,9 @@ void QgsMapRendererCustomPainterJob::start()

mErrors.clear();

QgsDebugMsg( "QPAINTER run!" );
QgsDebugMsgLevel( "QPAINTER run!", 5 );

QgsDebugMsg( "Preparing list of layer jobs for rendering" );
QgsDebugMsgLevel( "Preparing list of layer jobs for rendering", 5 );
QTime prepareTime;
prepareTime.start();

Expand All @@ -82,7 +82,7 @@ void QgsMapRendererCustomPainterJob::start()
mLayerJobs = prepareJobs( mPainter, mLabelingEngineV2.get() );
mLabelJob = prepareLabelingJob( mPainter, mLabelingEngineV2.get(), canUseLabelCache );

QgsDebugMsg( "Rendering prepared in (seconds): " + QString( "%1" ).arg( prepareTime.elapsed() / 1000.0 ) );
QgsDebugMsgLevel( "Rendering prepared in (seconds): " + QString( "%1" ).arg( prepareTime.elapsed() / 1000.0 ), 4 );

if ( mRenderSynchronously )
{
Expand All @@ -103,11 +103,11 @@ void QgsMapRendererCustomPainterJob::cancel()
{
if ( !isActive() )
{
QgsDebugMsg( "QPAINTER not running!" );
QgsDebugMsgLevel( "QPAINTER not running!", 4 );
return;
}

QgsDebugMsg( "QPAINTER canceling" );
QgsDebugMsgLevel( "QPAINTER canceling", 5 );
disconnect( &mFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererCustomPainterJob::futureFinished );
cancelWithoutBlocking();

Expand All @@ -116,11 +116,11 @@ void QgsMapRendererCustomPainterJob::cancel()

mFutureWatcher.waitForFinished();

QgsDebugMsg( QString( "QPAINER cancel waited %1 ms" ).arg( t.elapsed() / 1000.0 ) );
QgsDebugMsgLevel( QString( "QPAINER cancel waited %1 ms" ).arg( t.elapsed() / 1000.0 ), 5 );

futureFinished();

QgsDebugMsg( "QPAINTER canceled" );
QgsDebugMsgLevel( "QPAINTER canceled", 5 );
}

void QgsMapRendererCustomPainterJob::cancelWithoutBlocking()
Expand Down Expand Up @@ -152,7 +152,7 @@ void QgsMapRendererCustomPainterJob::waitForFinished()

mFutureWatcher.waitForFinished();

QgsDebugMsg( QString( "waitForFinished: %1 ms" ).arg( t.elapsed() / 1000.0 ) );
QgsDebugMsgLevel( QString( "waitForFinished: %1 ms" ).arg( t.elapsed() / 1000.0 ), 4 );

futureFinished();
}
Expand Down Expand Up @@ -197,7 +197,7 @@ void QgsMapRendererCustomPainterJob::futureFinished()
{
mActive = false;
mRenderingTime = mRenderingStart.elapsed();
QgsDebugMsg( "QPAINTER futureFinished" );
QgsDebugMsgLevel( "QPAINTER futureFinished", 5 );

logRenderingTime( mLayerJobs, mLabelJob );

Expand Down Expand Up @@ -233,7 +233,7 @@ void QgsMapRendererCustomPainterJob::staticRender( QgsMapRendererCustomPainterJo

void QgsMapRendererCustomPainterJob::doRender()
{
QgsDebugMsg( "Starting to render layer stack." );
QgsDebugMsgLevel( "Starting to render layer stack.", 5 );
QTime renderTime;
renderTime.start();

Expand Down Expand Up @@ -277,7 +277,7 @@ void QgsMapRendererCustomPainterJob::doRender()

}

QgsDebugMsg( "Done rendering map layers" );
QgsDebugMsgLevel( "Done rendering map layers", 5 );

if ( mSettings.testFlag( QgsMapSettings::DrawLabeling ) && !mLabelJob.context.renderingStopped() )
{
Expand Down Expand Up @@ -318,7 +318,7 @@ void QgsMapRendererCustomPainterJob::doRender()

void QgsMapRendererJob::drawLabeling( const QgsMapSettings &settings, QgsRenderContext &renderContext, QgsLabelingEngine *labelingEngine2, QPainter *painter )
{
QgsDebugMsg( "Draw labeling start" );
QgsDebugMsgLevel( "Draw labeling start", 5 );

QTime t;
t.start();
Expand Down
10 changes: 5 additions & 5 deletions src/gui/qgscollapsiblegroupbox.cpp
Expand Up @@ -91,16 +91,16 @@ void QgsCollapsibleGroupBoxBasic::showEvent( QShowEvent *event )

// find parent QScrollArea - this might not work in complex layouts - should we look deeper?
if ( parent() && parent()->parent() )
mParentScrollArea = dynamic_cast<QScrollArea *>( parent()->parent()->parent() );
mParentScrollArea = qobject_cast<QScrollArea *>( parent()->parent()->parent() );
else
mParentScrollArea = nullptr;
if ( mParentScrollArea )
{
QgsDebugMsg( "found a QScrollArea parent: " + mParentScrollArea->objectName() );
QgsDebugMsgLevel( "found a QScrollArea parent: " + mParentScrollArea->objectName(), 5 );
}
else
{
QgsDebugMsg( "did not find a QScrollArea parent" );
QgsDebugMsgLevel( "did not find a QScrollArea parent", 5 );
}

updateStyle();
Expand Down Expand Up @@ -355,8 +355,8 @@ void QgsCollapsibleGroupBoxBasic::updateStyle()
}
}

QgsDebugMsg( QString( "groupbox: %1 style: %2 offset: left=%3 top=%4 top2=%5" ).arg(
objectName(), QApplication::style()->objectName() ).arg( offsetLeft ).arg( offsetTop ).arg( offsetTopTri ) );
QgsDebugMsgLevel( QString( "groupbox: %1 style: %2 offset: left=%3 top=%4 top2=%5" ).arg(
objectName(), QApplication::style()->objectName() ).arg( offsetLeft ).arg( offsetTop ).arg( offsetTopTri ), 5 );

// customize style sheet for collapse/expand button and force left-aligned title
QString ss;
Expand Down

0 comments on commit f4cc870

Please sign in to comment.