Skip to content

Commit 69c58e9

Browse files
manisandronyalldawson
authored andcommitted
Consistently set parent on composer child dialogs
1 parent a0e2fe1 commit 69c58e9

10 files changed

+36
-36
lines changed

src/app/composer/qgscomposerarrowwidget.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void QgsComposerArrowWidget::on_mStartMarkerToolButton_clicked()
264264
openDir = s.value( "/UI/lastComposerMarkerDir", "" ).toString();
265265
}
266266

267-
QString svgFileName = QFileDialog::getOpenFileName( 0, tr( "Start marker svg file" ), openDir );
267+
QString svgFileName = QFileDialog::getOpenFileName( this, tr( "Start marker svg file" ), openDir );
268268
if ( !svgFileName.isNull() )
269269
{
270270
QFileInfo fileInfo( svgFileName );
@@ -291,7 +291,7 @@ void QgsComposerArrowWidget::on_mEndMarkerToolButton_clicked()
291291
openDir = s.value( "/UI/lastComposerMarkerDir", "" ).toString();
292292
}
293293

294-
QString svgFileName = QFileDialog::getOpenFileName( 0, tr( "End marker svg file" ), openDir );
294+
QString svgFileName = QFileDialog::getOpenFileName( this, tr( "End marker svg file" ), openDir );
295295
if ( !svgFileName.isNull() )
296296
{
297297
QFileInfo fileInfo( svgFileName );
@@ -310,7 +310,7 @@ void QgsComposerArrowWidget::on_mLineStyleButton_clicked()
310310
}
311311

312312
QgsLineSymbolV2* newSymbol = dynamic_cast<QgsLineSymbolV2*>( mArrow->lineSymbol()->clone() );
313-
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), 0 );
313+
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), 0, this );
314314

