Salome HOME
Qt4 porting.
authormkr <mkr@opencascade.com>
Wed, 5 Mar 2008 10:18:07 +0000 (10:18 +0000)
committermkr <mkr@opencascade.com>
Wed, 5 Mar 2008 10:18:07 +0000 (10:18 +0000)
adm_local/unix/make_common_starter.am
configure.ac
src/PYHELLOGUI/PYHELLOGUI.py
src/PYHELLOGUI/PYHELLO_icons.ts [new file with mode: 0644]
src/PYHELLOGUI/PYHELLO_msg_en.ts [new file with mode: 0644]

index 533941331b2636b75b0d3b38a7d52983775ec4c9..c6e076e41b406d1200039f328ffdfe553e860742 100644 (file)
@@ -36,10 +36,10 @@ docdir             = $(datadir)/doc/@PACKAGE@
        $(MOC) $< -o $@
 
 # qm-files generation
-%.qm: %.po
-       $(MSG2QM) $< $@
+%.qm: %.ts
+       $(LRELEASE) $< -qm $@
 
-EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(nodist_salomeres_DATA:%.qm=%.po)
+EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(nodist_salomeres_DATA:%.qm=%.ts)
 
 mostlyclean-local:
        rm -f @builddir@/*_moc.cxx
index d72094c03ee098e4e2884d37949eee145740acb4..ce4f07fb90641406ae494bd6cdd66fbdcea9ec16 100644 (file)
@@ -125,11 +125,11 @@ CORBA=adm_local/unix/$corba
 
 echo
 echo ---------------------------------------------
-echo testing msg2qm
+echo testing QT
 echo ---------------------------------------------
 echo
 
-CHECK_MSG2QM
+CHECK_QT
 
 echo
 echo ---------------------------------------------
@@ -168,7 +168,7 @@ echo ---------------------------------------------
 echo
 
 echo Configure
-variables="python_ok omniORB_ok msg2qm_ok Kernel_ok"
+variables="python_ok omniORB_ok qt_ok Kernel_ok"
 
 for var in $variables
 do
index af4ce65cef3099716156d0549af17f028b43cfef..5f29bf48837245802128190343de6fa568eb4dac 100644 (file)
@@ -16,7 +16,8 @@
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-from qt import *
+from PyQt4.QtGui import *
+from PyQt4.QtCore import *
 import traceback
 
 from omniORB import CORBA
@@ -135,6 +136,7 @@ def definePopup( context, object, parent ):
                     id = anAttr._narrow( SALOMEDS.AttributeLocalID ).Value()
                     if ( id >= 0 ):
                         object = str( id )
+                        context = "ObjectBrowser"
     print "PYHELLOGUI::definePopup :", context, object, parent
     return context, object, parent
 
@@ -175,22 +177,33 @@ def OnGUIEvent(commandID) :
 class MyDialog( QDialog ):
     # constructor
     def __init__( self, parent = None, modal = 0):
-        QDialog.__init__( self, parent, "MyDialog", modal )
-        self.setCaption( "HELLO!" )
-        vb = QVBoxLayout( self, 8 )
-        vb.setAutoAdd( 1 )
-        hb0 = QHBox( self )
-        label = QLabel( "Prenom: ", hb0 )
-        self.entry = QLineEdit( hb0 )
+        QDialog.__init__( self, parent )
+        self.setObjectName( "MyDialog" )
+        self.setModal( modal )
+        self.setWindowTitle( "HELLO!" )
+        vb = QVBoxLayout( self )
+        vb.setMargin( 8 )
+
+        hb0 = QHBoxLayout( self )
+        label = QLabel( "Prenom: ", self )
+        hb0.addWidget( label )
+        self.entry = QLineEdit( self )
         self.entry.setMinimumWidth( 200 )
+        hb0.addWidget( self.entry )
+        vb.addLayout( hb0 )
         
-        hb1 = QHBox( self )
-        bOk = QPushButton( "&OK", hb1 )
+        hb1 = QHBoxLayout( self )
+        bOk = QPushButton( "&OK", self )
         self.connect( bOk, SIGNAL( 'clicked()' ), self, SLOT( 'accept()' ) )
-        dummy = QWidget( hb1 )
-        bCancel = QPushButton( "&Cancel", hb1 )
+        hb1.addWidget( bOk )
+        
+        hb1.addStretch( 10 )
+        
+        bCancel = QPushButton( "&Cancel", self )
         self.connect( bCancel, SIGNAL( 'clicked()' ), self, SLOT( 'close()' ) )
-        hb1.setStretchFactor( dummy, 10 )
+        hb1.addWidget( bCancel )
+        
+        vb.addLayout( hb1 )
         pass
     
     # OK button slot
@@ -209,7 +222,7 @@ def ShowHELLO():
     # create dialog box
     d = MyDialog( sgPyQt.getDesktop(), 1 )
     # show dialog box
-    d.exec_loop()
+    d.exec_()
 
 __id__ = 0
 
diff --git a/src/PYHELLOGUI/PYHELLO_icons.ts b/src/PYHELLOGUI/PYHELLO_icons.ts
new file mode 100644 (file)
index 0000000..3d80585
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE TS>
+<TS version="1.1" />
diff --git a/src/PYHELLOGUI/PYHELLO_msg_en.ts b/src/PYHELLOGUI/PYHELLO_msg_en.ts
new file mode 100644 (file)
index 0000000..3d80585
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE TS>
+<TS version="1.1" />