From: vsr Date: Tue, 7 Jul 2009 14:42:40 +0000 (+0000) Subject: Issue 0020424: EDF 1069 GUI: How to add an icon in the GUI of a python module X-Git-Tag: V5_1_3rc1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b362efd17305f28b8d50c36bb668eab95059478d;p=samples%2Fpyhello.git Issue 0020424: EDF 1069 GUI: How to add an icon in the GUI of a python module Introduce loadIcon() method to the SalomePyQt Python interface --- diff --git a/resources/Makefile.am b/resources/Makefile.am index 45755dc..87acd6d 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -30,6 +30,8 @@ dist_salomeres_DATA = \ PYHELLO.png \ PYHELLO_small.png \ ExecPYHELLO.png \ + handshake.png \ + stop.png \ SalomeApp.xml # VSR: little trick to avoid putting if PYHELLOCatalog.xml to the distribution archive diff --git a/resources/handshake.png b/resources/handshake.png new file mode 100644 index 0000000..e840a02 Binary files /dev/null and b/resources/handshake.png differ diff --git a/resources/stop.png b/resources/stop.png new file mode 100644 index 0000000..e896855 Binary files /dev/null and b/resources/stop.png differ diff --git a/src/PYHELLOGUI/PYHELLOGUI.py b/src/PYHELLOGUI/PYHELLOGUI.py index e931a44..911eb60 100644 --- a/src/PYHELLOGUI/PYHELLOGUI.py +++ b/src/PYHELLOGUI/PYHELLOGUI.py @@ -366,12 +366,14 @@ class MyDialog( QDialog ): hb1 = QHBoxLayout( self ) bOk = QPushButton( "&OK", self ) + bOk.setIcon( sgPyQt.loadIcon( 'PYHELLO', 'ICO_HANDSHAKE' ) ) self.connect( bOk, SIGNAL( 'clicked()' ), self, SLOT( 'accept()' ) ) hb1.addWidget( bOk ) hb1.addStretch( 10 ) bCancel = QPushButton( "&Cancel", self ) + bCancel.setIcon( sgPyQt.loadIcon( 'PYHELLO', 'ICO_STOP' ) ) self.connect( bCancel, SIGNAL( 'clicked()' ), self, SLOT( 'close()' ) ) hb1.addWidget( bCancel ) diff --git a/src/PYHELLOGUI/PYHELLO_icons.ts b/src/PYHELLOGUI/PYHELLO_icons.ts index 8025ecd..f75695d 100644 --- a/src/PYHELLOGUI/PYHELLO_icons.ts +++ b/src/PYHELLOGUI/PYHELLO_icons.ts @@ -22,4 +22,16 @@ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com --> - + + + @default + + ICO_HANDSHAKE + handshake.png + + + ICO_STOP + stop.png + + +