-# Copyright (C) 2009-2014 EDF R&D
+# Copyright (C) 2009-2022 EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
import os
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
-from PyQt4.QtWebKit import *
-from PyQt4 import QtCore, QtGui, uic
+from PyQt5.QtCore import *
+from PyQt5.QtWidgets import *
+from PyQt5 import QtCore, uic, QtWidgets
import salome
import pycompos_ORB
###
def CreateObject():
global __objectid__
- default_name = str( sgPyQt.stringSetting( "pycompos", "def_obj_name", "Object" ).trimmed() )
+ default_name = str( sgPyQt.stringSetting( "pycompos", "def_obj_name", "Object" ).lstrip().rstrip() )
# generate object name
__objectid__ = __objectid__ + 1
name = "%s_%d" % ( default_name, __objectid__ )
if not name: return
getEngine().createObject( _getStudy(), name )
- print getEngine().s1(4,5)
- print getEngine().ComponentDataType()
+ print(getEngine().s1(4,5))
+ print(getEngine().ComponentDataType())
sg.updateObjBrowser( True )
-class DemoImpl(QtGui.QDialog):
+class DemoImpl(QtWidgets.QDialog):
def __init__(self, *args):
super(DemoImpl, self).__init__(*args)
# called when GUI action is activated
# action ID is passed as parameter
def OnGUIEvent( commandID ):
- print "pycompos.OnGUIEvent(): command = %d" % commandID
+ print("pycompos.OnGUIEvent(): command = %d" % commandID)
if commandID==941:
widget=QMainWindow(sgPyQt.getDesktop())
- web = QWebView(widget)
- page=os.path.join(os.environ["pycompos_ROOT_DIR"],"share","doc","salome","gui","pycompos","index.html")
- web.load(QUrl(page))
- widget.setCentralWidget(web)
+ mywidget = QLabel("Hello world!", widget)
+ widget.setCentralWidget(mywidget)
widget.show()
elif commandID==942: