Skip to content

Commit b238103

Browse files
committedSep 29, 2017
Deal with QGIS' need to talk
1 parent e06ec71 commit b238103

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed
 

‎src/core/qgsmaprenderercustompainterjob.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ QgsMapRendererCustomPainterJob::QgsMapRendererCustomPainterJob( const QgsMapSett
3232
, mActive( false )
3333
, mRenderSynchronously( false )
3434
{
35-
QgsDebugMsg( "QPAINTER construct" );
35+
QgsDebugMsgLevel( "QPAINTER construct", 5 );
3636
}
3737

3838
QgsMapRendererCustomPainterJob::~QgsMapRendererCustomPainterJob()
3939
{
40-
QgsDebugMsg( "QPAINTER destruct" );
40+
QgsDebugMsgLevel( "QPAINTER destruct", 5 );
4141
Q_ASSERT( !mFutureWatcher.isRunning() );
4242
//cancel();
4343
}
@@ -53,9 +53,9 @@ void QgsMapRendererCustomPainterJob::start()
5353

5454
mErrors.clear();
5555

56-
QgsDebugMsg( "QPAINTER run!" );
56+
QgsDebugMsgLevel( "QPAINTER run!", 5 );
5757

58-
QgsDebugMsg( "Preparing list of layer jobs for rendering" );
58+
QgsDebugMsgLevel( "Preparing list of layer jobs for rendering", 5 );
5959
QTime prepareTime;
6060
prepareTime.start();
6161

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

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

8787
if ( mRenderSynchronously )
8888
{
@@ -103,11 +103,11 @@ void QgsMapRendererCustomPainterJob::cancel()
103103
{
104104
if ( !isActive() )
105105
{
106-
QgsDebugMsg( "QPAINTER not running!" );
106+
QgsDebugMsgLevel( "QPAINTER not running!", 4 );
107107
return;
108108
}
109109

110-
QgsDebugMsg( "QPAINTER canceling" );
110+
QgsDebugMsgLevel( "QPAINTER canceling", 5 );
111111
disconnect( &mFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererCustomPainterJob::futureFinished );
112112
cancelWithoutBlocking();
113113

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

117117
mFutureWatcher.waitForFinished();
118118

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

121121
futureFinished();
122122

123-
QgsDebugMsg( "QPAINTER canceled" );
123+
QgsDebugMsgLevel( "QPAINTER canceled", 5 );
124124
}
125125

126126
void QgsMapRendererCustomPainterJob::cancelWithoutBlocking()
@@ -152,7 +152,7 @@ void QgsMapRendererCustomPainterJob::waitForFinished()
152152

153153
mFutureWatcher.waitForFinished();
154154

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

157157
futureFinished();
158158
}
@@ -197,7 +197,7 @@ void QgsMapRendererCustomPainterJob::futureFinished()
197197
{
198198
mActive = false;
199199
mRenderingTime = mRenderingStart.elapsed();
200-
QgsDebugMsg( "QPAINTER futureFinished" );
200+
QgsDebugMsgLevel( "QPAINTER futureFinished", 5 );
201201

202202
logRenderingTime( mLayerJobs, mLabelJob );
203203

@@ -233,7 +233,7 @@ void QgsMapRendererCustomPainterJob::staticRender( QgsMapRendererCustomPainterJo
233233

234234
void QgsMapRendererCustomPainterJob::doRender()
235235
{
236-
QgsDebugMsg( "Starting to render layer stack." );
236+
QgsDebugMsgLevel( "Starting to render layer stack.", 5 );
237237
QTime renderTime;
238238
renderTime.start();
239239

@@ -277,7 +277,7 @@ void QgsMapRendererCustomPainterJob::doRender()
277277

278278
}
279279

280-
QgsDebugMsg( "Done rendering map layers" );
280+
QgsDebugMsgLevel( "Done rendering map layers", 5 );
281281

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

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

323323
QTime t;
324324
t.start();

‎src/gui/qgscollapsiblegroupbox.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,16 @@ void QgsCollapsibleGroupBoxBasic::showEvent( QShowEvent *event )
9191

9292
// find parent QScrollArea - this might not work in complex layouts - should we look deeper?
9393
if ( parent() && parent()->parent() )
94-
mParentScrollArea = dynamic_cast<QScrollArea *>( parent()->parent()->parent() );
94+
mParentScrollArea = qobject_cast<QScrollArea *>( parent()->parent()->parent() );
9595
else
9696
mParentScrollArea = nullptr;
9797
if ( mParentScrollArea )
9898
{
99-
QgsDebugMsg( "found a QScrollArea parent: " + mParentScrollArea->objectName() );
99+
QgsDebugMsgLevel( "found a QScrollArea parent: " + mParentScrollArea->objectName(), 5 );
100100
}
101101
else
102102
{
103-
QgsDebugMsg( "did not find a QScrollArea parent" );
103+
QgsDebugMsgLevel( "did not find a QScrollArea parent", 5 );
104104
}
105105

106106
updateStyle();
@@ -355,8 +355,8 @@ void QgsCollapsibleGroupBoxBasic::updateStyle()
355355
}
356356
}
357357

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.