%.qm: resources/%.ts
$(LRELEASE) $< -qm $@
-EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(nodist_salomeres_DATA:%.qm=resources/%.ts)
+# resource files generation
+qrc_%.cxx: %.qrc
+ $(QRCC) $< -o $@ -name $(*F)
+
+EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(QRC_FILES:qrc_%.cpp=%.qrc) $(nodist_salomeres_DATA:%.qm=resources/%.ts)
mostlyclean-local:
rm -f @builddir@/*_moc.cxx
MOC_FILES= \
Style_Salome_moc.cxx
-nodist_libSalomeStyle_la_SOURCES= $(MOC_FILES)
+
+QRC_FILES= \
+ qrc_Style.cxx
+
+nodist_libSalomeStyle_la_SOURCES= $(MOC_FILES) $(QRC_FILES)
libSalomeStyle_la_CPPFLAGS=$(QT_INCLUDES) \
-I$(srcdir)/../Qtx
libSalomeStyle_la_LDFLAGS=$(QT_MT_LIBS) \
../Qtx/libqtx.la
-
--- /dev/null
+ <!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+ <file>images/critical.png</file>
+ <file>images/information.png</file>
+ <file>images/question.png</file>
+ <file>images/warning.png</file>
+ </qresource>
+ </RCC>
Style_Salome::Style_Salome()
: QWindowsStyle()
{
+ Q_INIT_RESOURCE(Style);
+
myModel = new Style_Model();
myModel->setDefaults( qApp );
}
}
+QIcon Style_Salome::standardIconImplementation( StandardPixmap standardIcon,
+ const QStyleOption* opt,
+ const QWidget* widget ) const
+{
+ switch ( standardIcon )
+ {
+ case SP_MessageBoxInformation:
+ return QPixmap( ":/images/information.png" );
+ case SP_MessageBoxWarning:
+ return QPixmap( ":/images/warning.png" );
+ case SP_MessageBoxCritical:
+ return QPixmap( ":/images/critical.png" );
+ case SP_MessageBoxQuestion:
+ return QPixmap( ":/images/question.png" );
+ default:
+ break;
+ }
+ return QWindowsStyle::standardIconImplementation( standardIcon, opt, widget );
+}
+
int Style_Salome::styleHint( StyleHint hint, const QStyleOption* opt, const QWidget* widget,
QStyleHintReturn* returnData ) const
{
SubControl, const QWidget* = 0 ) const;
virtual QRect subElementRect( SubElement, const QStyleOption*, const QWidget* = 0 ) const;
+protected slots:
+ QIcon standardIconImplementation( StandardPixmap, const QStyleOption* = 0,
+ const QWidget* = 0 ) const;
+
private:
void updatePaletteColors();
void updateAllWidgets( QApplication* );