From: dmv Date: Sat, 27 Feb 2010 08:55:32 +0000 (+0000) Subject: 0020709: EDF GUI : Changes the font with qtconfig, no effect ? X-Git-Tag: V5_1_4a1~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=805e36d4a6f4328142a901f5efdfb6b7fd82905e;p=modules%2Fgui.git 0020709: EDF GUI : Changes the font with qtconfig, no effect ? --- diff --git a/src/Style/Style_Model.cxx b/src/Style/Style_Model.cxx index e3f8fd6ca..a4d680c05 100644 --- a/src/Style/Style_Model.cxx +++ b/src/Style/Style_Model.cxx @@ -23,6 +23,7 @@ // Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com) // #include "Style_Model.h" +#include "Style_Salome.h" #include @@ -106,10 +107,11 @@ void Style_Model::fromApplication( bool reset ) if ( !QApplication::instance() ) // application object is not created yet return; - if ( !myAppData ) { - // if not yes initialized from the application, - // store current application's style, palette, etc + if ( !myAppData ) // if not yes initialized from the application init myAppData myAppData = new AppData; + + // store original application's style, palette, etc + if ( !Style_Salome::isActive() ) { myAppData->myStyle = QApplication::style(); myAppData->myPalette = QApplication::palette(); myAppData->myFont = QApplication::font(); diff --git a/src/Style/Style_Salome.cxx b/src/Style/Style_Salome.cxx index 82d58ff71..aa430602e 100644 --- a/src/Style/Style_Salome.cxx +++ b/src/Style/Style_Salome.cxx @@ -259,6 +259,7 @@ void Style_Salome::apply() // set SALOME style QApplication::style()->setParent( 0 ); // avoid deleting original application style QApplication::setStyle( new Style_Salome() ); // set style + QApplication::setDesktopSettingsAware(false); // prevent the style changing from another tools } update(); // update style } @@ -275,6 +276,9 @@ void Style_Salome::restore() // check if SALOME style is set to the application if ( !isActive() ) return; + + QApplication::setDesktopSettingsAware(true); + // restore previous style model()->restore(); }