void cppcomposGUI::OnGetBanner()
{
// Dialog to get the Name
- bool ok = FALSE;
+ bool ok = false;
QString myName = QInputDialog::getText( getApp()->desktop(), "label", "name", QLineEdit::Normal, QString::null, &ok );
if ( ok && !myName.isEmpty())
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
+from PyQt5.QtWebKitWidgets import QWebView
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__ )
print getEngine().ComponentDataType()
sg.updateObjBrowser( True )
-class DemoImpl(QtGui.QDialog):
+class DemoImpl(QtWidgets.QDialog):
def __init__(self, *args):
super(DemoImpl, self).__init__(*args)
# resources : resource files
# ts_resources : .ts files - to be processed by lrelease
cmake_cpp_gui = """
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
# --- options ---
# additional include directories
)
# header files / uic wrappings
-QT4_WRAP_UI(_uic_HEADERS $${_uic_files})
+QT_WRAP_UIC(_uic_HEADERS $${_uic_files})
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES $${_moc_HEADERS})
-
+QT_WRAP_MOC(_moc_SOURCES $${_moc_HEADERS})
# sources / static
SET(_other_SOURCES
INSTALL(FILES $${_moc_HEADERS} DESTINATION $${SALOME_INSTALL_HEADERS})
INSTALL(FILES $${_res_files} DESTINATION "$${SALOME_${module}_INSTALL_RES_DATA}")
-QT4_INSTALL_TS_RESOURCES("$${_ts_files}" "$${SALOME_${module}_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("$${_ts_files}" "$${SALOME_${module}_INSTALL_RES_DATA}")
"""
cmake_cpp_gui = Template(cmake_cpp_gui)
# ts_resources : .ts files - to be processed by lrelease
# resources : other resource files
cmake_py_gui = """
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
# additional include directories
INCLUDE_DIRECTORIES(
SALOME_INSTALL_SCRIPTS("$${_bin_SCRIPTS}" $${SALOME_INSTALL_SCRIPT_PYTHON})
INSTALL(FILES $${_res_files} DESTINATION "$${SALOME_${module}_INSTALL_RES_DATA}")
-QT4_INSTALL_TS_RESOURCES("$${_ts_RESOURCES}" "$${SALOME_${module}_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("$${_ts_RESOURCES}" "$${SALOME_${module}_INSTALL_RES_DATA}")
"""
cmake_py_gui = Template(cmake_py_gui)
## From GUI:
##
FIND_PACKAGE(SalomeCAS REQUIRED)
- # Qt4
- FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
- INCLUDE($${QT_USE_FILE})
+ # Qt4/Qt5
+ IF(NOT SALOME_GUI_BUILD_WITH_QT5)
+ FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
+ ELSE()
+ FIND_PACKAGE(SalomeQt5 REQUIRED)
+ ENDIF()
ENDIF(SALOME_GUI_MODULE)
${add_modules}