// Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
//
#include "Style_Model.h"
+#include "Style_Salome.h"
#include <QtxResourceMgr.h>
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();
// 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
}
// check if SALOME style is set to the application
if ( !isActive() )
return;
+
+ QApplication::setDesktopSettingsAware(true);
+
// restore previous style
model()->restore();
}