315315
if ( d.exec() == QDialog::Accepted )
316316
{

src/app/composer/qgscomposerattributetablewidget.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void QgsComposerAttributeTableWidget::on_mAttributesPushButton_clicked()
182182
//temporarily block updates for the window, to stop table trying to repaint under windows (#11462)
183183
window()->setUpdatesEnabled( false );
184184

185-
QgsAttributeSelectionDialog d( mComposerTable, mComposerTable->sourceLayer(), 0 );
185+
QgsAttributeSelectionDialog d( mComposerTable, mComposerTable->sourceLayer(), this );
186186
if ( d.exec() == QDialog::Accepted )
187187
{
188188
mComposerTable->refreshAttributes();
@@ -290,9 +290,9 @@ void QgsComposerAttributeTableWidget::on_mHeaderFontPushButton_clicked()
290290
bool ok;
291291
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
292292
// Native Mac dialog works only for Qt Carbon
293-
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->headerFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
293+
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->headerFont(), this, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
294294
#else
295-
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->headerFont(), 0, tr( "Select Font" ) );
295+
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->headerFont(), this, tr( "Select Font" ) );
296296
#endif
297297
if ( ok )
298298
{
@@ -338,9 +338,9 @@ void QgsComposerAttributeTableWidget::on_mContentFontPushButton_clicked()
338338
bool ok;
339339
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
340340
// Native Mac dialog works only for Qt Carbon
341-
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
341+
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), this, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
342342
#else
343-
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), 0, tr( "Select Font" ) );
343+
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), this, tr( "Select Font" ) );
344344
#endif
345345
if ( ok )
346346
{
@@ -575,7 +575,7 @@ void QgsComposerAttributeTableWidget::updateRelationsCombo()
575575
if ( atlasLayer )
576576
{
577577
QList<QgsRelation> relations = QgsProject::instance()->relationManager()->referencedRelations( atlasLayer );
578-
Q_FOREACH ( const QgsRelation& relation, relations )
578+
Q_FOREACH( const QgsRelation& relation, relations )
579579
{
580580
mRelationsComboBox->addItem( relation.name(), relation.id() );
581581
}

src/app/composer/qgscomposerlabelwidget.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ void QgsComposerLabelWidget::on_mFontButton_clicked()
9393
bool ok;
9494
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
9595
// Native Mac dialog works only for Qt Carbon
96-
QFont newFont = QFontDialog::getFont( &ok, mComposerLabel->font(), 0, QString(), QFontDialog::DontUseNativeDialog );
96+
QFont newFont = QFontDialog::getFont( &ok, mComposerLabel->font(), this, QString(), QFontDialog::DontUseNativeDialog );
9797
#else
98-
QFont newFont = QFontDialog::getFont( &ok, mComposerLabel->font() );
98+
QFont newFont = QFontDialog::getFont( &ok, mComposerLabel->font(), this );
9999
#endif
100100
if ( ok )
101101
{

src/app/composer/qgscomposerlegendwidget.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,9 @@ void QgsComposerLegendWidget::on_mTitleFontButton_clicked()
371371
bool ok;
372372
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
373373
// Native Mac dialog works only for Qt Carbon
374-
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Title ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
374+
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Title ).font(), this, QString(), QFontDialog::DontUseNativeDialog );
375375
#else
376-
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Title ).font() );
376+
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Title ).font(), this );
377377
#endif
378378
if ( ok )
379379
{
@@ -393,9 +393,9 @@ void QgsComposerLegendWidget::on_mGroupFontButton_clicked()
393393
bool ok;
394394
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
395395
// Native Mac dialog works only for Qt Carbon
396-
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Group ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
396+
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Group ).font(), this, QString(), QFontDialog::DontUseNativeDialog );
397397
#else
398-
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Group ).font() );
398+
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Group ).font(), this );
399399
#endif
400400
if ( ok )
401401
{
@@ -415,9 +415,9 @@ void QgsComposerLegendWidget::on_mLayerFontButton_clicked()
415415
bool ok;
416416
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
417417
// Native Mac dialog works only for Qt Carbon
418-
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Subgroup ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
418+
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Subgroup ).font(), this, QString(), QFontDialog::DontUseNativeDialog );
419419
#else
420-
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Subgroup ).font() );
420+
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::Subgroup ).font(), this );
421421
#endif
422422
if ( ok )
423423
{
@@ -437,9 +437,9 @@ void QgsComposerLegendWidget::on_mItemFontButton_clicked()
437437
bool ok;
438438
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
439439
// Native Mac dialog works only for Qt Carbon
440-
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::SymbolLabel ).font(), 0, QString(), QFontDialog::DontUseNativeDialog );
440+
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::SymbolLabel ).font(), this, QString(), QFontDialog::DontUseNativeDialog );
441441
#else
442-
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::SymbolLabel ).font() );
442+
QFont newFont = QFontDialog::getFont( &ok, mLegend->style( QgsComposerLegendStyle::SymbolLabel ).font(), this );
443443
#endif
444444
if ( ok )
445445
{
@@ -652,7 +652,7 @@ void QgsComposerLegendWidget::on_mAddToolButton_clicked()
652652
{
653653
QList<QgsMapLayer*> layers = canvas->layers();
654654

655-
QgsComposerLegendLayersDialog addDialog( layers );
655+
QgsComposerLegendLayersDialog addDialog( layers, this );
656656
if ( addDialog.exec() == QDialog::Accepted )
657657
{
658658
QgsMapLayer* layer = addDialog.selectedLayer();

src/app/composer/qgscomposermapwidget.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@ void QgsComposerMapWidget::on_mGridLineStyleButton_clicked()
15561556
}
15571557

15581558
QgsLineSymbolV2* newSymbol = dynamic_cast<QgsLineSymbolV2*>( grid->lineSymbol()->clone() );
1559-
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), 0 );
1559+
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), 0, this );
15601560

15611561
if ( d.exec() == QDialog::Accepted )
15621562
{
@@ -1581,7 +1581,7 @@ void QgsComposerMapWidget::on_mGridMarkerStyleButton_clicked()
15811581
}
15821582

15831583
QgsMarkerSymbolV2* newSymbol = dynamic_cast<QgsMarkerSymbolV2*>( grid->markerSymbol()->clone() );
1584-
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), 0 );
1584+
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), 0, this );
15851585

15861586
if ( d.exec() == QDialog::Accepted )
15871587
{
@@ -2088,9 +2088,9 @@ void QgsComposerMapWidget::on_mAnnotationFontButton_clicked()
20882088
bool ok;
20892089
#if defined(Q_OS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
20902090
// Native Mac dialog works only for Qt Carbon
2091-
QFont newFont = QFontDialog::getFont( &ok, grid->annotationFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
2091+
QFont newFont = QFontDialog::getFont( &ok, grid->annotationFont(), this, QString(), QFontDialog::DontUseNativeDialog );
20922092
#else
2093-
QFont newFont = QFontDialog::getFont( &ok, grid->annotationFont() );
2093+
QFont newFont = QFontDialog::getFont( &ok, grid->annotationFont(), this );
20942094
#endif
20952095
if ( ok )
20962096
{
@@ -2561,7 +2561,7 @@ void QgsComposerMapWidget::on_mOverviewFrameStyleButton_clicked()
25612561
}
25622562

25632563
QgsFillSymbolV2* newSymbol = dynamic_cast<QgsFillSymbolV2*>( overview->frameSymbol()->clone() );
2564-
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), 0 );
2564+
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), 0, this );
25652565

