Skip to content
Permalink
Browse files

set parents of various objects to propagate the font settings

  • Loading branch information
jef-n committed Jan 25, 2012
1 parent 87ae8a3 commit ac44acee73e0a816974614091b8b0e66947018c5
@@ -1052,9 +1052,9 @@ void QgisApp::createMenus()
*/

// Panel and Toolbar Submenus
mPanelMenu = new QMenu( tr( "Panels" ) );
mPanelMenu = new QMenu( tr( "Panels" ), this );
mPanelMenu->setObjectName( "mPanelMenu" );
mToolbarMenu = new QMenu( tr( "Toolbars" ) );
mToolbarMenu = new QMenu( tr( "Toolbars" ), this );
mToolbarMenu->setObjectName( "mToolbarMenu" );

// Get platform for menu layout customization (Gnome, Kde, Mac, Win)
@@ -1109,13 +1109,13 @@ void QgisApp::createMenus()

// Database Menu
// don't add it yet, wait for a plugin
mDatabaseMenu = new QMenu( tr( "&Database" ) );
mDatabaseMenu = new QMenu( tr( "&Database" ), this );
// Vector Menu
// don't add it yet, wait for a plugin
mVectorMenu = new QMenu( tr( "Vect&or" ) );
mVectorMenu = new QMenu( tr( "Vect&or" ), this );
// Web Menu
// don't add it yet, wait for a plugin
mWebMenu = new QMenu( tr( "&Web" ) );
mWebMenu = new QMenu( tr( "&Web" ), this );

// Help menu
// add What's this button to it
@@ -2665,7 +2665,7 @@ void QgisApp::newSpatialiteLayer()

