return ProcessEvent( new TGetExistingDirectoryEvent( parent, initial, caption ) );
}
+/*!
+ \fn QString SalomePyQt::loadIcon( const QString& filename );
+ \brief Load an icon from the module resources by the specified file name.
+ \param filename icon file name
+ \return icon object
+*/
+class TLoadIconEvent: public SALOME_Event
+{
+public:
+ typedef QIconSet TResult;
+ TResult myResult;
+ QString myModule;
+ QString myFileName;
+ TLoadIconEvent( const QString& module, const QString& filename )
+ : myModule( module ),
+ myFileName ( filename ) {}
+ virtual void Execute()
+ {
+ if ( LightApp_Application* anApp = getApplication() ) {
+ if ( !myFileName.isEmpty() ) {
+ QPixmap pixmap = anApp->resourceMgr()->loadPixmap( myModule,
+ qApp->translate( myModule.latin1(),
+ myFileName.latin1() ) );
+ if ( !pixmap.isNull() )
+ myResult = QIconSet( pixmap );
+ }
+ }
+ }
+};
+QIconSet SalomePyQt::loadIcon( const QString& module, const QString& filename )
+{
+ return ProcessEvent( new TLoadIconEvent( module, filename ) );
+}
+
/*!
SalomePyQt::helpContext
Opens external browser to display 'context help' information
#include <qstring.h>
#include <qobject.h>
#include <qcolor.h>
+#include <qiconset.h>
#include <LightApp_Application.h>
#include <LightApp_Preferences.h>
static QStringList getOpenFileNames ( QWidget*, const QString&, const QStringList&, const QString& );
static QString getExistingDirectory( QWidget*, const QString&, const QString& );
+ static QIconSet loadIcon( const QString&, const QString& );
+
static void helpContext( const QString&, const QString& );
static bool dumpView( const QString& );
static QStringList getOpenFileNames ( QWidget*, const QString&, const QStringList&, const QString& );
static QString getExistingDirectory( QWidget*, const QString&, const QString& );
+ static QIcoSet loadIcon( const QString&, const QString& );
static void helpContext( const QString&, const QString& );
static bool dumpView( const QString& );
static QStringList getOpenFileNames ( QWidget*, const QString&, const QStringList&, const QString& ) /ReleaseGIL/ ;
static QString getExistingDirectory( QWidget*, const QString&, const QString& ) /ReleaseGIL/ ;
+ static QIconSet loadIcon( const QString&, const QString& ) /ReleaseGIL/ ;
static void helpContext( const QString&, const QString& ) /ReleaseGIL/ ;
static bool dumpView( const QString& ) /ReleaseGIL/ ;