25662566
if ( d.exec() == QDialog::Accepted )
25672567
{

src/app/composer/qgscomposerpicturewidget.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void QgsComposerPictureWidget::on_mPictureBrowseButton_clicked()
9090
}
9191

9292
//show file dialog
93-
QString filePath = QFileDialog::getOpenFileName( 0, tr( "Select svg or image file" ), openDir );
93+
QString filePath = QFileDialog::getOpenFileName( this, tr( "Select svg or image file" ), openDir );
9494
if ( filePath.isEmpty() )
9595
{
9696
return;
@@ -165,7 +165,7 @@ void QgsComposerPictureWidget::on_mPreviewListWidget_currentItemChanged( QListWi
165165
void QgsComposerPictureWidget::on_mAddDirectoryButton_clicked()
166166
{
167167
//let user select a directory
168-
QString directory = QFileDialog::getExistingDirectory( 0, tr( "Select new preview directory" ) );
168+
QString directory = QFileDialog::getExistingDirectory( this, tr( "Select new preview directory" ) );
169169
if ( directory.isNull() )
170170
{
171171
return; //dialog canceled by user

src/app/composer/qgscomposerscalebarwidget.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ void QgsComposerScaleBarWidget::on_mFontButton_clicked()
313313
QFont oldFont = mComposerScaleBar->font();
314314
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
315315
// Native Mac dialog works only for Qt Carbon
316-
QFont newFont = QFontDialog::getFont( &dialogAccepted, oldFont, 0, QString(), QFontDialog::DontUseNativeDialog );
316+
QFont newFont = QFontDialog::getFont( &dialogAccepted, oldFont, this, QString(), QFontDialog::DontUseNativeDialog );
317317
#else
318-
QFont newFont = QFontDialog::getFont( &dialogAccepted, oldFont, 0 );
318+
QFont newFont = QFontDialog::getFont( &dialogAccepted, oldFont, this );
319319
#endif
320320
if ( dialogAccepted )
321321
{

src/app/composer/qgscomposershapewidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void QgsComposerShapeWidget::on_mShapeStyleButton_clicked()
108108
QgsVectorLayer* coverageLayer = atlasCoverageLayer();
109109

110110
QgsFillSymbolV2* newSymbol = dynamic_cast<QgsFillSymbolV2*>( mComposerShape->shapeStyleSymbol()->clone() );
111-
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), coverageLayer );
111+
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), coverageLayer, this );
112112

113113
if ( d.exec() == QDialog::Accepted )
114114
{

src/app/composer/qgscomposertablewidget.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void QgsComposerTableWidget::on_mAttributesPushButton_clicked()
132132

133133
mComposerTable->beginCommand( tr( "Table attribute settings" ) );
134134

135-
QgsAttributeSelectionDialog d( mComposerTable, mComposerTable->vectorLayer(), 0 );
135+
QgsAttributeSelectionDialog d( mComposerTable, mComposerTable->vectorLayer(), this );
136136
if ( d.exec() == QDialog::Accepted )
137137
{
138138
mComposerTable->refreshAttributes();
@@ -217,9 +217,9 @@ void QgsComposerTableWidget::on_mHeaderFontPushButton_clicked()
217217
bool ok;
218218
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
219219
// Native Mac dialog works only for Qt Carbon
220-
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->headerFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
220+
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->headerFont(), this, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
221221
#else
222-
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->headerFont(), 0, tr( "Select Font" ) );
222+
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->headerFont(), this, tr( "Select Font" ) );
223223
#endif
224224
if ( ok )
225225
{
@@ -252,9 +252,9 @@ void QgsComposerTableWidget::on_mContentFontPushButton_clicked()
252252
bool ok;
253253
#if defined(Q_OS_MAC) && defined(QT_MAC_USE_COCOA)
254254
// Native Mac dialog works only for Qt Carbon
255-
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), 0, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
255+
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), this, tr( "Select Font" ), QFontDialog::DontUseNativeDialog );
256256
#else
257-
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), 0, tr( "Select Font" ) );
257+
QFont newFont = QFontDialog::getFont( &ok, mComposerTable->contentFont(), this, tr( "Select Font" ) );
258258
#endif
259259
if ( ok )
260260
{

src/app/composer/qgscompositionwidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ void QgsCompositionWidget::on_mPageStyleButton_clicked()
531531
{
532532
newSymbol = new QgsFillSymbolV2();
533533
}
534-
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), coverageLayer );
534+
QgsSymbolV2SelectorDialog d( newSymbol, QgsStyleV2::defaultStyle(), coverageLayer, this );
535535

536536
if ( d.exec() == QDialog::Accepted )
537537
{

0 commit comments

Comments
 (0)