void QgisApp::showRasterCalculator()
{
QgsRasterCalcDialog d;
QgsRasterCalcDialog d( this );
if ( d.exec() == QDialog::Accepted )
{
//invoke analysis library
@@ -4329,7 +4329,7 @@ bool QgisApp::toggleEditing( QgsMapLayer *layer, bool allowCancel )

if ( !vlayer->isEditable() && !vlayer->isReadOnly() )
{
if ( !(vlayer->dataProvider()->capabilities() & QgsVectorDataProvider::EditingCapabilities ) )
if ( !( vlayer->dataProvider()->capabilities() & QgsVectorDataProvider::EditingCapabilities ) )
{
QMessageBox::information( 0, tr( "Start editing failed" ), tr( "Provider cannot be opened for editing" ) );
return false;
@@ -4342,7 +4342,7 @@ bool QgisApp::toggleEditing( QgsMapLayer *layer, bool allowCancel )
bool markSelectedOnly = settings.value( "/qgis/digitizing/marker_only_for_selected", false ).toBool();

// redraw only if markers will be drawn
if( ( !markSelectedOnly || vlayer->selectedFeatureCount() > 0 ) &&
if (( !markSelectedOnly || vlayer->selectedFeatureCount() > 0 ) &&
( markerType == "Cross" || markerType == "SemiTransparentCircle" ) )
{
vlayer->triggerRepaint();
@@ -4857,7 +4857,7 @@ void QgisApp::configureShortcuts()

void QgisApp::customize()
{
QgsCustomization::instance()->openDialog();
QgsCustomization::instance()->openDialog( this );
}


22 src/app/qgscustomization.cpp 100644 → 100755
@@ -37,12 +37,12 @@
#include <QMetaObject>

#ifdef Q_OS_MACX
QgsCustomizationDialog::QgsCustomizationDialog()
: QMainWindow( NULL, Qt::WindowSystemMenuHint ) // Modeless dialog with close button only
QgsCustomizationDialog::QgsCustomizationDialog( QWidget *parent )
: QMainWindow( parent, Qt::WindowSystemMenuHint ) // Modeless dialog with close button only
, mSettings( "QuantumGIS", "QGISCUSTOMIZATION" )
#else
QgsCustomizationDialog::QgsCustomizationDialog()
: QMainWindow( NULL )
QgsCustomizationDialog::QgsCustomizationDialog( QWidget *parent )
: QMainWindow( parent )
, mSettings( "QuantumGIS", "QGISCUSTOMIZATION" )
#endif
{
@@ -597,11 +597,11 @@ QgsCustomization *QgsCustomization::instance()
return pinstance;
}

QgsCustomization::QgsCustomization( ) :
pDialog( 0 ),
mEnabled( true ),
mStatusPath( "/Customization/status" ),
mSettings( "QuantumGIS", "QGISCUSTOMIZATION" )
QgsCustomization::QgsCustomization()
: pDialog( 0 )
, mEnabled( true )
, mStatusPath( "/Customization/status" )
, mSettings( "QuantumGIS", "QGISCUSTOMIZATION" )
{
QgsDebugMsg( "Entered" );
}
@@ -756,12 +756,12 @@ void QgsCustomization::updateMenu( QMenu* menu, QSettings& settings )
settings.endGroup();
}

void QgsCustomization::openDialog()
void QgsCustomization::openDialog( QWidget *parent )
{
QgsDebugMsg( "Entered" );
if ( !pDialog )
{
pDialog = new QgsCustomizationDialog();
pDialog = new QgsCustomizationDialog( parent );
}

// I am trying too enable switching widget status by clicking in main app, so I need non modal
@@ -34,7 +34,7 @@ class QgsCustomizationDialog : public QMainWindow, private Ui::QgsCustomizationD
{
Q_OBJECT
public:
QgsCustomizationDialog();
QgsCustomizationDialog( QWidget *parent );
~QgsCustomizationDialog();

// get item by path
@@ -113,7 +113,7 @@ class QgsCustomization : public QObject
//! Returns the instance pointer, creating the object on the first call
static QgsCustomization* instance();

void openDialog();
void openDialog( QWidget *parent );
static void customizeWidget( QWidget * widget, QEvent * event );
static void customizeWidget( QString path, QWidget * widget );
static void removeFromLayout( QLayout *theLayout, QWidget * widget );
@@ -358,11 +358,11 @@ void QgsInterpolationDialog::on_mInterpolationMethodComboBox_currentIndexChanged
delete mInterpolatorDialog;
if ( text == tr( "Inverse Distance Weighting (IDW)" ) )
{
mInterpolatorDialog = new QgsIDWInterpolatorDialog( 0, mIface );
mInterpolatorDialog = new QgsIDWInterpolatorDialog( this, mIface );
}
else if ( text == tr( "Triangular interpolation (TIN)" ) )
{
mInterpolatorDialog = new QgsTINInterpolatorDialog( 0, mIface );
mInterpolatorDialog = new QgsTINInterpolatorDialog( this, mIface );
}
}

@@ -61,7 +61,7 @@ void QgsInterpolationPlugin::unload()

void QgsInterpolationPlugin::showInterpolationDialog()
{
QgsInterpolationDialog dialog( 0, mIface );
QgsInterpolationDialog dialog( mIface->mainWindow(), mIface );
dialog.exec();
}

@@ -87,7 +87,7 @@ void QgsRasterTerrainAnalysisPlugin::initGui()
return;
}

mTerrainAnalysisMenu = new QMenu( tr( "Terrain analysis" ) );
mTerrainAnalysisMenu = new QMenu( tr( "Terrain analysis" ), rasterMenu );
mTerrainAnalysisMenu->addAction( tr( "Slope" ), this, SLOT( slope() ) );
mTerrainAnalysisMenu->addAction( tr( "Aspect" ), this, SLOT( aspect() ) );
mTerrainAnalysisMenu->addAction( tr( "Hillshade" ), this, SLOT( hillshade() ) );
@@ -107,7 +107,7 @@ void QgsRasterTerrainAnalysisPlugin::unload()

void QgsRasterTerrainAnalysisPlugin::hillshade()
{
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::HillshadeInput );
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::HillshadeInput, mIface->mainWindow() );
d.setWindowTitle( tr( "Hillshade" ) );
if ( d.exec() == QDialog::Accepted )
{
@@ -126,7 +126,7 @@ void QgsRasterTerrainAnalysisPlugin::hillshade()

void QgsRasterTerrainAnalysisPlugin::relief()
{
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::ReliefInput );
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::ReliefInput, mIface->mainWindow() );
d.setWindowTitle( tr( "Relief" ) );
if ( d.exec() == QDialog::Accepted )
{
@@ -146,7 +146,7 @@ void QgsRasterTerrainAnalysisPlugin::relief()

void QgsRasterTerrainAnalysisPlugin::slope()
{
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::NoParameter );
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::NoParameter, mIface->mainWindow() );
d.setWindowTitle( tr( "Slope" ) );
if ( d.exec() == QDialog::Accepted )
{
@@ -165,7 +165,7 @@ void QgsRasterTerrainAnalysisPlugin::slope()

void QgsRasterTerrainAnalysisPlugin::aspect()
{
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::NoParameter );
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::NoParameter, mIface->mainWindow() );
d.setWindowTitle( tr( "Aspect" ) );
if ( d.exec() == QDialog::Accepted )
{
@@ -184,7 +184,7 @@ void QgsRasterTerrainAnalysisPlugin::aspect()

void QgsRasterTerrainAnalysisPlugin::ruggedness()
{
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::NoParameter );
QgsRasterTerrainAnalysisDialog d( QgsRasterTerrainAnalysisDialog::NoParameter, mIface->mainWindow() );
d.setWindowTitle( tr( "Ruggedness" ) );
if ( d.exec() == QDialog::Accepted )
{

0 comments on commit ac44ace

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