OPTION(SALOME_BUILD_DOC "Generate SALOME GUI documentation" ON)
OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
OPTION(SALOME_GUI_USE_OBSERVERS "Use study observers in GUI (advanced)" ON)
+OPTION(SALOME_BUILD_WITH_QT5 "Build SALOME with Qt5" ON)
+OPTION(SALOME_BUILD_WITH_PYQT5 "Build SALOME with PyQt5" ON)
# Advanced options:
CMAKE_DEPENDENT_OPTION(SALOME_LIGHT_ONLY "Build SALOME Light only (no CORBA)" OFF
OPTION(SALOME_USE_PYCONSOLE "Enable Python GUI interface (Mandatory in classic configurations)" ON)
OPTION(SALOME_USE_QXGRAPHVIEWER "Enable QX graph visualization (Mandatory in classic configurations)" ON)
OPTION(SALOME_USE_PVVIEWER "Enable ParaView visualization (Mandatory in classic configurations)" ON)
+
CMAKE_DEPENDENT_OPTION(SALOME_USE_SALOMEOBJECT "Enable Salome Object (Mandatory in classic configurations)" ON
"SALOME_LIGHT_ONLY" ON)
OPTION(SALOME_USE_SINGLE_DESKTOP "Enable multiple document interface" ON)
## GUI specifics
##
-FIND_PACKAGE(SalomeSIP REQUIRED) # should come after Python and before PyQt4
+FIND_PACKAGE(SalomeSIP REQUIRED) # should come after Python and before PyQt
# Build with GUI observers feature
IF(SALOME_GUI_USE_OBSERVERS)
FIND_PACKAGE(SalomeOpenGL REQUIRED)
ENDIF()
-# Qt4
-FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL QtNetwork)
-INCLUDE(${QT_USE_FILE})
+# Qt
+IF(NOT SALOME_BUILD_WITH_QT5)
+ FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL QtNetwork)
+ INCLUDE(${QT_USE_FILE})
+ELSE()
+ ADD_DEFINITIONS(-fPIC)
+ #SET(CMAKE_AUTOMOC ON)
+ SET(CMAKE_INCLUDE_CURRENT_DIR ON)
+ FIND_PACKAGE(SalomeQt5 REQUIRED)
+ SET(SALOME_USE_PVVIEWER OFF)
+ENDIF()
-# PyQt4
-FIND_PACKAGE(SalomePyQt4 REQUIRED)
+# PyQt
+IF (NOT SALOME_BUILD_WITH_PYQT5)
+ FIND_PACKAGE(SalomePyQt4 REQUIRED)
+ELSE()
+ FIND_PACKAGE(SalomePyQt5 REQUIRED)
+ENDIF()
# Optional prerequisites for GUI
IF(NOT SALOME_USE_GLVIEWER)
ADD_DEFINITIONS("-DDISABLE_VTKVIEWER")
ENDIF()
IF(SALOME_USE_PLOT2DVIEWER)
- FIND_PACKAGE(SalomeQwt)
+ FIND_PACKAGE(SalomeQwt)
SALOME_LOG_OPTIONAL_PACKAGE(Qwt SALOME_USE_PLOT2DVIEWER)
ELSE()
ADD_DEFINITIONS("-DDISABLE_PLOT2DVIEWER")
ENDIF()
IF (SALOME_USE_PVVIEWER)
- FIND_PACKAGE(SalomeParaView)
+ find_package(ParaView REQUIRED)
+ #FIND_PACKAGE(SalomeParaView)
SALOME_LOG_OPTIONAL_PACKAGE(ParaView SALOME_USE_PVVIEWER)
ELSE()
ADD_DEFINITIONS("-DDISABLE_PVVIEWER")
ADD_DEFINITIONS("-DDISABLE_SALOMEOBJECT")
ENDIF()
-# Detection summary:
-SALOME_PACKAGE_REPORT_AND_CHECK()
+# Detection summary:
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SALOME_PACKAGE_REPORT_AND_CHECK()
+ENDIF()
# Directories
# (default values taken from KERNEL)
# ===========
+
SET(SALOME_INSTALL_BINS "${SALOME_INSTALL_BINS}" CACHE PATH "Install path: SALOME binaries")
SET(SALOME_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "Install path: SALOME libs")
SET(SALOME_INSTALL_IDLS "${SALOME_INSTALL_IDLS}" CACHE PATH "Install path: SALOME IDL files")
# Ensure the variables are always defined for the configure:
SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}")
SET(SIP_ROOT_DIR "${SIP_ROOT_DIR}")
-SET(QT4_ROOT_DIR "${QT4_ROOT_DIR}")
-SET(PYQT4_ROOT_DIR "${PYQT4_ROOT_DIR}")
+SET(QT_ROOT_DIR "${QT_ROOT_DIR}")
+SET(PYQT_ROOT_DIR "${PYQT_ROOT_DIR}")
SET(CAS_ROOT_DIR "${CAS_ROOT_DIR}")
SET(OPENGL_ROOT_DIR "${OPENGL_ROOT_DIR}")
SET(VTK_ROOT_DIR "${VTK_ROOT_DIR}")
SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
# Build variables that will be expanded when configuring Salome<MODULE>Config.cmake:
-SALOME_CONFIGURE_PREPARE(CAS OpenGL PyQt4 Qt4 Qwt SIP VTK)
+SALOME_CONFIGURE_PREPARE(CAS OpenGL PyQt5 Qt5 Qwt SIP VTK)
CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
- KERNEL_ROOT_DIR SIP_ROOT_DIR QT4_ROOT_DIR PYQT4_ROOT_DIR CAS_ROOT_DIR
+ KERNEL_ROOT_DIR SIP_ROOT_DIR QT_ROOT_DIR PYQT_ROOT_DIR CAS_ROOT_DIR
OPENGL_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR)
# - in the install tree (VSR 16/08/2013: TEMPORARILY COMMENT THIS - TO REMOVE?):
# ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake
# INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
# PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
-# KERNEL_ROOT_DIR SIP_ROOT_DIR QT4_ROOT_DIR PYQT4_ROOT_DIR CAS_ROOT_DIR
+# KERNEL_ROOT_DIR SIP_ROOT_DIR QT5_ROOT_DIR PYQT5_ROOT_DIR CAS_ROOT_DIR
# OPENGL_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR)
WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
# Level 1 prerequisites:
SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_KERNEL_ROOT_DIR@")
SET_AND_CHECK(SIP_ROOT_DIR_EXP "@PACKAGE_SIP_ROOT_DIR@")
-SET_AND_CHECK(QT4_ROOT_DIR_EXP "@PACKAGE_QT4_ROOT_DIR@")
-SET_AND_CHECK(PYQT4_ROOT_DIR_EXP "@PACKAGE_PYQT4_ROOT_DIR@")
+SET_AND_CHECK(QT_ROOT_DIR_EXP "@PACKAGE_QT_ROOT_DIR@")
+SET_AND_CHECK(PYQT_ROOT_DIR_EXP "@PACKAGE_PYQT_ROOT_DIR@")
SET_AND_CHECK(CAS_ROOT_DIR_EXP "@PACKAGE_CAS_ROOT_DIR@")
# Optional level 1 prerequisites:
FindGUI.cmake
FindSIP.cmake
FindPyQt4.cmake
+ FindPyQt5.cmake
FindSalomePyQt4.cmake
+ FindSalomePyQt5.cmake
FindSalomeQt4.cmake
+ FindSalomeQt5.cmake
FindSalomeQwt.cmake
FindSalomeSIP.cmake
FindSalomeGUI.cmake
FindSalomeOpenGL.cmake
FindSalomeParaView.cmake
- UsePyQt4.cmake
- UseQt4Ext.cmake
+ UsePyQt.cmake
+ UseQtExt.cmake
)
INSTALL(FILES ${_adm_data} DESTINATION ${SALOME_INSTALL_CMAKE_LOCAL})
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# - Find PyQt5 installation
+# Sets the following variables:
+# PYQT_PYUIC_EXECUTABLE - path to the pyuic executable
+# PYQT_PYRCC_EXECUTABLE - path to the pyrcc executable
+# PYQT_PYUIC_PATH - command to launch pyuic with the correct PYTHONPATH
+# PYQT_PYRCC_PATH - command to launch pyrcc with the correct PYTHONPATH
+# PYQT_PYTHONPATH - path to the PyQt Python modules
+# PYQT_SIPS_DIR - path to main include directory (which contains several sub folders)
+# PYQT_INCLUDE_DIRS - list of paths to include when compiling (all rooted on PYQT_SIP_DIRS)
+# PYQT_SIPFLAGS - compilation flags extracted from PyQt
+#
+# The executables
+# pyuic5 (pyuic5.bat)
+# are searched.
+# The Python command
+# pyqtconfig.Configuration().pyqt_sip_flags
+# is called to get the compilation flags.
+# Headers are located by looking for the header file
+# qobject.sip
+
+IF(NOT PyQt5_FIND_QUIETLY)
+ MESSAGE(STATUS "Looking for PyQt5 ...")
+ENDIF()
+
+IF(NOT SIP_FOUND AND NOT PyQt5_FIND_QUIETLY)
+ MESSAGE(WARNING "PyQt5 needs SIP to be detected correctly!")
+ENDIF()
+
+FIND_PROGRAM(PYQT_PYUIC_EXECUTABLE NAMES pyuic5 pyuic5.bat)
+FIND_PROGRAM(PYQT_PYRCC_EXECUTABLE NAMES pyrcc5 pyrcc5.bat)
+
+# Get root dir locally, going up two levels from the exec:
+GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${PYQT_PYUIC_EXECUTABLE}" PATH)
+GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH)
+
+
+# Typical locations of qobject.sip are:
+# - /usr/share/sip/PyQt5/QtCore, for a system install
+# - or <xyz>/sip/QtCore, for a custom install
+# - or <xyz>/share/sip/QtCore, for a custom install
+FIND_FILE(PYQT_SIP_MAIN_FILE qobject.sip PATH_SUFFIXES share/sip/QtCore sip/QtCore share/sip/PyQt5/QtCore)
+
+IF(PYQT_SIP_MAIN_FILE)
+ GET_FILENAME_COMPONENT(PYQT_SIPS_DIR "${PYQT_SIP_MAIN_FILE}" PATH)
+ GET_FILENAME_COMPONENT(PYQT_SIPS_DIR "${PYQT_SIPS_DIR}" PATH)
+ENDIF()
+MARK_AS_ADVANCED(PYQT_SIP_MAIN_FILE)
+
+# Get PyQt compilation flags:
+SET(PYQT_PYTHONPATH ${_tmp_ROOT_DIR}/PyQt5)
+SET(PYQT_SIPFLAGS)
+
+EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys;
+sys.path[:0] = '${PYQT_PYTHONPATH}'.split(';');
+sys.path[:0] = '${SIP_PYTHONPATH}'.split(';');
+from PyQt5.QtCore import PYQT_CONFIGURATION;
+sys.stdout.write(PYQT_CONFIGURATION['sip_flags'])"
+ OUTPUT_VARIABLE PYQT_SIPFLAGS)
+SEPARATE_ARGUMENTS(PYQT_SIPFLAGS)
+
+SET(PYQT_INCLUDE_DIRS
+ "${PYQT_SIPS_DIR}"
+ "${PYQT_SIPS_DIR}/QtCore"
+ "${PYQT_SIPS_DIR}/QtGui"
+ "${PYQT_SIPS_DIR}/QtXml"
+ "${PYQT_SIPS_DIR}/QtOpenGL"
+ "${PYQT_SIPS_DIR}/QtAssistant"
+ "${PYQT_SIPS_DIR}/QtDesigner"
+ "${PYQT_SIPS_DIR}/QtNetwork"
+ "${PYQT_SIPS_DIR}/QtSql"
+ "${PYQT_SIPS_DIR}/QtSvg"
+ "${PYQT_SIPS_DIR}/QtTest"
+)
+
+SET(PYQT_CXX_EXT ".cc")
+SET(PYQT_SIPFLAGS ${PYQT_SIPFLAGS} -s ${PYQT_CXX_EXT} -c .)
+FOREACH(_dir ${PYQT_INCLUDE_DIRS})
+ LIST(APPEND PYQT_SIPFLAGS -I ${_dir})
+ENDFOREACH()
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PyQt5 REQUIRED_VARS PYQT_PYUIC_EXECUTABLE PYQT_PYRCC_EXECUTABLE PYQT_SIPS_DIR PYQT_SIPFLAGS )
+
+# Wrap the final executables so that they always use the proper environment (PYTHONPATH):
+# The results are put to variables:
+# PYQT_PYUIC_PATH - command to launch pyuic with the correct PYTHONPATH
+# PYQT_PYRCC_PATH - command to launch pyrcc with the correct PYTHONPATH
+# TODO: should be done like Sphinx in KERNEL (i.e. generating a shell script)?
+
+IF(WIN32 AND NOT CYGWIN)
+ SET(PYQT_PYUIC_PATH set PYTHONPATH=${PYQT_PYTHONPATH};${SIP_PYTHONPATH};%PYTHONPATH% && ${PYQT_PYUIC_EXECUTABLE})
+ SET(PYQT_PYRCC_PATH set PYTHONPATH=${PYQT_PYTHONPATH};${SIP_PYTHONPATH};%PYTHONPATH% && ${PYQT_PYRCC_EXECUTABLE})
+ELSE()
+ STRING(REPLACE ";" ":" PYQT_PYTHONPATH "${PYQT_PYTHONPATH}")
+ SET(PYQT_PYUIC_PATH /usr/bin/env PYTHONPATH="${PYQT_PYTHONPATH}:${SIP_PYTHONPATH}:$$PYTHONPATH" ${PYQT_PYUIC_EXECUTABLE})
+ SET(PYQT_PYRCC_PATH /usr/bin/env PYTHONPATH="${PYQT_PYTHONPATH}:${SIP_PYTHONPATH}:$$PYTHONPATH" ${PYQT_PYRCC_EXECUTABLE})
+ENDIF()
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# PyQt5 detection for Salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+# PyQt needs SIP, call it automatically
+FIND_PACKAGE(SalomeSIP REQUIRED)
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PyQt5 PYQT_PYUIC_EXECUTABLE 2)
+MARK_AS_ADVANCED(PYQT_PYUIC_EXECUTABLE PYQT_PYRCC_EXECUTABLE PYQT_SIPS_DIR PYQT_PYUIC_PATH PYQT_PYRCC_PATH)
+
+IF(PYQT5_FOUND)
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH ${PYQT_PYUIC_EXECUTABLE})
+ SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PYQT_PYTHONPATH})
+ SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${PYQT_PYTHONPATH})
+ENDIF()
--- /dev/null
+# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# Qt5 detection for Salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Core Qt5Core_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Gui Qt5Gui_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Widgets Qt5Widgets_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Network Qt5Network_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Xml Qt5Xml_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5OpenGL Qt5OpenGL_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5PrintSupport Qt5PrintSupport_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5WebKit Qt5WebKit_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5WebKitWidgets Qt5WebKitWidgets_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5X11Extras Qt5X11Extras_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)
+
+get_filename_component(LINGUIST_PATH ${Qt5Core_DIR} DIRECTORY)
+get_filename_component(LINGUIST_PATH ${LINGUIST_PATH} DIRECTORY)
+get_filename_component(LINGUIST_PATH ${LINGUIST_PATH} DIRECTORY)
+
+set(LINGUIST_PATH ${LINGUIST_PATH}/bin)
+
+FIND_PROGRAM(QT_LUPDATE_EXECUTABLE NAMES lupdate PATHS ${LINGUIST_PATH} NO_DEFAULT_PATH)
+if(QT_LUPDATE_EXECUTABLE)
+ message(STATUS "Found lupdate: " ${QT_LUPDATE_EXECUTABLE})
+else(QT_LUPDATE_EXECUTABLE)
+ if(Linguist_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find lupdate")
+ endif(Linguist_FIND_REQUIRED)
+endif(QT_LUPDATE_EXECUTABLE)
+
+FIND_PROGRAM(QT_LRELEASE_EXECUTABLE NAMES lrelease PATHS ${LINGUIST_PATH} NO_DEFAULT_PATH)
+if(QT_LRELEASE_EXECUTABLE)
+ message(STATUS "Found lrelease: " ${QT_LRELEASE_EXECUTABLE})
+else(QT_LRELEASE_EXECUTABLE)
+ if(Linguist_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find lrelease")
+ endif(Linguist_FIND_REQUIRED)
+endif(QT_LRELEASE_EXECUTABLE)
+
+#MARK_AS_ADVANCED(QT_QMAKE_EXECUTABLE)
+#
+#IF(QT5_FOUND)
+# SALOME_ACCUMULATE_HEADERS(QT_INCLUDES)
+# SALOME_ACCUMULATE_ENVIRONMENT(PATH ${QT_QMAKE_EXECUTABLE})
+# SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${QT_QTCORE_LIBRARY})
+#ENDIF()
--- /dev/null
+# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+
+####################################################################
+#
+# _PYQT_WRAP_GET_UNIQUE_TARGET_NAME: internal function
+#
+# Used to generate unique custom target name for usage in
+# PYQT_WRAP_UIC macro.
+#
+# USAGE: _PYQT_WRAP_GET_UNIQUE_TARGET_NAME(prefix unique_name)
+#
+# ARGUMENTS:
+# prefix [in] prefix for the name
+# unique_name [out] unique name generated by function
+#
+####################################################################
+FUNCTION(_PYQT_WRAP_GET_UNIQUE_TARGET_NAME name unique_name)
+ SET(_propertyName "_PYQT_WRAP_UNIQUE_COUNTER_${name}")
+ GET_PROPERTY(_currentCounter GLOBAL PROPERTY "${_propertyName}")
+ IF(NOT _currentCounter)
+ SET(_currentCounter 1)
+ ENDIF()
+ SET(${unique_name} "${name}_${_currentCounter}" PARENT_SCOPE)
+ MATH(EXPR _currentCounter "${_currentCounter} + 1")
+ SET_PROPERTY(GLOBAL PROPERTY ${_propertyName} ${_currentCounter} )
+ENDFUNCTION()
+
+####################################################################
+#
+# PYQT_WRAP_UIC macro
+#
+# Create Python modules by processing input *.ui (Qt designer) files with
+# PyQt pyuic tool.
+#
+# USAGE: PYQT_WRAP_UIC(output_files pyuic_files)
+#
+# ARGUMENTS:
+# output_files [out] variable where output file names are listed to
+# pyuic_files [in] list of *.ui files
+#
+# NOTES:
+# - Input files are considered relative to the current source directory.
+# - Output files are generated in the current build directory.
+# - Macro automatically adds custom build target to generate output files
+#
+####################################################################
+MACRO(PYQT_WRAP_UIC outfiles)
+
+ IF(NOT WIN32)
+
+ FOREACH(_input ${ARGN})
+ GET_FILENAME_COMPONENT(_input_name ${_input} NAME)
+ STRING(REPLACE ".ui" "_ui.py" _input_name ${_input_name})
+ SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${_output}
+ COMMAND ${PYQT_PYUIC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
+ MAIN_DEPENDENCY ${_input}
+ )
+ SET(${outfiles} ${${outfiles}} ${_output})
+ ENDFOREACH()
+ _PYQT_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _uniqueTargetName)
+ ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL DEPENDS ${${outfiles}})
+
+ ELSE(NOT WIN32)
+####
+# ANA: Workaround for the Microsoft Visual Studio 2010. Seems there is a bug in
+# the Microsoft Visual Studio 2010 or CMake 2.8.10.2: custom target doesn't work
+# for the list of the dependencies. It works only for the first dependency in the
+# list. So generate separate target for the each input file. This problem will be
+#investigated in the future.
+####
+
+ SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
+ _PYQT_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _uniqueTargetName)
+ ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL)
+ FOREACH(_input ${ARGN})
+ GET_FILENAME_COMPONENT(_input_name ${_input} NAME)
+ STRING(REPLACE ".ui" "_ui.py" _input_name ${_input_name})
+ SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
+ _PYQT_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _TgName)
+ ADD_CUSTOM_TARGET(${_TgName} ${PYQT_PYUIC_PATH} ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
+ DEPENDS ${_input}
+ )
+ SET_TARGET_PROPERTIES(${_TgName} PROPERTIES FOLDER PYQT_WRAP_UIC_TARGETS)
+ ADD_DEPENDENCIES(${_uniqueTargetName} DEPEND ${_TgName})
+ SET(${outfiles} ${${outfiles}} ${_output})
+ ENDFOREACH()
+ ENDIF(NOT WIN32)
+ENDMACRO(PYQT_WRAP_UIC)
+
+####################################################################
+#
+# PYQT_WRAP_SIP macro
+#
+# Generate C++ wrappings for *.sip files by processing them with sip.
+#
+# USAGE: PYQT_WRAP_SIP(output_files sip_files)
+#
+# ARGUMENTS:
+# output_files [out] variable where output file names are listed to
+# sip_files [in] list of *.sip files
+#
+# NOTES:
+# - Input files are considered relative to the current source directory.
+# - Output files are generated in the current build directory.
+# - This version of macro requires class(es) definition in the
+# *.sip file to be started on a new line without any preceeding characters.
+#
+# WARNING:
+# - The macro does not properly processes sip features which are wrapped
+# with sip conditionals.
+# - The macro works only if one single sip module is processed
+# (there's only one %Module directive within all input sip files).
+#
+# TODO:
+# - Check if dependency of static sources on generated headers works properly:
+# if header is changed, dependant sources should be recompiled.
+# - Think how to properly process sip conditionals.
+# - Process several sip modules.
+#
+####################################################################
+MACRO(PYQT_WRAP_SIP outfiles)
+ SET(_output)
+ SET(_module_input)
+ FOREACH(_input ${ARGN})
+ FILE(STRINGS ${_input} _sip_modules REGEX "%Module")
+ FILE(STRINGS ${_input} _sip_classes REGEX "^class ")
+ FOREACH(_sip_module ${_sip_modules})
+ STRING(REGEX MATCH ".*%Module *\\( *name=.*\\).*" _mod_name "${_sip_module}")
+ IF (_mod_name)
+ STRING(REGEX REPLACE ".*%Module *\\( *name=(.*).*\\).*" "\\1" _mod_name ${_sip_module})
+ ELSE()
+ STRING(REGEX REPLACE ".*%Module *(.*)" "\\1" _mod_name ${_sip_module})
+ ENDIF()
+ SET(_mod_header "sipAPI${_mod_name}.h")
+ SET(_mod_source "sip${_mod_name}cmodule${PYQT_CXX_EXT}")
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/${_mod_source})
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/${_mod_source})
+ SET(_module_input ${_input})
+ ENDFOREACH()
+ FOREACH(_sip_class ${_sip_classes})
+ STRING(REGEX MATCH ".*class +.* *:" _class_name "${_sip_class}")
+ IF (_class_name)
+ STRING(REGEX REPLACE ".*class +(.*) *:.*" "\\1" _class_name ${_sip_class})
+ ELSE()
+ STRING(REGEX REPLACE ".*class *(.*)" "\\1" _class_name ${_sip_class})
+ ENDIF()
+ STRING(STRIP ${_class_name} _class_name)
+ SET(_class_source "sip${_mod_name}${_class_name}${PYQT_CXX_EXT}")
+ LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/${_class_source})
+ SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/${_class_source})
+ ENDFOREACH()
+ ENDFOREACH()
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${_output}
+ COMMAND ${SIP_EXECUTABLE} ${PYQT_SIPFLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/${_module_input}
+ MAIN_DEPENDENCY ${_module_input}
+ )
+ENDMACRO(PYQT_WRAP_SIP)
+
+
+####################################################################
+#
+# PYQT_WRAP_QRC macro
+#
+# Generate Python wrappings for *.qrc files by processing them with pyrcc5.
+#
+# USAGE: PYQT_WRAP_QRC(output_files qrc_files)
+#
+# ARGUMENTS:
+# output_files [out] variable where output file names are listed to
+# qrc_files [in] list of *.qrc files
+#
+# NOTES:
+# - Input files are considered relative to the current source directory.
+# - Output files are generated in the current build directory.
+# - Macro automatically adds custom build target to generate output files
+#
+####################################################################
+
+MACRO(PYQT_WRAP_QRC outfiles)
+ FOREACH(_input ${ARGN})
+ GET_FILENAME_COMPONENT(_input_name ${_input} NAME)
+ STRING(REPLACE ".qrc" "_qrc.py" _input_name ${_input_name})
+ SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${_output}
+ COMMAND ${PYQT_PYRCC_PATH} ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
+ MAIN_DEPENDENCY ${_input}
+ )
+ SET(${outfiles} ${${outfiles}} ${_output})
+ ENDFOREACH()
+ _PYQT_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_QRC_PY_FILES _uniqueTargetName)
+ ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL DEPENDS ${${outfiles}})
+ENDMACRO(PYQT_WRAP_QRC)
+++ /dev/null
-# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# Author: Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-
-####################################################################
-#
-# _PYQT4_WRAP_GET_UNIQUE_TARGET_NAME: internal function
-#
-# Used to generate unique custom target name for usage in
-# PYQT4_WRAP_UIC macro.
-#
-# USAGE: _PYQT4_WRAP_GET_UNIQUE_TARGET_NAME(prefix unique_name)
-#
-# ARGUMENTS:
-# prefix [in] prefix for the name
-# unique_name [out] unique name generated by function
-#
-####################################################################
-FUNCTION(_PYQT4_WRAP_GET_UNIQUE_TARGET_NAME name unique_name)
- SET(_propertyName "_PYQT4_WRAP_UNIQUE_COUNTER_${name}")
- GET_PROPERTY(_currentCounter GLOBAL PROPERTY "${_propertyName}")
- IF(NOT _currentCounter)
- SET(_currentCounter 1)
- ENDIF()
- SET(${unique_name} "${name}_${_currentCounter}" PARENT_SCOPE)
- MATH(EXPR _currentCounter "${_currentCounter} + 1")
- SET_PROPERTY(GLOBAL PROPERTY ${_propertyName} ${_currentCounter} )
-ENDFUNCTION()
-
-####################################################################
-#
-# PYQT4_WRAP_UIC macro
-#
-# Create Python modules by processing input *.ui (Qt designer) files with
-# PyQt4 pyuic4 tool.
-#
-# USAGE: PYQT4_WRAP_UIC(output_files pyuic_files)
-#
-# ARGUMENTS:
-# output_files [out] variable where output file names are listed to
-# pyuic_files [in] list of *.ui files
-#
-# NOTES:
-# - Input files are considered relative to the current source directory.
-# - Output files are generated in the current build directory.
-# - Macro automatically adds custom build target to generate output files
-#
-####################################################################
-MACRO(PYQT4_WRAP_UIC outfiles)
-
- IF(NOT WIN32)
-
- FOREACH(_input ${ARGN})
- GET_FILENAME_COMPONENT(_input_name ${_input} NAME)
- STRING(REPLACE ".ui" "_ui.py" _input_name ${_input_name})
- SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
- ADD_CUSTOM_COMMAND(
- OUTPUT ${_output}
- COMMAND ${PYQT_PYUIC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
- MAIN_DEPENDENCY ${_input}
- )
- SET(${outfiles} ${${outfiles}} ${_output})
- ENDFOREACH()
- _PYQT4_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _uniqueTargetName)
- ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL DEPENDS ${${outfiles}})
-
- ELSE(NOT WIN32)
-####
-# ANA: Workaround for the Microsoft Visual Studio 2010. Seems there is a bug in
-# the Microsoft Visual Studio 2010 or CMake 2.8.10.2: custom target doesn't work
-# for the list of the dependencies. It works only for the first dependency in the
-# list. So generate separate target for the each input file. This problem will be
-#investigated in the future.
-####
-
- SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
- _PYQT4_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _uniqueTargetName)
- ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL)
- FOREACH(_input ${ARGN})
- GET_FILENAME_COMPONENT(_input_name ${_input} NAME)
- STRING(REPLACE ".ui" "_ui.py" _input_name ${_input_name})
- SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
- _PYQT4_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _TgName)
- ADD_CUSTOM_TARGET(${_TgName} ${PYQT_PYUIC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
- DEPENDS ${_input}
- )
- SET_TARGET_PROPERTIES(${_TgName} PROPERTIES FOLDER PYQT4_WRAP_UIC_TARGETS)
- ADD_DEPENDENCIES(${_uniqueTargetName} DEPEND ${_TgName})
- SET(${outfiles} ${${outfiles}} ${_output})
- ENDFOREACH()
- ENDIF(NOT WIN32)
-ENDMACRO(PYQT4_WRAP_UIC)
-
-####################################################################
-#
-# PYQT4_WRAP_SIP macro
-#
-# Generate C++ wrappings for *.sip files by processing them with sip.
-#
-# USAGE: PYQT4_WRAP_SIP(output_files sip_files)
-#
-# ARGUMENTS:
-# output_files [out] variable where output file names are listed to
-# sip_files [in] list of *.sip files
-#
-# NOTES:
-# - Input files are considered relative to the current source directory.
-# - Output files are generated in the current build directory.
-# - This version of macro requires class(es) definition in the
-# *.sip file to be started on a new line without any preceeding characters.
-#
-# WARNING:
-# - The macro does not properly processes sip features which are wrapped
-# with sip conditionals.
-# - The macro works only if one single sip module is processed
-# (there's only one %Module directive within all input sip files).
-#
-# TODO:
-# - Check if dependency of static sources on generated headers works properly:
-# if header is changed, dependant sources should be recompiled.
-# - Think how to properly process sip conditionals.
-# - Process several sip modules.
-#
-####################################################################
-MACRO(PYQT4_WRAP_SIP outfiles)
- SET(_output)
- SET(_module_input)
- FOREACH(_input ${ARGN})
- FILE(STRINGS ${_input} _sip_modules REGEX "%Module")
- FILE(STRINGS ${_input} _sip_classes REGEX "^class ")
- FOREACH(_sip_module ${_sip_modules})
- STRING(REGEX MATCH ".*%Module *\\( *name=.*\\).*" _mod_name "${_sip_module}")
- IF (_mod_name)
- STRING(REGEX REPLACE ".*%Module *\\( *name=(.*).*\\).*" "\\1" _mod_name ${_sip_module})
- ELSE()
- STRING(REGEX REPLACE ".*%Module *(.*)" "\\1" _mod_name ${_sip_module})
- ENDIF()
- SET(_mod_header "sipAPI${_mod_name}.h")
- SET(_mod_source "sip${_mod_name}cmodule${PYQT_CXX_EXT}")
- LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/${_mod_source})
- SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/${_mod_source})
- SET(_module_input ${_input})
- ENDFOREACH()
- FOREACH(_sip_class ${_sip_classes})
- STRING(REGEX MATCH ".*class +.* *:" _class_name "${_sip_class}")
- IF (_class_name)
- STRING(REGEX REPLACE ".*class +(.*) *:.*" "\\1" _class_name ${_sip_class})
- ELSE()
- STRING(REGEX REPLACE ".*class *(.*)" "\\1" _class_name ${_sip_class})
- ENDIF()
- STRING(STRIP ${_class_name} _class_name)
- SET(_class_source "sip${_mod_name}${_class_name}${PYQT_CXX_EXT}")
- LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/${_class_source})
- SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/${_class_source})
- ENDFOREACH()
- ENDFOREACH()
- ADD_CUSTOM_COMMAND(
- OUTPUT ${_output}
- COMMAND ${SIP_EXECUTABLE} ${PYQT_SIPFLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/${_module_input}
- MAIN_DEPENDENCY ${_module_input}
- )
-ENDMACRO(PYQT4_WRAP_SIP)
-
-
-####################################################################
-#
-# PYQT4_WRAP_QRC macro
-#
-# Generate Python wrappings for *.qrc files by processing them with pyrcc4.
-#
-# USAGE: PYQT4_WRAP_QRC(output_files qrc_files)
-#
-# ARGUMENTS:
-# output_files [out] variable where output file names are listed to
-# qrc_files [in] list of *.qrc files
-#
-# NOTES:
-# - Input files are considered relative to the current source directory.
-# - Output files are generated in the current build directory.
-# - Macro automatically adds custom build target to generate output files
-#
-####################################################################
-
-MACRO(PYQT4_WRAP_QRC outfiles)
- FOREACH(_input ${ARGN})
- GET_FILENAME_COMPONENT(_input_name ${_input} NAME)
- STRING(REPLACE ".qrc" "_qrc.py" _input_name ${_input_name})
- SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
- ADD_CUSTOM_COMMAND(
- OUTPUT ${_output}
- COMMAND ${PYQT_PYRCC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
- MAIN_DEPENDENCY ${_input}
- )
- SET(${outfiles} ${${outfiles}} ${_output})
- ENDFOREACH()
- _PYQT4_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_QRC_PY_FILES _uniqueTargetName)
- ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL DEPENDS ${${outfiles}})
-ENDMACRO(PYQT4_WRAP_QRC)
+++ /dev/null
-# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-INSTALL(CODE "MACRO(QT4_COMPILE_TS_ON_INSTALL MYLRELEASE MYTSFILE MYFULLDIR MYOUTQMFILE)
- FILE(MAKE_DIRECTORY \${MYFULLDIR})
- MESSAGE(STATUS \"Compiling \${MYTSFILE}\")
- EXECUTE_PROCESS(COMMAND \${MYLRELEASE} \${MYTSFILE} -qm \${MYFULLDIR}/\${MYOUTQMFILE})
-ENDMACRO(QT4_COMPILE_TS_ON_INSTALL)")
-
-# This MACRO uses the following vars
-# - QT_LRELEASE_EXECUTABLE : (given by default by FindQT.cmake)
-#
-# MYTSFILES containing all ts files to be compiled.
-# WHERETOINSTALL contains directory (relative to install_prefix) where to install files after compilation of ts files too qm.
-MACRO(QT4_INSTALL_TS_RESOURCES MYTSFILES WHERETOINSTALL)
- INSTALL(CODE "SET(INSTALL_TS_DIR ${WHERETOINSTALL})")
- SET(MYSOURCES)
- FOREACH(input ${MYTSFILES})
- GET_FILENAME_COMPONENT(input2 ${input} NAME)
- STRING(REGEX REPLACE ".ts" "" base ${input2})
- SET(output "${base}.qm")
- INSTALL(CODE "QT4_COMPILE_TS_ON_INSTALL( \"${QT_LRELEASE_EXECUTABLE}\" \"${CMAKE_CURRENT_SOURCE_DIR}/${input}\" \"${CMAKE_INSTALL_PREFIX}/\${INSTALL_TS_DIR}\" ${output})")
- ENDFOREACH(input ${MYIDLFILES})
-ENDMACRO(QT4_INSTALL_TS_RESOURCES)
--- /dev/null
+# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INSTALL(CODE "MACRO(QT_COMPILE_TS_ON_INSTALL MYLRELEASE MYTSFILE MYFULLDIR MYOUTQMFILE)
+ FILE(MAKE_DIRECTORY \${MYFULLDIR})
+ MESSAGE(STATUS \"Compiling \${MYTSFILE}\")
+ EXECUTE_PROCESS(COMMAND \${MYLRELEASE} \${MYTSFILE} -qm \${MYFULLDIR}/\${MYOUTQMFILE})
+ENDMACRO(QT_COMPILE_TS_ON_INSTALL)")
+
+# This MACRO uses the following vars
+# - QT_LRELEASE_EXECUTABLE : (given by default by FindQT.cmake)
+#
+# MYTSFILES containing all ts files to be compiled.
+# WHERETOINSTALL contains directory (relative to install_prefix) where to install files after compilation of ts files too qm.
+MACRO(QT_INSTALL_TS_RESOURCES MYTSFILES WHERETOINSTALL)
+ INSTALL(CODE "SET(INSTALL_TS_DIR ${WHERETOINSTALL})")
+ SET(MYSOURCES)
+ FOREACH(input ${MYTSFILES})
+ GET_FILENAME_COMPONENT(input2 ${input} NAME)
+ STRING(REGEX REPLACE ".ts" "" base ${input2})
+ SET(output "${base}.qm")
+ INSTALL(CODE "QT_COMPILE_TS_ON_INSTALL( \"${QT_LRELEASE_EXECUTABLE}\" \"${CMAKE_CURRENT_SOURCE_DIR}/${input}\" \"${CMAKE_INSTALL_PREFIX}/\${INSTALL_TS_DIR}\" ${output})")
+ ENDFOREACH(input ${MYIDLFILES})
+ENDMACRO(QT_INSTALL_TS_RESOURCES)
bool save = false;
if ( !stdDoc().IsNull() && stdDoc()->IsSaved() )
{
- QString path = QDir::convertSeparators( CAF_Tools::toQString( stdDoc()->GetPath() ) );
- save = path == QDir::convertSeparators( fname );
+ QString path = QDir::toNativeSeparators( CAF_Tools::toQString( stdDoc()->GetPath() ) );
+ save = path == QDir::toNativeSeparators( fname );
}
bool status = false;
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${CAS_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/SUIT
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${CAS_DEFINITIONS} ${QT_DEFINITIONS})
+ADD_DEFINITIONS(${CAS_DEFINITIONS} ${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} ${CAS_OCAF} ${CAS_OCAFVIS} qtx suit std)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} ${CAS_OCAF} ${CAS_OCAFVIS} qtx suit std)
# --- headers ---
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
# --- rules ---
ADD_LIBRARY(caf ${caf_SOURCES})
-TARGET_LINK_LIBRARIES(caf ${QT_LIBRARIES} ${_link_LIBRARIES})
+TARGET_LINK_LIBRARIES(caf ${_QT_LIBRARIES} ${_link_LIBRARIES})
INSTALL(TARGETS caf EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${caf_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
\ No newline at end of file
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/SUIT
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} qtx suit std)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} qtx suit std)
# --- headers ---
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS CAM EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${CAM_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
\ No newline at end of file
TARGET_LINK_LIBRARIES(DDS ${_link_LIBRARIES})
INSTALL(TARGETS DDS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-INSTALL(FILES ${DDS_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-
+INSTALL(FILES ${DDS_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
\ No newline at end of file
#
# --- options ---
-
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES})
+SET(_link_LIBRARIES ${_QT_LIBRARIES})
# --- headers ---
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES} ${Qt5OpenGL_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS} ${Qt5OpenGL_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5OpenGL_LIBRARIES})
+ENDIF()
# --- options ---
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/SUIT
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${CAS_DEFINITIONS} ${QT_DEFINITIONS})
+ADD_DEFINITIONS(${CAS_DEFINITIONS} ${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} ${CAS_KERNEL} ${OPENGL_LIBRARIES} qtx suit)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} ${CAS_KERNEL} ${OPENGL_LIBRARIES} qtx suit)
IF(NOT WIN32)
LIST(APPEND _link_LIBRARIES Xmu)
ENDIF()
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
-
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
GLViewer_AspectLine.cxx
INSTALL(TARGETS GLViewer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${GLViewer_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
-INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
\ No newline at end of file
}
aBuffer+="closepath\nstroke\n";
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
return true;
}
}
aBuffer+="PU;\n";
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
}
return true;
if ( ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ) ||
( !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) ) )
{
- isFound = FALSE;
+ isFound = false;
count++;
for ( it = myCurSelNumbers.begin(); it != myCurSelNumbers.end(); ++it )
if( i == *it )
{
- isFound = TRUE;
+ isFound = true;
curHNumbers.append( i );
}
count++;
if ( isShift )
{
- bool isFound = FALSE;
+ bool isFound = false;
for( it = mySelNumbers.begin(); it != mySelNumbers.end(); ++it )
if ( *it == i )
{
myUSelNumbers.append( *it );
remIt = it;
- isFound = TRUE;
+ isFound = true;
break;
}
bool GLViewer_MarkerSet::addOrRemoveSelected( int index )
{
if( index < 0 || index > myNumber )
- return FALSE;
+ return false;
int n = mySelNumbers.indexOf( index );
if( n == -1 )
mySelNumbers.removeAt(n);
myUSelNumbers.append( index );
}
- return TRUE;
+ return true;
}
/*!
aBuffer+="closepath\nstroke\n";
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
return true;
}
aBuffer+="PU;\n";
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
return true;
}
AddCoordsToPS( aBuffer, "moveto", aViewerCS, aPSCS, double(xPos), double(yPos) );
aBuffer += "(" + aText + ") show\n";
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
return true;
}
aBuffer = "LB" + aText + "#;";
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
return true;
}
QRegion circle( (int)(theX - theTol), (int)(theY - theTol),
(int)(2 * theTol), (int)(2 * theTol), QRegion::Ellipse );
if( isCircle )
- intersection = obj.intersect( circle );
+ intersection = obj.intersected( circle );
else
- intersection = obj.intersect( region );
+ intersection = obj.intersected( region );
if( intersection.isEmpty() )
myIsHigh = false;
QRegion circle( (int)(theX - theTol), (int)(theY - theTol),
(int)(2 * theTol), (int)(2 * theTol), QRegion::Ellipse );
if( isCircle )
- intersection = obj.intersect( circle );
+ intersection = obj.intersected( circle );
else
- intersection = obj.intersect( region );
+ intersection = obj.intersected( region );
if( intersection.isEmpty() )
myIsSel = false;
if( myLastPickedChanged || myUpdateAll )
myGLViewer2d->updateAll();
else
- myGLViewer2d->activateDrawers( anUpdatedObjects, TRUE, TRUE );
+ myGLViewer2d->activateDrawers( anUpdatedObjects, true, true );
return 0;
}
if( updateAll || myUpdateAll )
myGLViewer2d->updateAll();
else
- myGLViewer2d->activateDrawers( aList, TRUE, TRUE );
+ myGLViewer2d->activateDrawers( aList, true, true );
if( mySelectedObjects.count() != 0 && status == SS_Invalid )
status = SS_GlobalChanged;
&& mySelectedObjects.indexOf( myLastPicked ) == -1 )
{
mySelectedObjects.append( myLastPicked );
- myGLViewer2d->activateDrawer( myLastPicked, TRUE, TRUE );
+ myGLViewer2d->activateDrawer( myLastPicked, true, true );
if( status == SS_Invalid )
status = SS_GlobalChanged;
if( updateAll || myUpdateAll )
myGLViewer2d->updateAll();
else
- myGLViewer2d->activateDrawers( aList, TRUE, TRUE );
+ myGLViewer2d->activateDrawers( aList, true, true );
if( mySelectedObjects.count() != 0 )
status = SS_GlobalChanged;
if( updateAll || myUpdateAll )
myGLViewer2d->updateAll();
else
- myGLViewer2d->activateDrawers( aList, TRUE, TRUE );
+ myGLViewer2d->activateDrawers( aList, true, true );
if( mySelectedObjects.count() != 0 )
status = SS_GlobalChanged;
{
myLastPicked = *oit;
mySelectedObjects.append( myLastPicked );
- myGLViewer2d->activateDrawer( myLastPicked, TRUE, TRUE );
+ myGLViewer2d->activateDrawer( myLastPicked, true, true );
status = SS_GlobalChanged;
return status;
}
if( updateAll || myUpdateAll )
myGLViewer2d->updateAll();
else
- myGLViewer2d->activateDrawers( aList, TRUE, TRUE );
+ myGLViewer2d->activateDrawers( aList, true, true );
return status;
}
if ( mySelCurIndex >= 0 && mySelCurIndex < NbSelected() )
{
mySelCurIndex++;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*!
{
//QRect* rect = object->getRect()->toQRect();
//myGLViewer2d->updateBorders( *rect );
- myGLViewer2d->activateDrawer( object, FALSE );
+ myGLViewer2d->activateDrawer( object, false );
}
}
else
}
if( updateViewer )
- myGLViewer2d->activateDrawers( aList, TRUE );
+ myGLViewer2d->activateDrawers( aList, true );
mySelectedObjects.clear();
}
if( myActiveObjects.contains( object ) && !mySelectedObjects.contains( object ) )
{
- object->setSelected( TRUE );
+ object->setSelected( true );
mySelectedObjects.append( object );
}
if( updateViewer )
- myGLViewer2d->activateDrawer( object, TRUE, TRUE );
+ myGLViewer2d->activateDrawer( object, true, true );
}
/*!
object->unselect();
if( updateViewer )
- myGLViewer2d->activateDrawer( object, TRUE, TRUE );
+ myGLViewer2d->activateDrawer( object, true, true );
}
/*!
*\paran byCircle - true if needs round sensitive area around mouse cursor, else rectangle
*function search object rectangle which intersect with sensitive area and call object highlight method
*/
- int MoveTo( int x, int y, bool byCircle = FALSE );
+ int MoveTo( int x, int y, bool byCircle = false );
/*! A function selecting already highlighting object by calling object method select
*\param Append - true if new selection will be append to existing selection, false - another
*\param byCircle - true if needs round selection area in complex object
*/
- int Select( bool Append = FALSE, bool byCircle = FALSE );
+ int Select( bool Append = false, bool byCircle = false );
/*! A function selecting objects on scene by rectangle
*\param theRect - rectangle of selection
*\param Append - true if new selection will be append to existing selection, false - another
*function search object rectangle which intersect with theRect and call object select method
*/
- int SelectByRect( const QRect& theRect, bool Append = FALSE );
+ int SelectByRect( const QRect& theRect, bool Append = false );
//! A function installing highlight color for all presentation (does not work)
void SetHighlightColor( Quantity_NameOfColor aCol );
int aFontCont = 0;
QString aFontDef = theFont->toString();
char** xFontList = XListFonts( aDisp, aFontDef.toLatin1()/*aFindFont.myFontString.data()*/, 1, &aFontCont );
- if( !theFont->handle() )
- {
#ifdef _DEBUG_
- printf( "Can't load font %s. loading default font....\n", aFontDef.toLatin1().data()/*aFindFont.myFontString.data()*/ );
+ printf( "Can't load font %s. loading default font....\n", aFontDef.toLatin1().data()/*aFindFont.myFontString.data()*/ );
#endif
- QString aFontMask ("-*-*-*-r-*-*-");
- aFontMask += aFontDef/*aFindFont.myFontString*/.section( ',', 1, 1 );
+ QString aFontMask ("-*-*-*-r-*-*-");
+ aFontMask += aFontDef/*aFindFont.myFontString*/.section( ',', 1, 1 );
#ifdef _DEBUG_
- printf( "Height of Default font: %s\n", aFontDef/*aFindFont.myFontString*/.section( ',', 1, 1 ).data() );
+ printf( "Height of Default font: %s\n", aFontDef/*aFindFont.myFontString*/.section( ',', 1, 1 ).data() );
#endif
- aFontMask += "-*-*-*-m-*-*-*";
- xFontList = XListFonts( aDisp, aFontMask.toLatin1().constData()/*"-*-*-*-r-*-*-12-*-*-*-m-*-*-*"*/, 1, &aFontCont );
- if( aFontCont == 0 )
- {
+ aFontMask += "-*-*-*-m-*-*-*";
+ xFontList = XListFonts( aDisp, aFontMask.toLatin1().constData()/*"-*-*-*-r-*-*-12-*-*-*-m-*-*-*"*/, 1, &aFontCont );
+ if( aFontCont == 0 )
+ {
#ifdef _DEBUG_
- printf( "Can't load default font\n" );
+ printf( "Can't load default font\n" );
#endif
- return 0;
- }
- glXUseXFont( (Font)(XLoadFont( aDisp,xFontList[0] )), 0, 256, listBase );
+ return 0;
}
- else
- glXUseXFont( (Font)(theFont->handle()), 0, 256, listBase );
+ glXUseXFont( (Font)(XLoadFont( aDisp,xFontList[0] )), 0, 256, listBase );
aList = listBase;
GLViewer_TexFont::BitmapFontCache[aFindFont] = aList;
{
glDeleteLists( myGridList, 1 );
if ( glGetError() != GL_NO_ERROR )
- return FALSE;
+ return false;
}
float xLoc = (int)(myXPan / myXSize) * myXSize;
glEndList();
}
- return TRUE;
+ return true;
}
#include <stdlib.h>
#if !defined WIN32
-#include <QX11Info>
+#include <QtGui/QX11Info>
#include <GL/glx.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
cout << "Choosing cmap for vID = " << vi->visualid << endl;
#endif
- if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) )
+ /* if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) )
{
#ifdef DEBUG
cout << "Using x11AppColormap" << endl;
#endif
return QX11Info::appColormap();
- }
+ } */
if ( mesa_gl )
{
myGLWidget = new GLViewer_Widget( this, 0 ) ;
qbl->addWidget( myGLWidget );
myGLWidget->setFocusProxy( this );
- setMouseTracking( TRUE );
+ setMouseTracking( true );
myIsDragProcess = noDrag;
//myCurDragMousePos = QPoint();
GLfloat zoom, xzoom, yzoom;
GLfloat w = x;
GLfloat h = y;
- bool max = FALSE;
+ bool max = false;
xzoom = (GLfloat)x / myWidth;
yzoom = (GLfloat)y / myHeight;
zoom = yzoom;
else
{
- max = TRUE;
+ max = true;
zoom = xzoom > yzoom ? xzoom : yzoom;
}
if ( state == Fin )
{
- QApplication::syncX(); /* force rectangle redrawing */
+ QApplication::sync(); /* force rectangle redrawing */
myViewer->activateSketching( GLViewer_Viewer::NoSketching );
}
}
*/
- activateAllDrawers( TRUE );
+ activateAllDrawers( true );
}
/*!
header += "%%Pages: 1\n";
header += "%%Page: 1\n\n";
- hFile.write( header.toAscii() );
+ hFile.write( header.toLatin1() );
}
else if( aType == HPGL )
{
header += "LT;\n";
header += "VS36;\n";
- hFile.write( header.toAscii() );
+ hFile.write( header.toLatin1() );
}
}
if( aType == POST_SCRIPT )
{
QString ending = "showpage\n\n%%EOF";
- hFile.write( ending.toAscii() );
+ hFile.write( ending.toLatin1() );
}
else if( aType == HPGL )
{
QString ending = "PU;PA0,0;SP;EC;PG1;EC1;OE\n";
- hFile.write( ending.toAscii() );
+ hFile.write( ending.toLatin1() );
}
}
if ( !getActiveView() )
return false;
- QFile hFile( FileName.toAscii() );
+ QFile hFile( FileName.toLatin1() );
#ifdef WIN32
HDC hMetaFileDC;
arg( AW-mmLeft-mmRight ).arg( AH-mmBottom-mmTop );
//It is set clipping path
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
aCurVP->getGLWidget()->translateBackgroundToPS( hFile, &aViewerCS, &aPaperCS );
}
aBuffer += "> false 3 colorimage\n\n";
- hFile.write( aBuffer.toAscii() );
+ hFile.write( aBuffer.toLatin1() );
}
}
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UsePyQt4)
-
+INCLUDE(UsePyQt)
# --- resources ---
# uic files / to be processed by pyuic
# --- scripts ---
# scripts / pyuic wrappings
-
-PYQT4_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
+PYQT_WRAP_UIC(_pyuic_SCRIPTS ${_pyuic_files})
# scripts / static
SET(_other_SCRIPTS
-from PyQt4.QtCore import *
-from PyQt4.QtGui import *
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
import SalomePyQt
__author__="gboulant"
__date__ ="$31 mars 2010 17:09:53$"
-from PyQt4.QtGui import QDialog, QMessageBox
+from PyQt5.QtGui import QDialog, QMessageBox
from genericdialog_ui import Ui_GenericDialog
#
def TEST_GenericDialog():
import sys
- from PyQt4.QtGui import QApplication
- from PyQt4.QtCore import QObject, SIGNAL, SLOT
+ from PyQt5.QtGui import QApplication
+ from PyQt5.QtCore import QObject, SIGNAL, SLOT
app = QApplication(sys.argv)
QObject.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
return name
-from PyQt4.QtCore import SIGNAL
+from PyQt5.QtCore import SIGNAL
class MyTestDialogWithSignals(MyTestDialog):
"""
This class is to illustrate the usage of the GenericDialog in the
def TEST_MyTestDialog_modal():
import sys
- from PyQt4.QtCore import QObject, SIGNAL, SLOT
- from PyQt4.QtGui import QApplication
+ from PyQt5.QtCore import QObject, SIGNAL, SLOT
+ from PyQt5.QtGui import QApplication
app = QApplication(sys.argv)
QObject.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
def TEST_MyTestDialog_non_modal():
import sys
- from PyQt4.QtCore import QObject, SIGNAL, SLOT
- from PyQt4.QtGui import QApplication
+ from PyQt5.QtCore import QObject, SIGNAL, SLOT
+ from PyQt5.QtGui import QApplication
app = QApplication(sys.argv)
QObject.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
#
import os
-from PyQt4 import QtGui, QtCore
-from PyQt4.QtCore import Qt
+from PyQt5 import QtGui, QtCore
+from PyQt5.QtCore import Qt
import salome
from salome.kernel.studyedit import getStudyEditor
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/SUIT
${PROJECT_SOURCE_DIR}/src/ImageComposer
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} qtx suit ImageComposer)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} qtx suit ImageComposer)
# --- headers ---
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS GraphicsView EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${GraphicsView_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
//=======================================================================
GraphicsView_Object::~GraphicsView_Object()
{
- QListIterator<QGraphicsItem*> aChildIter( children() );
- while( aChildIter.hasNext() )
+ QList<QGraphicsItem *> aList = childItems();
+ for( QList<QGraphicsItem *>::const_iterator aChild = aList.begin(); aChild != aList.end(); ++aChild )
{
- if( QGraphicsItem* aChild = aChildIter.next() )
+ if( *aChild )
{
- removeFromGroup( aChild );
- if( QGraphicsScene* aScene = aChild->scene() )
- aScene->removeItem( aChild );
- delete aChild;
+ removeFromGroup( *aChild );
+ if( QGraphicsScene* aScene = (*aChild)->scene() )
+ aScene->removeItem( *aChild );
+ delete ( *aChild );
aChild = 0;
}
}
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${Boost_INCLUDE_DIRS}
${OMNIORB_INCLUDE_DIR}
${PTHREAD_INCLUDE_DIR}
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
${CAS_DEFINITIONS}
- ${QT_DEFINITIONS}
+ ${_QT_DEFINITIONS}
${BOOST_DEFINITIONS}
${OMNIORB_DEFINITIONS}
)
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
#
# --- options ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES} ${Qt5Network_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_SOURCE_DIR}/src/Qtx
)
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
- ${QT_DEFINITIONS}
+ ${_QT_DEFINITIONS}
)
# libraries to link to
SET(_link_LIBRARIES
- ${QT_LIBRARIES}
+ ${_QT_LIBRARIES}
qtx
)
SET(_rcc_RESOURCES HelpBrowser.qrc)
# --- sources ---
-
-# sources / rcc wrappings
-QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
-
-# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ELSE()
+ # sources / moc wrappings
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT5_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ENDIF()
# sources / to compile
SET(_other_SOURCES
ADD_EXECUTABLE(HelpBrowser ${HelpBrowser_SOURCES})
TARGET_LINK_LIBRARIES(HelpBrowser ${_link_LIBRARIES})
-INSTALL(TARGETS HelpBrowser EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})
+INSTALL(TARGETS HelpBrowser EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})
\ No newline at end of file
#include "qtlocalpeer.h"
#include <QCoreApplication>
#include <QTime>
+#include <QDataStream>
#if defined(Q_OS_WIN)
#include <QLibrary>
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES})
+SET(_link_LIBRARIES ${_QT_LIBRARIES})
# --- headers ---
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES} )
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${HDF5_INCLUDE_DIRS}
${PTHREAD_INCLUDE_DIR}
${PROJECT_BINARY_DIR}
ENDIF()
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${CAS_DEFINITIONS} ${QT_DEFINITIONS} ${HDF5_DEFINITIONS})
+ADD_DEFINITIONS(${CAS_DEFINITIONS} ${_QT_DEFINITIONS} ${HDF5_DEFINITIONS})
IF(SALOME_USE_PLOT2DVIEWER)
ADD_DEFINITIONS(${QWT_DEFINITIONS})
ENDIF()
# libraries to link to
SET(_link_LIBRARIES
${CAS_KERNEL}
- ${QT_LIBRARIES}
+ ${_QT_LIBRARIES}
${HDF5_LIBRARIES}
CASCatch qtx suit std SalomeStyle SalomePrs CAM LogWindow ObjBrowser Event
${KERNEL_SalomeHDFPersist} ${KERNEL_SALOMELocalTrace}
)
# --- sources ---
-
-# sources / rcc wrappings
-QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
-
-# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ELSE()
+ # sources / moc wrappings
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT5_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS LightApp EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${LightApp_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
// Create OBSelector
new LightApp_OBSelector( ob, mySelMgr );
- ob->treeView()->header()->setResizeMode(SUIT_DataObject::VisibilityId, QHeaderView::Fixed);
+ ob->treeView()->header()->setSectionResizeMode(SUIT_DataObject::VisibilityId, QHeaderView::Fixed);
ob->treeView()->header()->moveSection(SUIT_DataObject::NameId,SUIT_DataObject::VisibilityId);
ob->treeView()->setColumnWidth(SUIT_DataObject::VisibilityId, VISIBILITY_COLUMN_WIDTH);
ob->setProperty( "shortcut", QKeySequence( "Alt+Shift+O" ) );
QMap<QString, bool> tbMap, dwMap;
dockWindowsState( visArr, tbMap, dwMap );
- QList<QToolBar*> tbList = qFindChildren<QToolBar*>( desktop() );
+ QList<QToolBar*> tbList = desktop()->findChildren<QToolBar*>();
for ( QList<QToolBar*>::iterator it = tbList.begin(); it != tbList.end(); ++it )
{
QToolBar* tb = *it;
tbMap.insert( tb->objectName(), tb->toggleViewAction()->isChecked() );
}
- QList<QDockWidget*> dwList = qFindChildren<QDockWidget*>( desktop() );
+ QList<QDockWidget*> dwList = desktop()->findChildren<QDockWidget*>();
for ( QList<QDockWidget*>::iterator it = dwList.begin(); it != dwList.end(); ++it )
{
QDockWidget* wid = *it;
QList<QToolBar*> LightApp_Application::findToolBars( const QStringList& names )
{
QList<QToolBar*> aResult;
- QList<QToolBar*> tbList = qFindChildren<QToolBar*>( desktop() );
+ QList<QToolBar*> tbList = desktop()->findChildren<QToolBar*>();
for ( QList<QToolBar*>::iterator tit = tbList.begin(); tit != tbList.end(); ++tit ) {
QToolBar* tb = *tit;
QObject* po = Qtx::findParent( tb, "QMainWindow" );
if( myObjects.contains( id ) && isObjectShown( id )!=shown )
{
Object& obj = myObjects[ id ];
- obj.myEdit->setShown( shown );
- obj.myBtn->setShown( shown );
- obj.myLabel->setShown( shown );
+ obj.myEdit->setVisible( shown );
+ obj.myBtn->setVisible( shown );
+ obj.myLabel->setVisible( shown );
if( !shown )
( ( QToolButton* )obj.myBtn )->setChecked( false );
}
if(aFileBuffer == NULL)
return false;
- myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
+ myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
int aCurrentPos = 0;
ifstream aFile(theFileName);
#endif
- myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
+ myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
aFile.seekg(0, ios::end);
int aFileBufferSize = aFile.tellg();
QList<QWidget*> wlist = createdWidgets();
for ( QList<QWidget*>::const_iterator wit = wlist.begin(); wit != wlist.end(); ++wit )
- lst += qFindChildren<QtxComboBox *>(*wit);
+ lst += (*wit)->findChildren<QtxComboBox *>();
return lst;
}
setModal( true );
setWindowTitle( tr("TLT_RENAME") );
- setSizeGripEnabled( TRUE );
+ setSizeGripEnabled( true );
QVBoxLayout* topLayout = new QVBoxLayout( this );
topLayout->setMargin( 11 ); topLayout->setSpacing( 6 );
myButtonOk = new QPushButton( GroupButtons );
myButtonOk->setObjectName( "buttonOk" );
myButtonOk->setText( tr( "BUT_OK" ) );
- myButtonOk->setAutoDefault( TRUE ); myButtonOk->setDefault( TRUE );
+ myButtonOk->setAutoDefault( true ); myButtonOk->setDefault( true );
GroupButtonsLayout->addWidget( myButtonOk );
GroupButtonsLayout->addStretch();
myButtonCancel = new QPushButton( GroupButtons );
myButtonCancel->setObjectName( "buttonCancel" );
myButtonCancel->setText( tr( "BUT_CANCEL" ) );
- myButtonCancel->setAutoDefault( TRUE );
+ myButtonCancel->setAutoDefault( true );
GroupButtonsLayout->addWidget( myButtonCancel );
/***************************************************************/
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/SUIT
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} qtx suit)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} qtx suit)
# --- headers ---
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES LogWindow.cxx)
INSTALL(TARGETS LogWindow EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${LogWindow_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
#
# --- options ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS} ${CAS_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} ${CAS_LDPATH} ${CAS_KERNEL} ${CAS_TKV3d} ViewerData)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} ${CAS_LDPATH} ${CAS_KERNEL} ${CAS_TKV3d} ViewerData)
# --- headers ---
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
${OGL_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PTHREAD_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/src/CASCatch
${PROJECT_SOURCE_DIR}/src/Qtx
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${OGL_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS} ${CAS_DEFINITIONS} ${OGL_DEFINITIONS})
# libraries to link to
SET(_link_LIBRARIES
- ${OPENGL_LIBRARIES} ${QT_LIBRARIES} ${CAS_KERNEL} ${CAS_VIEWER} ${CAS_TKGeomAlgo}
+ ${OPENGL_LIBRARIES} ${_QT_LIBRARIES} ${CAS_KERNEL} ${CAS_VIEWER} ${CAS_TKGeomAlgo}
${CAS_TKTopAlgo} ${CAS_TKG2d} ${CAS_TKOpenGl}
CASCatch qtx suit ViewerTools ViewerData OpenGLUtils
)
)
# --- sources ---
-
-# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
-
-# sources / rcc wrappings
-QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ELSE()
+ # sources / moc wrappings
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT5_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS OCCViewer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${OCCViewer_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
buttonOk = new QPushButton( GroupButtons );
buttonOk->setObjectName( "buttonOk" );
buttonOk->setText( tr( "BUT_APPLY_AND_CLOSE" ) );
- buttonOk->setAutoDefault( TRUE );
- buttonOk->setDefault( TRUE );
+ buttonOk->setAutoDefault( true );
+ buttonOk->setDefault( true );
GroupButtonsLayout->addWidget( buttonOk );
buttonApply = new QPushButton( GroupButtons );
buttonApply->setObjectName( "buttonApply" );
buttonApply->setText( tr( "BUT_APPLY" ) );
- buttonApply->setAutoDefault( TRUE );
- buttonApply->setDefault( TRUE );
+ buttonApply->setAutoDefault( true );
+ buttonApply->setDefault( true );
GroupButtonsLayout->addWidget( buttonApply );
GroupButtonsLayout->addStretch();
buttonClose = new QPushButton( GroupButtons );
buttonClose->setObjectName( "buttonClose" );
buttonClose->setText( tr( "BUT_CLOSE" ) );
- buttonClose->setAutoDefault( TRUE );
+ buttonClose->setAutoDefault( true );
GroupButtonsLayout->addWidget( buttonClose );
QPushButton* buttonHelp = new QPushButton( tr( "HELP" ), GroupButtons );
- buttonHelp->setAutoDefault( TRUE );
+ buttonHelp->setAutoDefault( true );
GroupButtonsLayout->addWidget( buttonHelp );
/***************************************************************/
highLevel = index;
}
for( int j = lowLevel; j <= highLevel; j++ )
- myListBox->item( j )->setSelected( TRUE );
+ myListBox->item( j )->setSelected( true );
break;
}
if( myListBox->item( i )->isSelected() && i == index )
- myListBox->item( i )->setSelected( TRUE );
+ myListBox->item( i )->setSelected( true );
}
}
setModal( modal );
setWindowTitle(tr("CAPTION"));
- setSizeGripEnabled(TRUE);
+ setSizeGripEnabled(true);
// Create layout for this dialog
QGridLayout* layoutDlg = new QGridLayout (this);
QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox );
m_bClose->setObjectName("m_bClose");
- m_bClose->setAutoDefault(TRUE);
+ m_bClose->setAutoDefault(true);
m_bClose->setFixedSize(m_bClose->sizeHint());
connect(m_bClose, SIGNAL(clicked()), this, SLOT(onClickClose()));
public:
OCCViewer_SetRotationPointDlg(OCCViewer_ViewWindow* ,
- const char* name = 0, bool modal = FALSE, Qt::WindowFlags fl = 0);
+ const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0);
~OCCViewer_SetRotationPointDlg();
void SetAction( QtxAction* theAction ) { myAction = theAction; }
OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*)(myViewManager->getActiveView());
//Support of several toolbars in the popup menu
- QList<QToolBar*> lst = qFindChildren<QToolBar*>( aView );
+ QList<QToolBar*> lst = aView->findChildren<QToolBar*>();
QList<QToolBar*>::const_iterator it = lst.begin(), last = lst.end();
for ( ; it!=last; it++ ) {
if ( (*it)->parentWidget()->isVisible() )
#include <stdlib.h>
#if !defined WIN32
-#include <QX11Info>
+#include <QtGui/QX11Info>
#include <GL/glx.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
//cout << "Choosing cmap for vID = " << vi->visualid << endl;
//#endif
- if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) )
+ /*if ( vi->visualid == XVisualIDFromVisual( (Visual*)QX11Info::appVisual() ) )
{
#ifdef DEBUG
// cout << "Using x11AppColormap" << endl;
#endif
return QX11Info::appColormap();
- }
+ }*/
if ( mesa_gl )
{
mapView( activeView() );
#endif
if ( !myWindow.IsNull() ) {
- QApplication::syncX();
+ QApplication::sync();
QRect rc = e->rect();
if ( !myPaintersRedrawing )
activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() );
if ( !mapped( activeView() ) )
mapView( activeView() );
#endif
- QApplication::syncX();
+ QApplication::sync();
if ( !activeView().IsNull() )
activeView()->MustBeResized();
}
if ( state == Fin )
{
- QApplication::syncX(); /* force rectangle redrawing */
+ QApplication::sync(); /* force rectangle redrawing */
mypViewWindow->activateSketching( OCCViewer_ViewWindow::NoSketching );
}
}
mypPolyRB->clearGeometry();
mypPolyRB->hide();
}
- QApplication::syncX();
+ QApplication::sync();
mypViewWindow->activateSketching( OCCViewer_ViewWindow::NoSketching );
}
}
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_SOURCE_DIR}/src/Qtx
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} qtx)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} qtx)
# --- headers ---
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES OB_Browser.cxx)
INSTALL(TARGETS ObjBrowser EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${ObjBrowser_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
# Install ParaView filters, etc ...
ADD_SUBDIRECTORY(resources)
)
# --- sources ---
-
-# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
-
-# sources / rcc wrappings
-QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ELSE()
+ # sources / moc wrappings
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT5_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ENDIF()
# sources / static
SET(_other_SOURCES
TARGET_LINK_LIBRARIES(PVViewer ${_link_LIBRARIES})
INSTALL(TARGETS PVViewer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
# --- header and resources installation ---
INSTALL(FILES ${PVViewer_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${QWT_INCLUDE_DIR}
${PYTHON_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src/Qtx
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS} ${QWT_DEFINITIONS} ${PYTHON_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS} ${QWT_DEFINITIONS} ${PYTHON_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} ${QWT_LIBRARY} ${PYTHON_LIBRARIES} qtx suit)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} ${QWT_LIBRARY} ${PYTHON_LIBRARIES} qtx suit)
# --- headers ---
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS Plot2d EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${Plot2d_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
setObjectName( "Plot2d_FitDataDlg" );
setModal( true );
setWindowTitle( tr( "FIT_DATA_TLT" ) );
- setSizeGripEnabled( TRUE );
+ setSizeGripEnabled( true );
QGridLayout* topLayout = new QGridLayout( this );
topLayout->setSpacing( SPACING_SIZE );
topLayout->setMargin( MARGIN_SIZE );
// OK/Cancel buttons
myOkBtn = new QPushButton( tr( "BUT_OK" ), this );
myOkBtn->setObjectName( "buttonOk" );
- myOkBtn->setAutoDefault( TRUE );
- myOkBtn->setDefault( TRUE );
+ myOkBtn->setAutoDefault( true );
+ myOkBtn->setDefault( true );
myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this );
myCancelBtn->setObjectName( "buttonCancel" );
- myCancelBtn->setAutoDefault( TRUE );
+ myCancelBtn->setAutoDefault( true );
topLayout->addWidget( myRangeGrp, 0, 0, 1, 3 );
topLayout->addWidget( myOkBtn, 1, 0 );
#include <qwt_legend_label.h>
#include <qwt_plot_dict.h>
+#include <qdrawutil.h>
+
const int SPACING = 10;
const int SYMBOL_SIZE = 13;
mySymbolType(0),
myPen( QPen() )
{
- myYAxisLeftIcon = yAxisLeft;
- myYAxisRightIcon = yAxisRight;
+ myYAxisLeftIcon = QPixmap(yAxisLeft);
+ myYAxisRightIcon = QPixmap(yAxisRight);
int anIconWidth = qMax( myYAxisLeftIcon.width(), myYAxisRightIcon.width() );
setSpacing( SPACING );
if(hasDeviationData()) {
painter->save();
int lineW = deviationMarkerLineWidth();
- int tickSz = deviationMarkerTickSize() + qRound(lineW/2);
+ int tickSz = deviationMarkerTickSize() + qRound(double(lineW/2));
double min, max, xi, yi;
int xp, ytop, ybtm, tickl, tickr;
QColor c = isSelected() ? Plot2d_Object::selectionColor() : deviationMarkerColor();
{
setModal( true );
setWindowTitle( tr("TLT_SETUP_PLOT2D_VIEW") );
- setSizeGripEnabled( TRUE );
+ setSizeGripEnabled( true );
QGridLayout* topLayout = new QGridLayout( this );
topLayout->setSpacing( SPACING_SIZE );
/* OK/Cancel buttons */
myOkBtn = new QPushButton( tr( "BUT_OK" ), this );
- myOkBtn->setAutoDefault( TRUE );
- myOkBtn->setDefault( TRUE );
+ myOkBtn->setAutoDefault( true );
+ myOkBtn->setDefault( true );
myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this );
- myCancelBtn->setAutoDefault( TRUE );
+ myCancelBtn->setAutoDefault( true );
myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this );
- myHelpBtn->setAutoDefault( TRUE );
+ myHelpBtn->setAutoDefault( true );
QHBoxLayout* btnLayout = new QHBoxLayout;
btnLayout->addWidget( myOkBtn );
btnLayout->addStretch();
#include <QEvent>
#include <QMouseEvent>
#include <QContextMenuEvent>
-#include <QPrinter>
+#include <QtPrintSupport/QPrinter>
#include <QPalette>
#include <QLocale>
#include <QXmlStreamWriter>
#include <stdlib.h>
#include <limits>
-#include <qprinter.h>
+#include <QtPrintSupport/qprinter.h>
#include <qwt_legend.h>
#include <qwt_scale_widget.h>
*/
int Plot2d_ViewFrame::testOperation( const QMouseEvent& me )
{
- int btn = me.button() | me.modifiers();
+ int btn = me.buttons() | me.modifiers();
const int zoomBtn = Qt::ControlModifier | Qt::LeftButton;
const int panBtn = Qt::ControlModifier | Qt::MidButton;
const int fitBtn = Qt::ControlModifier | Qt::RightButton;
}
}
else {
- int btn = me.button() | me.modifiers();
+ int btn = me.buttons() | me.modifiers();
if (btn == Qt::RightButton) {
QMouseEvent* aEvent = new QMouseEvent(QEvent::MouseButtonPress,
me.pos(), me.button(), me.buttons(), me.modifiers() );
#include <QPaintEvent>
#include <QActionGroup>
#include <QPainter>
-#include <QPrinter>
-#include <QPrintDialog>
+#include <QtPrintSupport/QPrinter>
+#include <QtPrintSupport/QPrintDialog>
#include <qwt_plot_curve.h>
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PYTHON_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/SUIT
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS} ${PYTHON_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS} ${PYTHON_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} ${PYTHON_LIBRARIES} qtx suit PyInterp Event)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} ${PYTHON_LIBRARIES} qtx suit PyInterp Event)
# --- headers ---
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS PyConsole EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${PyConsole_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
#include <QTextCursor>
#include <QTextCharFormat>
#include <QRegExp>
+#include <QMimeData>
#include "PyConsole_EnhEditor.h"
#include "PyConsole_EnhInterp.h"
* If the pasted text doesn't contain a line return, no special treatment is done.
* @param source
*/
-void PyConsole_EnhEditor::insertFromMimeData(const QMimeData * source)
+void PyConsole_EnhEditor::insertFromMimeData(const QMimeData* source)
{
if (_multi_line_paste)
return;
virtual void keyPressEvent ( QKeyEvent* event);
virtual void customEvent( QEvent* event);
virtual void mousePressEvent( QMouseEvent* event );
- virtual void insertFromMimeData(const QMimeData * source);
+ virtual void insertFromMimeData(const QMimeData* source);
virtual PyInterp_Request* createTabRequest( const QString& input );
virtual void handleTab();
# Author : Maxim GLIBIN, Open CASCADE S.A.S. (maxim.glibin@opencascade.com)
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_SOURCE_DIR}/src/Qtx
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${PLATFORM_LIBS} ${QT_LIBRARIES} qtx)
+SET(_link_LIBRARIES ${PLATFORM_LIBS} ${_QT_LIBRARIES} qtx)
# --- headers ---
)
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS PyEditor EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${PyEditor_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
aMainLayout->addStretch( 1 );
myOkBtn = new QPushButton( tr( "BUT_OK" ), this );
- myOkBtn->setAutoDefault( TRUE );
- myOkBtn->setDefault( TRUE );
+ myOkBtn->setAutoDefault( true );
+ myOkBtn->setDefault( true );
myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this );
- myCancelBtn->setAutoDefault( TRUE );
+ myCancelBtn->setAutoDefault( true );
myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this );
- myHelpBtn->setAutoDefault( TRUE );
+ myHelpBtn->setAutoDefault( true );
QHBoxLayout* aButtonLayout = new QHBoxLayout;
aButtonLayout->addWidget( myOkBtn );
aButtonLayout->addStretch();
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PYTHON_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src/Event
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS} ${PYTHON_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS} ${PYTHON_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} ${PYTHON_LIBRARIES} Event)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} ${PYTHON_LIBRARIES} Event)
# --- headers ---
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_internal_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
# Author : Maxim GLIBIN, Open CASCADE S.A.S. (maxim.glibin@opencascade.com)
#
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/SUIT
${PROJECT_SOURCE_DIR}/src/PyEditor
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${PLATFORM_LIBS} ${QT_LIBRARIES} qtx suit PyEditor)
+SET(_link_LIBRARIES ${PLATFORM_LIBS} ${_QT_LIBRARIES} qtx suit PyEditor)
# header files / to be processed by moc
SET(_moc_HEADERS
# resource files / to be processed by rcc
SET(_rcc_RESOURCES ${RESOURCES_PATH}/PyEditor.qrc)
-# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
-
-# sources / rcc wrappings
-QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+# --- sources ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ELSE()
+ # sources / moc wrappings
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT5_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS DummyPyEditor EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})
INSTALL(FILES ${PyViewer_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
#include <QtGui>
#include <QLocale>
+#include <QFileDialog>
+#include <QMessageBox>
+#include <QApplication>
/*!
\class PyViewer_ViewWindow
connect( my_TextEditor->document(), SIGNAL( modificationChanged( bool ) ),
this, SLOT( setWindowModified( bool ) ) );
- statusBar()->showMessage( tr("STS_READY") );
+ //statusBar()->showMessage( tr("STS_READY") );
}
}
setCurrentFile( theFilePath );
aFile.close();
- if ( isExternal() )
- statusBar()->showMessage( tr( "STS_F_LOADED" ), 2000 );
+ /*if ( isExternal() )
+ statusBar()->showMessage( tr( "STS_F_LOADED" ), 2000 ); */
}
/*!
setCurrentFile( theFilePath );
aFile.close();
- if ( isExternal() )
- statusBar()->showMessage( tr( "STS_F_SAVED" ), 2000 );
+ /*if ( isExternal() )
+ statusBar()->showMessage( tr( "STS_F_SAVED" ), 2000 ); */
return true;
}
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/DDS
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS} ${CAS_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} ${CAS_KERNEL} qtx DDS)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} ${CAS_KERNEL} qtx DDS)
# --- headers ---
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS QDS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${QDS_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
while ( flag )
{
if ( flags & flag && widget( flag ) )
- widget( flag )->setShown( visible );
+ widget( flag )->setVisible( visible );
flag = flag >> 1;
}
}
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES} ${Qt5Xml_INCLUDES} ${Qt5WebKit_INCLUDES} ${Qt5WebKitWidgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS} ${Qt5Xml_DEFINITIONS} ${Qt5WebKit_DEFINITIONS} ${Qt5WebKitWidgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5Xml_LIBRARIES} ${Qt5WebKit_LIBRARIES} ${Qt5WebKitWidgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
-INCLUDE_DIRECTORIES(${QT_INCLUDES})
+INCLUDE_DIRECTORIES(${_QT_INCLUDES})
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} ${OPENGL_LIBRARIES})
+SET(_link_LIBRARIES ${_QT_LIBRARIES} ${OPENGL_LIBRARIES})
# --- headers ---
)
# --- sources ---
-
-# sources / rcc wrappings
-QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
-
-# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ELSE()
+ # sources / moc wrappings
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT5_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS qtx EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${qtx_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
if ( pos != -1 )
{
int i = 1;
- while ( i <= rx.numCaptures() && varName.isEmpty() )
+ while ( i <= rx.captureCount() && varName.isEmpty() )
{
QString capStr = rx.cap( i );
if ( !capStr.contains( "%" ) && !capStr.contains( "$" ) )
int end = start + varName.length();
if ( capIdx > 1 && rx.cap( capIdx - 1 ).contains( QRegExp( "\\$|%" ) ) )
start = rx.pos( capIdx - 1 ) + rx.cap( capIdx - 1 ).indexOf( QRegExp( "\\$|%" ) );
- if ( capIdx < rx.numCaptures() && !rx.cap( capIdx - 1 ).isEmpty() )
+ if ( capIdx < rx.captureCount() && !rx.cap( capIdx - 1 ).isEmpty() )
end++;
len = end - start;
}
{
QImage res = img;
- int colNum = res.numColors();
+ int colNum = res.colorCount();
if ( colNum )
{
for ( int i = 0; i < colNum; i++ )
QtxAction* newAct = new QtxAction( strValue( attr, tooltip ), set,
strValue( attr, label ),
- QKeySequence( strValue( attr, accel ) ),
+ QKeySequence( strValue( attr, accel ) )[0],
myMgr );
newAct->setToolTip( strValue( attr, tooltip ) );
QString toggleact = strValue( attr, toggle );
#include <QFile>
#include <QTimer>
#ifndef QT_NO_DOM
-#include <QDomDocument>
-#include <QDomNode>
+#include <QtXml/QDomDocument>
+#include <QtXml/QDomNode>
#include <QCoreApplication>
#endif
QString pattern = title.toLower();
QToolBar* res = 0;
- QList<QToolBar*> toolbars = qFindChildren<QToolBar*>( mw );
+ QList<QToolBar*> toolbars = mw->findChildren<QToolBar*>( );
for ( QList<QToolBar*>::iterator it = toolbars.begin(); it != toolbars.end() && !res; ++it )
{
if ( (*it)->windowTitle().toLower() == pattern )
set = QIcon( pix );
QtxAction* newAct = new QtxAction( strValue( attr, tooltip ), set, strValue( attr, label ),
- QKeySequence( strValue( attr, accel ) ), myMgr );
+ QKeySequence( strValue( attr, accel ) )[0], myMgr );
QString toggleact = strValue( attr, toggle );
newAct->setCheckable( !toggleact.isEmpty() );
newAct->setChecked( toggleact.toLower() == "true" );
*/
void QtxColorButton::updateState()
{
- QList<QToolButton*> bList = qFindChildren<QToolButton*>( menu() );
+ QList<QToolButton*> bList = menu()->findChildren<QToolButton*>();
for ( QList<QToolButton*>::iterator cit = bList.begin(); cit != bList.end(); ++cit )
updateButton( *cit );
}
if ( e->key() == Qt::Key_Tab && e->modifiers() & Qt::ControlModifier )
{
- QObject* tab = qFindChild<QTabWidget*>( this );
+ QObject* tab = this->findChild<QTabWidget*>( );
if ( tab && !property( "in_tab_event" ).toBool() ) {
setProperty( "in_tab_event", true );
QApplication::sendEvent( tab, e );
void QtxDialog::emitSignal()
{
QApplication::instance()->processEvents();
- QApplication::syncX();
int id = buttonId( (QAbstractButton*)mySender );
mySender = 0;
if ( !mw )
return;
- QList<QToolBar*> toolbars = qFindChildren<QToolBar*>( mw );
+ QList<QToolBar*> toolbars = mw->findChildren<QToolBar*>( );
for ( QList<QToolBar*>::iterator it = toolbars.begin(); it != toolbars.end(); ++it )
{
QToolBar* tb = *it;
if ( !mw )
return;
- QList<QDockWidget*> dockwidgets = qFindChildren<QDockWidget*>( mw );
+ QList<QDockWidget*> dockwidgets = mw->findChildren<QDockWidget*>( );
for ( QList<QDockWidget*>::iterator it = dockwidgets.begin(); it != dockwidgets.end(); ++it )
{
QDockWidget* dw = *it;
myMode = mode;
- myFamily->setShown( myMode == Native );
- myCustomFams->setShown( myMode == Custom );
+ myFamily->setVisible( myMode == Native );
+ myCustomFams->setVisible( myMode == Custom );
updateGeometry();
}
if ( o != menuBar() )
return false;
- if ( e->type() == QEvent::MenubarUpdated || e->type() == QEvent::Resize )
+ if ( /*e->type() == QEvent::MenubarUpdated || */e->type() == QEvent::Resize )
updateCorner();
if ( e->type() == QEvent::ChildAdded || e->type() == QEvent::ChildRemoved )
myMain->layout()->removeEventFilter( this );
}
- QTimer* t = qFindChild<QTimer*>( myMain->layout() );
+ QTimer* t = myMain->layout()->findChild<QTimer*>( );
if ( t ) {
if ( on )
t->installEventFilter( this );
{
QStringList fList = prepareFilters( entry.filter );
if ( !fList.isEmpty() )
- entry.dlg->setFilters( fList );
+ entry.dlg->setNameFilters( fList );
}
entry.dlg->selectFile( fileName( id ) );
return;
if ( Qtx::extension( fName ).isEmpty() && !isDir )
- fName = autoExtension( fName, entry.dlg->selectedFilter() );
+ fName = autoExtension( fName, entry.dlg->selectedNameFilter() );
- fName = QDir::convertSeparators( fName );
- QString prev = QDir::convertSeparators( fileName( id ) );
+ fName = QDir::toNativeSeparators( fName );
+ QString prev = QDir::toNativeSeparators( fileName( id ) );
if ( isDir )
{
while ( prev.length() && prev.at( prev.length() - 1 ) == QDir::separator() )
ext = ext.mid( ext.indexOf( "." ) + 1 );
if ( !ext.isEmpty() && !ext.contains( "*" ) )
- fName = QDir::convertSeparators( fName ) + QString( "." ) + ext;
+ fName = QDir::toNativeSeparators( fName ) + QString( "." ) + ext;
}
return fName;
}
if ( !path.isEmpty() )
- myPath->setText( QDir::convertSeparators( path ) );
+ myPath->setText( QDir::toNativeSeparators( path ) );
myPath->setFocus();
for ( ; anIt1 != aLast1 && anIt2 != aLast2; anIt1++, anIt2++ )
{
if ( (*anIt1) != (*anIt2) )
- return (*anIt1)<(*anIt2);
+ return (*anIt1)<=(*anIt2);
}
return anIt1 == aLast1 && anIt2 != aLast2;
}
}
}
return t1 < t2;
-}
+}
/*!
\class QtxPopupMgr::PopupCreator
}
QString actLabel = strValue( attr, label );
+ QKeySequence seq = QKeySequence( strValue( attr, accel ) );
QtxAction* newAct = new QtxAction( strValue( attr, tooltip ), set, actLabel,
- QKeySequence( strValue( attr, accel ) ),
+ seq[0],
myMgr );
newAct->setToolTip( strValue( attr, tooltip ) );
QString toggleact = strValue( attr, toggle );
*/
void QtxPreferenceItem::setIcon( const QIcon& ico )
{
- if ( myIcon.serialNumber() == ico.serialNumber() )
+ if ( myIcon.cacheKey() == ico.cacheKey() )
return;
myIcon = ico;
#include <QLibraryInfo>
#include <QtDebug>
#ifndef QT_NO_DOM
-#include <QDomDocument>
-#include <QDomElement>
-#include <QDomNode>
+#include <QtXml/QDomDocument>
+#include <QtXml/QDomElement>
+#include <QtXml/QDomNode>
#endif
#include <stdlib.h>
}
if( !path.isEmpty() )
{
- QString fname = QDir::convertSeparators( path );
+ QString fname = QDir::toNativeSeparators( path );
QFileInfo inf( fname );
fname = inf.absoluteFilePath();
return fname;
QTranslator* QtxResourceMgr::Resources::loadTranslator( const QString& sect, const QString& prefix, const QString& name ) const
{
QTranslator* trans = new QtxTranslator( 0 );
- QString fname = QDir::convertSeparators( fileName( sect, prefix, name ) );
+ QString fname = QDir::toNativeSeparators( fileName( sect, prefix, name ) );
if ( !trans->load( Qtx::file( fname, false ), Qtx::dir( fname ) ) )
{
delete trans;
}
else if ( section == "import" )
{
- QString impFile = QDir::convertSeparators( Qtx::makeEnvVarSubst( data, Qtx::Always ) );
+ QString impFile = QDir::toNativeSeparators( Qtx::makeEnvVarSubst( data, Qtx::Always ) );
QFileInfo impFInfo( impFile );
if ( impFInfo.isRelative() )
impFInfo.setFile( aFinfo.absoluteDir(), impFile );
}
else if ( sectElem.tagName() == importTag() && sectElem.hasAttribute( nameAttribute() ) )
{
- QString impFile = QDir::convertSeparators( Qtx::makeEnvVarSubst( sectElem.attribute( nameAttribute() ), Qtx::Always ) );
+ QString impFile = QDir::toNativeSeparators( Qtx::makeEnvVarSubst( sectElem.attribute( nameAttribute() ), Qtx::Always ) );
QFileInfo impFInfo( impFile );
if ( impFInfo.isRelative() )
impFInfo.setFile( aFinfo.absoluteDir(), impFile );
myModWidget_layout->setMargin( 0 );
myClose = new QToolButton( myBtnWidget );
- myClose->setIcon( QIcon( close_xpm ) );
+ myClose->setIcon( QIcon( QPixmap( close_xpm ) ) );
myClose->setAutoRaise( true );
myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myClose ) );
connect( myClose, SIGNAL( clicked() ), this, SLOT( hide() ) );
myData->installEventFilter( this );
myToFirst = new QToolButton( myBtnWidget );
- myToFirst->setIcon( QIcon( first_xpm ) );
+ myToFirst->setIcon( QIcon( QPixmap( first_xpm ) ) );
myToFirst->setAutoRaise( true );
myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myToFirst ), 0 );
connect( myToFirst, SIGNAL( clicked() ), this, SLOT( findFirst() ) );
myToFirst->installEventFilter( this );
myPrev = new QToolButton( myBtnWidget );
- myPrev->setIcon( QIcon( prev_xpm ) );
+ myPrev->setIcon( QIcon( QPixmap( prev_xpm ) ) );
myPrev->setAutoRaise( true );
myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myPrev ), 0 );
connect( myPrev, SIGNAL( clicked() ), this, SLOT( findPrevious() ) );
myPrev->installEventFilter( this );
myNext = new QToolButton( myBtnWidget );
- myNext->setIcon( QIcon( next_xpm ) );
+ myNext->setIcon( QIcon( QPixmap( next_xpm ) ) );
myNext->setAutoRaise( true );
myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myNext ), 0 );
connect( myNext, SIGNAL( clicked() ), this, SLOT( findNext() ) );
myNext->installEventFilter( this );
myToLast = new QToolButton( myBtnWidget );
- myToLast->setIcon( QIcon( last_xpm ) );
+ myToLast->setIcon( QIcon( QPixmap( last_xpm ) ) );
myToLast->setAutoRaise( true );
myBtnWidget_layout->addWidget( wrapWidget( myBtnWidget, myToLast ), 0 );
connect( myToLast, SIGNAL( clicked() ), this, SLOT( findLast() ) );
\param comment message comment (optional)
\return Translated text if found or \a sourceText otherwise
*/
-QString QtxTranslator::translate( const char* context, const char* sourceText, const char* comment ) const
+QString QtxTranslator::translate( const char* context, const char* sourceText, const char* comment, int n ) const
{
- QString res = QTranslator::translate( context, sourceText, comment );
+ QString res = QTranslator::translate( context, sourceText, comment, n );
if( res.isNull() )
- res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, comment );
+ res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, comment, n );
return res;
}
public:
QtxTranslator( QObject* parent = 0 );
~QtxTranslator();
- virtual QString translate( const char*, const char*, const char* = 0 ) const;
+ virtual QString translate( const char*, const char*, const char* = 0, int n = -1 ) const;
};
#endif
QVariant appropriate = model()->headerData( i, orientation(), Qtx::AppropriateRole );
QIcon icon;
if ( iconData.isValid() ) {
- if ( qVariantCanConvert<QIcon>( iconData ) )
- icon = qVariantValue<QIcon>( iconData );
- else if ( qVariantCanConvert<QPixmap>( iconData ) )
- icon = qVariantValue<QPixmap>( iconData );
+ if ( iconData.canConvert( QMetaType::QIcon ) )
+ icon = iconData.value<QIcon>();
+ else if ( iconData.canConvert( QMetaType::QPixmap ) )
+ icon = iconData.value<QPixmap>();
}
if( ( !lab.isEmpty() || !icon.isNull() ) &&
appropriate.isValid() ? appropriate.toInt()==Qtx::Toggled : true )
}
else if ( a && a == sortAction ) {
setSortIndicatorShown( a->isChecked() );
- setClickable( a->isChecked() );
+ setSectionsClickable( a->isChecked() );
QtxTreeView* view = qobject_cast<QtxTreeView*>( parent() );
if ( view ) {
view->emitSortingEnabled( a->isChecked() );
: QTreeView( parent )
{
setHeader( new Header( false, this ) );
- header()->setMovable( true );
+ header()->setSectionsMovable( true );
}
/*!
: QTreeView( parent )
{
setHeader( new Header( enableSortMenu, this ) );
- header()->setMovable( true );
+ header()->setSectionsMovable( true );
}
/*!
#include <QStatusBar>
#include <QToolBar>
#include <QVBoxLayout>
-#include <QWebView>
+#include <QtWebKit/QWebView>
#include <QProcess>
namespace
//
#include "QtxWorkspace.h"
-#include <QWidgetList>
+#include <QMdiSubWindow>
/*!
\class QtxWorkspace
\param parent parent widget
*/
QtxWorkspace::QtxWorkspace( QWidget* parent )
-: QWorkspace( parent )
+: QMdiArea( parent )
{
}
*/
void QtxWorkspace::tileVertical()
{
- QWidgetList winList = windowList();
+ QList<QMdiSubWindow *> winList = subWindowList();
if ( winList.isEmpty() )
return;
int count = 0;
- for ( QWidgetList::const_iterator itr = winList.begin(); itr != winList.end(); ++itr )
+ for ( QList<QMdiSubWindow *>::const_iterator itr = winList.begin(); itr != winList.end(); ++itr )
if ( !( (*itr)->windowState() & Qt::WindowMinimized ) )
count++;
if ( !count )
return;
- if ( activeWindow() && ( activeWindow()->windowState() & Qt::WindowMaximized ) )
- activeWindow()->showNormal();
+ if ( activeSubWindow() && ( activeSubWindow()->windowState() & Qt::WindowMaximized ) )
+ activeSubWindow()->showNormal();
int y = 0;
int heightForEach = height() / count;
- for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it )
+ for ( QList<QMdiSubWindow *>::iterator it = winList.begin(); it != winList.end(); ++it )
{
QWidget* win = *it;
if ( win->windowState() & Qt::WindowMinimized )
*/
void QtxWorkspace::tileHorizontal()
{
- QWidgetList winList = windowList();
+ QList<QMdiSubWindow *> winList = subWindowList();
if ( winList.isEmpty() )
return;
int count = 0;
- for ( QWidgetList::const_iterator itr = winList.begin(); itr != winList.end(); ++itr )
+ for ( QList<QMdiSubWindow *>::const_iterator itr = winList.begin(); itr != winList.end(); ++itr )
if ( !( (*itr)->windowState() & Qt::WindowMinimized ) )
count++;
if ( !count )
return;
- if ( activeWindow() && activeWindow()->windowState() & Qt::WindowMaximized )
- activeWindow()->showNormal();
+ if ( activeSubWindow() && activeSubWindow()->windowState() & Qt::WindowMaximized )
+ activeSubWindow()->showNormal();
int x = 0;
int widthForEach = width() / count;
- for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it )
+ for ( QList<QMdiSubWindow *>::iterator it = winList.begin(); it != winList.end(); ++it )
{
QWidget* win = *it;
if ( win->windowState() & Qt::WindowMinimized )
#include "Qtx.h"
-#include <QWorkspace>
+#include <QMdiArea>
#ifdef WIN32
#pragma warning( disable:4251 )
#endif
-class QTX_EXPORT QtxWorkspace : public QWorkspace
+class QTX_EXPORT QtxWorkspace : public QMdiArea
{
Q_OBJECT
#include "QtxWorkspace.h"
#include <QMenu>
-#include <QWidgetList>
+#include <QMdiSubWindow>
/*!
\class QtxWorkspaceAction
{
int a = 0;
if ( action( id ) )
- a = action( id )->shortcut();
+ a = action( id )->shortcut()[0];
return a;
}
{
QtxWorkspace* ws = workspace();
if ( ws )
- ws->tile();
+ ws->tileSubWindows();
}
/*!
if ( !ws )
return;
- ws->cascade();
+ ws->cascadeSubWindows();
int w = ws->width();
int h = ws->height();
- QWidgetList winList = ws->windowList();
- for ( QWidgetList::iterator it = winList.begin(); it != winList.end(); ++it )
+ QList<QMdiSubWindow *> winList = ws->subWindowList();
+ for ( QList<QMdiSubWindow *>::iterator it = winList.begin(); it != winList.end(); ++it )
(*it)->resize( int( w * 0.8 ), int( h * 0.8 ) );
}
*/
void QtxWorkspaceAction::updateContent()
{
- bool count = workspace() ? workspace()->windowList().count() : 0;
+ bool count = workspace() ? workspace()->subWindowList().count() : 0;
action( Cascade )->setEnabled( count );
action( Tile )->setEnabled( count );
action( HTile )->setEnabled( count );
if ( menuActions() & Windows )
{
int index = 1;
- QWidgetList wList = ws->windowList();
- for ( QWidgetList::iterator it = wList.begin(); it != wList.end(); ++it, index++ )
+ QList<QMdiSubWindow *> wList = ws->subWindowList();
+ for ( QList<QMdiSubWindow *>::iterator it = wList.begin(); it != wList.end(); ++it, index++ )
{
QWidget* wid = *it;
QAction* a = new QtxAction( wid->windowTitle(), wid->windowTitle(), 0, this, true );
- a->setChecked( wid == ws->activeWindow() );
+ a->setChecked( wid == ws->activeSubWindow() );
items.append( a );
map.insert( a, Windows + index );
}
if ( !ws )
return;
- QWidgetList wList = ws->windowList();
+ QList<QMdiSubWindow *> wList = ws->subWindowList();
if ( idx >= 0 && idx < (int)wList.count() )
wList.at( idx )->setFocus();
}
{
int res = 0;
if ( myActionsMap.contains( id ) )
- res = myActionsMap[id]->shortcut();
+ res = myActionsMap[id]->shortcut()[0];
return res;
}
for ( QWidgetList::iterator itr = moveList.begin(); itr != moveList.end(); ++itr )
{
(*itr)->setParent( pWid );
- (*itr)->setShown( map.contains( *itr ) ? map[*itr] : false );
+ (*itr)->setVisible( map.contains( *itr ) ? map[*itr] : false );
}
}
{
int a = 0;
if ( action( id ) )
- a = action( id )->shortcut();
+ a = action( id )->shortcut()[0];
return a;
}
// Buttons for possibility of switching the variants of split
myButtonPrevious = new QPushButton( this );
- myButtonPrevious->setIcon( QIcon( prev_xpm ) );
+ myButtonPrevious->setIcon( QIcon( QPixmap( prev_xpm ) ) );
myButtonPrevious->setAutoDefault(true);
myButtonPrevious->setEnabled( false );
myButtonNext = new QPushButton( this );
- myButtonNext->setIcon( QIcon( next_xpm ) );
+ myButtonNext->setIcon( QIcon( QPixmap( next_xpm ) ) );
myButtonNext->setAutoDefault(true);
myButtonNext->setEnabled( false );
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/SUIT
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} qtx suit)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} qtx suit)
# --- headers ---
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS QxScene EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${QxScene_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
#
# --- options ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/SUIT
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} qtx suit)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} qtx suit)
# --- rules ---
INCLUDE(${VTK_USE_FILE})
# --- options ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PYTHON_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/src/CAM
${PROJECT_SOURCE_DIR}/src/Event
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
${CAS_DEFINITIONS}
- ${QT_DEFINITIONS}
+ ${_QT_DEFINITIONS}
${PYTHON_DEFINITIONS}
)
# libraries to link to
SET(_link_LIBRARIES
${PYTHON_LIBRARIES}
- ${QT_LIBRARIES}
+ ${_QT_LIBRARIES}
${OPENGL_LIBRARIES}
${VTK_LIBRARIES}
LightApp
ENDIF()
# --- options ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${SIP_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS}
${PTHREAD_INCLUDE_DIR}
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
- ${QT_DEFINITIONS}
+ ${_QT_DEFINITIONS}
${CAS_DEFINITIONS}
${PYTHON_DEFINITIONS}
${BOOST_DEFINITIONS}
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES SALOME_PYQT_Module.cxx)
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UsePyQt4)
+INCLUDE(UsePyQt)
IF(SALOME_USE_VTKVIEWER)
INCLUDE(${VTK_USE_FILE})
ENDIF()
# --- options ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${SIP_INCLUDE_DIR}
${PYTHON_INCLUDE_DIRS}
${PTHREAD_INCLUDE_DIR}
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
- ${QT_DEFINITIONS}
+ ${_QT_DEFINITIONS}
${CAS_DEFINITIONS}
${PYTHON_DEFINITIONS}
)
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / sip wrappings
-PYQT4_WRAP_SIP(_sip_SOURCES ${_sip_files})
+PYQT_WRAP_SIP(_sip_SOURCES ${_sip_files})
# sources / static
SET(_other_SOURCES
%Module SalomePyQtGUILight
-%Import QtGuimod.sip
+%Import QtGui/QtGuimod.sip
+%Import QtCore/QtCoremod.sip
+%Import QtWidgets/QtWidgetsmod.sip
%Import QtXmlmod.sip
icon, // icon
label, // menu text
tooltip, // status-bar text
- QKeySequence( accel ), // keyboard accelerator
+ QKeySequence( accel )[0], // keyboard accelerator
module(), // action owner
toggle ); // toogled action
myHelper->connectAction( action );
icon, // icon
label, // menu text
tooltip, // status-bar text
- QKeySequence( accel ), // keyboard accelerator
+ QKeySequence( accel )[0], // keyboard accelerator
module(), // action owner
toggle ); // toogled action
myHelper->connectAction( action );
icon, // icon
label, // menu text
tooltip, // status-bar text
- QKeySequence( accel ), // keyboard accelerator
+ QKeySequence( accel )[0], // keyboard accelerator
module(), // action owner
toggle ); // toogled action
myHelper->connectAction( action );
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UsePyQt4)
+INCLUDE(UsePyQt)
IF(SALOME_USE_VTKVIEWER)
INCLUDE(${VTK_USE_FILE})
ENDIF()
# --- options ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${QWT_INCLUDE_DIR}
${SIP_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
${QWT_DEFINITIONS}
- ${QT_DEFINITIONS}
+ ${_QT_DEFINITIONS}
${CAS_DEFINITIONS}
${BOOST_DEFINITIONS}
${PYTHON_DEFINITIONS}
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / sip wrappings
-PYQT4_WRAP_SIP(_sip_SOURCES ${_sip_files})
+PYQT_WRAP_SIP(_sip_SOURCES ${_sip_files})
# sources / static
SET(_other_SOURCES SalomePyQt.cxx)
PyModuleHelper* getPythonHelper()
{
LightApp_Module* module = getActiveModule();
- PyModuleHelper* helper = module ? qFindChild<PyModuleHelper*>( module, "python_module_helper" ) : 0;
+ PyModuleHelper* helper = module ? module->findChild<PyModuleHelper*>( "python_module_helper" ) : 0;
return helper;
}
myResult = (QAction*)module->createAction( myId, myTipText, icon, myMenuText, myStatusText, myKey, module, myToggle );
}
// for Python module, automatically connect action to callback slot
- PyModuleHelper* helper = qFindChild<PyModuleHelper*>( module, "python_module_helper" );
+ PyModuleHelper* helper = module->findChild<PyModuleHelper*>( "python_module_helper" );
if ( helper ) helper->connectAction( myResult );
}
}
// specific processing for ParaView viewer:
// hierarchy of ParaView viewer is much complex than for usual view;
// we look for sub-widget named "Viewport"
- QList<QWidget*> lst = qFindChildren<QWidget*>( wnd, "Viewport" );
+ QList<QWidget*> lst = wnd->findChildren<QWidget*>( "Viewport" );
if ( !lst.isEmpty() ) {
lst[0]->resize( myWndWidth, myWndHeight );
myResult = true;
QWidget* wnd = viewMgr->getActiveView();
myResult = viewMgr->getActiveView()->getId();
if ( wnd ) {
- wnd->setShown(myVisible);
+ wnd->setVisible(myVisible);
if ( !myVisible && myWidth == 0 && myHeight == 0 ) {
myWidth = 1024;
myHeight = 768;
%Feature ENABLE_CORBA
%Feature ENABLE_PLOT2D
-%Import QtGuimod.sip
+%Import QtGui/QtGuimod.sip
+%Import QtCore/QtCoremod.sip
+%Import QtWidgets/QtWidgetsmod.sip
%Import QtXmlmod.sip
%If (ENABLE_PLOT2D)
ENDIF()
# --- options ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
${PYTHON_INCLUDE_DIRS}
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${QWT_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/src/CAM
SET_SOURCE_FILES_PROPERTIES(libSALOME_SwigPYTHON_wrap.cxx PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H")
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS} ${QWT_DEFINITIONS} ${CAS_DEFINITIONS} ${PYTHON_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS} ${QWT_DEFINITIONS} ${CAS_DEFINITIONS} ${PYTHON_DEFINITIONS})
# --- headers ---
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
# --- options ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/SUIT
${PROJECT_SOURCE_DIR}/src/OBJECT
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${OGL_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS} ${CAS_DEFINITIONS} ${OGL_DEFINITIONS})
# libraries to link to
SET(_link_LIBRARIES
- ${QT_LIBRARIES} ${CAS_KERNEL} ${CAS_VIEWER}
+ ${_QT_LIBRARIES} ${CAS_KERNEL} ${CAS_VIEWER}
qtx suit SalomeObject SalomePrs OCCViewer
)
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
# --- options ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${QWT_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/SUIT
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS} ${QWT_DEFINITIONS} ${CAS_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS} ${QWT_DEFINITIONS} ${CAS_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} ${QWT_LIBRARY} qtx suit Plot2d SalomePrs SalomeObject)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} ${QWT_LIBRARY} qtx suit Plot2d SalomePrs SalomeObject)
# --- headers ---
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/SUIT
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} qtx suit)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} qtx suit)
# --- headers ---
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS std EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${std_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
{
SUIT_ViewWindow* wnd = 0;
- QWidget* wid = myWorkspace->activeWindow();
+ QWidget* wid = (QWidget*)myWorkspace->activeSubWindow();
if ( wid && wid->inherits( "SUIT_ViewWindow" ) )
wnd = (SUIT_ViewWindow*)wid;
{
QList<SUIT_ViewWindow*> winList;
- QWidgetList children = myWorkspace->windowList();
- for ( QWidgetList::iterator it = children.begin(); it != children.end(); ++it )
+ QList<QMdiSubWindow *> children = myWorkspace->subWindowList();
+ for ( QList<QMdiSubWindow *>::iterator it = children.begin(); it != children.end(); ++it )
{
- SUIT_ViewWindow* vw = ::qobject_cast<SUIT_ViewWindow*>( *it );
+ SUIT_ViewWindow* vw = ::qobject_cast<SUIT_ViewWindow*>( (QWidget*)(*it) );
if ( vw )
winList.append( vw );
}
if ( !w || !workspace() )
return;
- workspace()->addWindow( w );
+ workspace()->addSubWindow( w );
}
/*!Call method perform for operation \a type.*/
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/ObjBrowser
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
IF(ENABLE_TESTRECORDER)
ADD_DEFINITIONS("-DENABLE_TESTRECORDER ${TESTRECORDER_DEFINITIONS}")
ENDIF()
# libraries to link to
-SET(_link_LIBRARIES ${PLATFORM_LIBS} ${QT_LIBRARIES} qtx ObjBrowser)
+SET(_link_LIBRARIES ${PLATFORM_LIBS} ${_QT_LIBRARIES} qtx ObjBrowser)
IF(ENABLE_TESTRECORDER)
LIST(APPEND _link_LIBRARIES ${TESTRECORDER_LIBS})
ENDIF()
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS suit EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${suit_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
const QString& menuText, QKeySequence accel,
QObject* parent, bool toggle )
{
- setAction( new QtxAction( text, icon, menuText, accel, parent, toggle ) );
+ setAction( new QtxAction( text, icon, menuText, accel[0], parent, toggle ) );
}
/*!Set action.
void SUIT_ActionOperation::setAction( const QString& text, const QString& menuText,
QKeySequence accel, QObject* parent, bool toggle )
{
- setAction( new QtxAction( text, menuText, accel, parent, toggle ) );
+ setAction( new QtxAction( text, menuText, accel[0], parent, toggle ) );
}
/*!Set action.
*/
int SUIT_DataBrowser::shortcutKey(const int id) const
{
- return myShortcutMap.value(id)->key();
+ return myShortcutMap.value(id)->key()[0];
}
/*!
wid->testAttribute( Qt::WA_WState_Hidden );
addWindow( wid );
- wid->setShown( !invis );
+ wid->setVisible( !invis );
}
}
setWindowIcon( parent->windowIcon() );
// GDD
- myUrls.insert(0,QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::ApplicationsLocation)));
- myUrls.insert(0,QUrl::fromLocalFile(QDesktopServices::storageLocation(QDesktopServices::HomeLocation)));
+ myUrls.insert(0,QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation)));
+ myUrls.insert(0,QUrl::fromLocalFile(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)));
setSidebarUrls(myUrls);
// add quick directories widgets
return fileName;
QRegExp r( QString::fromLatin1("\\(?[a-zA-Z0-9.*? +;#|]*\\)?$") );
- int index = r.indexIn( selectedFilter().trimmed() );
+ int index = r.indexIn( selectedNameFilter().trimmed() );
if ( QFileInfo( fileName ).exists() )
return fileName; // if file exists return as is
// Due to transformations from the filter list (*.txt *.*xx *.c++ SUIT*.* ) we
// will have the pattern (\.txt|\..*xx|\.c\+\+|\..*) (as we validate extension only,
// we remove everything except extension mask from the pattern
- QString wildcard = selectedFilter().mid( index, r.matchedLength() ).trimmed();
+ QString wildcard = selectedNameFilter().mid( index, r.matchedLength() ).trimmed();
// replace '|' and ';' separators by space symbol and also brackets if there are some
wildcard.replace( QRegExp( "[\\|;|(|)]" )," " );
*/
void SUIT_FileDlg::addFilter( const QString& filter )
{
- QStringList flist = filters();
+ QStringList flist = nameFilters();
if ( !flist.contains( filter ) ) {
flist << filter;
- setFilters( flist );
+ setNameFilters( flist );
}
- selectFilter( filter );
+ selectNameFilter( filter );
}
/*!
tmpfilename = tmpfilename.replace(QRegExp("\\*"), "" ).replace(QRegExp("\\?"), "" );
if ( filters.isEmpty() )
- fd.setFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*)
+ fd.setNameFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*)
else
- fd.setFilters( filters );
+ fd.setNameFilters( filters );
if ( !caption.isEmpty() )
fd.setWindowTitle( caption );
fd.setFileMode( ExistingFiles );
if ( filters.isEmpty() )
- fd.setFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*)
+ fd.setNameFilter( tr( "ALL_FILES_FILTER" ) ); // All files (*)
else
- fd.setFilters( filters );
+ fd.setNameFilters( filters );
if ( !caption.isEmpty() )
fd.setWindowTitle( caption );
#include <QPushButton>
#include <QTextStream>
#include <QFile>
-#include <QPrinter>
+#include <QtPrintSupport/QPrinter>
//#include <QSimpleRichText>
#include <QTextDocument>
#include <QPainter>
// Try config file, given in arguments
for (int i = 1; i < arguments.count(); i++) {
QRegExp rx ("--resources=(.+)");
- if ( rx.indexIn( arguments[i] ) >= 0 && rx.numCaptures() > 0 ) {
+ if ( rx.indexIn( arguments[i] ) >= 0 && rx.captureCount() > 0 ) {
QString file = rx.cap(1);
QFileInfo fi (file);
pathName = fi.absoluteFilePath();
int n = myColumns.size();
myColumns.resize( n+1 );
myColumns[n] = inf;
- reset();
+ //reset();
}
}
myColumns[i].myIds.remove( group_id );
if ( myColumns[i].myIds.isEmpty() ) {
myColumns.remove( i );
- reset();
+ //reset();
}
break;
}
myRoot = r;
//initialize();
- reset();
+ //reset();
emit modelUpdated();
}
void SUIT_ViewManager::setShown( const bool on )
{
for ( int i = 0; i < myViews.count(); i++ )
- myViews.at( i )->setShown( on );
+ myViews.at( i )->setVisible( on );
}
/*!Emit on \a theEvent mouse pressed in \a theView.*/
SUIT_Application* app = SUIT_Session::session()->activeApplication();
if ( app ) {
SUIT_Desktop* d = app->desktop();
- QList<SUIT_ViewWindow*> allViews = qFindChildren<SUIT_ViewWindow*>( d );
+ QList<SUIT_ViewWindow*> allViews = d->findChildren<SUIT_ViewWindow*>();
foreach( SUIT_ViewWindow* vw, allViews ) {
if ( !vw || vw == this ) continue; // skip invalid views and this one
SUIT_CameraProperties otherProps = vw->cameraProperties();
SUIT_Desktop* d = app->desktop();
if ( !d ) return;
- QList<SUIT_ViewWindow*> allViews = qFindChildren<SUIT_ViewWindow*>( d );
+ QList<SUIT_ViewWindow*> allViews = d->findChildren<SUIT_ViewWindow*>();
foreach( SUIT_ViewWindow* vw, allViews ) {
if ( !vw->cameraProperties().isValid() )
continue; // omit views not supporting camera properties
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT__INCLUDES}
${PYTHON_INCLUDE_DIRS}
${PTHREAD_INCLUDE_DIR}
${PROJECT_BINARY_DIR}
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS} ${PYTHON_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS} ${PYTHON_DEFINITIONS})
IF(ENABLE_TESTRECORDER)
ADD_DEFINITIONS("-DENABLE_TESTRECORDER ${TESTRECORDER_DEFINITIONS}")
ENDIF()
# libraries to link to
-SET(_link_LIBRARIES ${PLATFORM_LIBS} ${QT_LIBRARIES} qtx suit SalomeStyle)
+SET(_link_LIBRARIES ${PLATFORM_LIBS} ${_QT_LIBRARIES} qtx suit SalomeStyle)
IF(SALOME_USE_PYCONSOLE)
LIST(APPEND _link_LIBRARIES ${PYTHON_LIBRARIES})
ENDIF()
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS TestSUITApp EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})
INSTALL(FILES ${SUITApp_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
//Set a "native" graphic system in case if application runs on the remote host
QString remote(::getenv("REMOTEHOST"));
QString client(::getenv("SSH_CLIENT"));
- if(remote.length() > 0 || client.length() > 0 ) {
+ /*if(remote.length() > 0 || client.length() > 0 ) {
QApplication::setGraphicsSystem(QLatin1String("native"));
- }
+ }*/
SUITApp_Application app( argc, argv );
QString cfgAppName = getAppName( argList.isEmpty() ? QString() : argList.first() );
#ifdef ENABLE_TESTRECORDER
: TestApplication( argc, argv ),
#else
-#ifndef WIN32
+//#ifndef WIN32
// san: Opening an X display and choosing a visual most suitable for 3D visualization
// in order to make SALOME viewers work with non-native X servers
- : QApplication( (Display*)Qtx::getDisplay(), argc, argv, Qtx::getVisual() ),
-#else
+ // : QApplication( (Display*)Qtx::getDisplay(), argc, argv, Qtx::getVisual() ),
+//#else
: QApplication( argc, argv ),
-#endif
+//#endif
#endif
myExceptHandler( hand )
{
/*!
Constructor
*/
-SUITApp_Application::SUITApp_Application( int& argc, char** argv, Type type, SUIT_ExceptionHandler* hand )
+/*SUITApp_Application::SUITApp_Application( int& argc, char** argv, Type type, SUIT_ExceptionHandler* hand )
#ifdef ENABLE_TESTRECORDER
: TestApplication( argc, argv ),
#else
myExceptHandler( hand )
{
}
-
+*/
/*!
Sends event to receiver
\return the value that is returned from the receiver's event handler
public:
SUITApp_Application( int& argc, char** argv, SUIT_ExceptionHandler* = 0 );
- SUITApp_Application( int& argc, char** argv, Type type, SUIT_ExceptionHandler* = 0 );
+ //SUITApp_Application( int& argc, char** argv, Type type, SUIT_ExceptionHandler* = 0 );
virtual bool notify( QObject* receiver, QEvent* e );
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
INCLUDE(${VTK_USE_FILE})
# --- options ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES} ${Qt5X11Extras_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS} ${Qt5X11Extras_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5X11Extras_LIBRARIES})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${Boost_INCLUDE_DIRS}
${PTHREAD_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/src/Qtx
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS})
# libraries to link to
SET(_link_LIBRARIES
- ${QT_LIBRARIES}
+ ${_QT_LIBRARIES}
${OPENGL_LIBRARIES}
- ${VTK_LIBRARIES}
+ ${VTK_LIBRARIES}
${CAS_KERNEL} ${CAS_VIEWER}
${KERNEL_OpUtil}
qtx suit ViewerTools SalomeObject SalomePrs VTKViewer OpenGLUtils
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS} ${_moc_internal_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS} ${_moc_internal_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS} ${_moc_internal_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS SVTK EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${SVTK_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
-
-INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
\ No newline at end of file
{
QList<QWidget*> aList = createdWidgets();
for ( QList<QWidget*>::const_iterator it = aList.begin(); it != aList.end(); ++it )
- updateCombo( qFindChild<QComboBox*>(*it) );
+ updateCombo( (*it)->findChild<QComboBox*>() );
}
void SVTK_ComboAction::updateCombo( QComboBox* combo )
// Start a one-shot timer for <DELAY> ms.
//
static int DELAY = 1;
- myTimer->setSingleShot(TRUE);
+ myTimer->setSingleShot(true);
myTimer->start(DELAY);
return 1;
}
m_MainWindow(theParent)
{
setWindowTitle(tr("DLG_TITLE"));
- setSizeGripEnabled(TRUE);
+ setSizeGripEnabled(true);
// Create layout for this dialog
QGridLayout* layoutDlg = new QGridLayout (this);
// Create <OK> button
QPushButton* m_bOk = new QPushButton(tr("O&K"), aGroupBox2);
m_bOk->setObjectName("m_bOk");
- m_bOk->setDefault(TRUE);
- m_bOk->setAutoDefault(TRUE);
+ m_bOk->setDefault(true);
+ m_bOk->setAutoDefault(true);
// Create <Apply> button
QPushButton* m_bApply = new QPushButton(tr("&Apply"), aGroupBox2);
m_bApply->setObjectName("m_bApply");
- m_bApply->setAutoDefault(TRUE);
+ m_bApply->setAutoDefault(true);
// Create <Cancel> button
QPushButton* m_bCancel = new QPushButton(tr("&Cancel"), aGroupBox2);
m_bCancel->setObjectName("m_bCancel");
- m_bCancel->setAutoDefault(TRUE);
+ m_bCancel->setAutoDefault(true);
// Layout buttons
aHBoxLayout2->addWidget(m_bOk);
#endif
}
-
+/*
#ifdef WIN32
/*!
To handle native Win32 events (from such devices as SpaceMouse)
*/
-bool QVTK_RenderWindowInteractor::winEvent( MSG* msg, long* result )
+/*bool QVTK_RenderWindowInteractor::winEvent( MSG* msg, long* result )
{
// TODO: Implement event handling for SpaceMouse
return QWidget::winEvent( msg, result);
}
#else
-
+*/
/*!
To handle native X11 events (from such devices as SpaceMouse)
*/
-bool
+/*bool
QVTK_RenderWindowInteractor
::x11Event( XEvent *xEvent )
{
return QWidget::x11Event( xEvent );
}
-#endif
-
+#endif */
/*!
Constructor
*/
virtual void focusInEvent( QFocusEvent* );
virtual void focusOutEvent( QFocusEvent* );
- //! To handle native events (from such devices as SpaceMouse)
+/* //! To handle native events (from such devices as SpaceMouse)
#ifdef WIN32
virtual bool winEvent( MSG*, long* );
#else
virtual bool x11Event( XEvent *e );
-#endif
-
+#endif */
vtkSmartPointer<vtkRenderWindow> myRenderWindow;
vtkSmartPointer<vtkGenericRenderWindowInteractor> myDevice;
};
myRWInteractor(theParent->GetInteractor())
{
setWindowTitle(tr("DLG_TITLE"));
- setSizeGripEnabled(TRUE);
+ setSizeGripEnabled(true);
// Create layout for this dialog
QGridLayout* layoutDlg = new QGridLayout (this);
QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox );
m_bClose->setObjectName("m_bClose");
- m_bClose->setAutoDefault(TRUE);
+ m_bClose->setAutoDefault(true);
m_bClose->setFixedSize(m_bClose->sizeHint());
connect(m_bClose, SIGNAL(clicked()), this, SLOT(onClickClose()));
aGridLayout->addWidget(aLabel, 0, 0);
QLineEdit* aLineEdit = new QLineEdit( aGroupBox );
- aLineEdit->setReadOnly( TRUE );
+ aLineEdit->setReadOnly( true );
aGridLayout->addWidget(aLineEdit, 0, 1);
myCurrentUpdateRateLineEdit = aLineEdit;
aGridLayout->addWidget(aLabel, 1, 0);
QLineEdit* aLineEdit = new QLineEdit( aGroupBox );
- aLineEdit->setReadOnly( TRUE );
+ aLineEdit->setReadOnly( true );
aGridLayout->addWidget(aLineEdit, 1, 1);
myNumberOfCellsLineEdit = aLineEdit;
aHBoxLayout->setSpacing(6);
{
QPushButton* aPushButton = new QPushButton(tr("OK"), aGroupBox);
- aPushButton->setDefault(TRUE);
- aPushButton->setAutoDefault(TRUE);
+ aPushButton->setDefault(true);
+ aPushButton->setAutoDefault(true);
aHBoxLayout->addWidget(aPushButton);
connect(aPushButton, SIGNAL(clicked()), this, SLOT(onClickOk()));
}
{
QPushButton* aPushButton = new QPushButton(tr("Apply"), aGroupBox);
- aPushButton->setDefault(TRUE);
- aPushButton->setAutoDefault(TRUE);
+ aPushButton->setDefault(true);
+ aPushButton->setAutoDefault(true);
aHBoxLayout->addWidget(aPushButton);
connect(aPushButton, SIGNAL(clicked()), this, SLOT(onClickApply()));
}
aHBoxLayout->addStretch();
{
QPushButton* aPushButton = new QPushButton(tr("Close"), aGroupBox);
- aPushButton->setDefault(TRUE);
- aPushButton->setAutoDefault(TRUE);
+ aPushButton->setDefault(true);
+ aPushButton->setAutoDefault(true);
aHBoxLayout->addWidget(aPushButton);
connect(aPushButton, SIGNAL(clicked()), this, SLOT(onClickClose()));
}
if(TViewWindow* aView = dynamic_cast<TViewWindow*>(myViewManager->getActiveView())){
//Support of several toolbars in the popup menu
- QList<QToolBar*> lst = qFindChildren<QToolBar*>( aView );
+ QList<QToolBar*> lst = aView->findChildren<QToolBar*>();
QList<QToolBar*>::const_iterator it = lst.begin(), last = lst.end();
for( ; it!=last; it++ )
thePopup->addAction( (*it)->toggleViewAction() );
myRWInteractor(theParent->GetInteractor())
{
setWindowTitle(tr("DLG_TITLE"));
- setSizeGripEnabled(TRUE);
+ setSizeGripEnabled(true);
// Top layout
QVBoxLayout* aTopLayout = new QVBoxLayout(this);
QPushButton* m_bClose = new QPushButton(tr("&Close"), aGroupBox );
m_bClose->setObjectName("m_bClose");
- m_bClose->setAutoDefault(TRUE);
+ m_bClose->setAutoDefault(true);
m_bClose->setFixedSize(m_bClose->sizeHint());
connect(m_bClose, SIGNAL(clicked()), this, SLOT(onClickClose()));
ADD_SUBDIRECTORY(Test)
ENDIF()
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
IF(SALOME_USE_VTKVIEWER)
INCLUDE(${VTK_USE_FILE})
ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${QWT_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${PTHREAD_INCLUDE_DIR}
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
- ${QT_DEFINITIONS}
+ ${_QT_DEFINITIONS}
${OMNIORB_DEFINITIONS}
${QWT_DEFINITIONS}
${CAS_DEFINITIONS}
# libraries to link to
SET(_link_LIBRARIES
${CAS_KERNEL}
- ${QT_LIBRARIES}
+ ${_QT_LIBRARIES}
${PYTHON_LIBRARIES}
${KERNEL_OpUtil} ${KERNEL_SALOMELocalTrace} ${KERNEL_SalomeDSClient} ${KERNEL_TOOLSDS}
CASCatch suit std CAM ObjBrowser SalomePrs Event
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS SalomeApp EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${SalomeApp_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
#include <SALOME_LifeCycleCORBA.hxx>
#include <QApplication>
+#include <QWidget>
#include <QAction>
#include <QRegExp>
#include <QCheckBox>
QStringList pyfiles;
QString loadStudy;
- for (int i = 1; i < qApp->argc(); i++) {
+ for (int i = 1; i < qApp->arguments().size(); i++) {
QRegExp rxs ("--study-hdf=(.+)");
- if ( rxs.indexIn( QString(qApp->argv()[i]) ) >= 0 && rxs.capturedTexts().count() > 1 ) {
+ if ( rxs.indexIn( QString(qApp->arguments()[i]) ) >= 0 && rxs.capturedTexts().count() > 1 ) {
QString file = rxs.capturedTexts()[1];
QFileInfo fi ( file );
QString extension = fi.suffix().toLower();
}
else {
QRegExp rxp ("--pyscript=\\[(.+)\\]");
- if ( rxp.indexIn( QString(qApp->argv()[i]) ) >= 0 && rxp.capturedTexts().count() > 1 ) {
+ if ( rxp.indexIn( QString(qApp->arguments()[i]) ) >= 0 && rxp.capturedTexts().count() > 1 ) {
// pyscript
QStringList dictList = rxp.capturedTexts()[1].split("},", QString::SkipEmptyParts);
for (int k = 0; k < dictList.count(); ++k) {
DumpStudyFileDlg fd( desktop() );
fd.setValidator( new DumpStudyFileValidator( &fd ) );
fd.setWindowTitle( tr( "TOT_DESK_FILE_DUMP_STUDY" ) );
- fd.setFilters( aFilters );
+ fd.setNameFilters( aFilters );
fd.myPublishChk->setChecked( anIsPublish );
fd.myMultiFileChk->setChecked( anIsMultiFile );
fd.mySaveGUIChk->setChecked( anIsSaveGUI );
CORBA::ORB_var SalomeApp_Application::orb()
{
ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
- static CORBA::ORB_var _orb = init( qApp->argc(), qApp->argv() );
+ int size = qApp->arguments().size();
+ char* argv[size];
+ for ( int i = 0; i < size; ++i)
+ {
+ argv[i] = qApp->arguments()[i].toLatin1().data();
+ }
+ static CORBA::ORB_var _orb = init( size, argv );
return _orb;
}
ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
// TODO: using QApplication here looks ugly, think how to
// obtain the ORB reference in a nicer way...
- static CORBA::ORB_var _orb = init( qApp->argc(), qApp->argv() );
+ int size = qApp->arguments().size();
+ char* argv[size];
+ for ( int i = 0; i < size; ++i)
+ {
+ argv[i] = qApp->arguments()[i].toLatin1().data();
+ }
+ static CORBA::ORB_var _orb = init( size, argv );
return _orb;
}
setRootIsDecorated(false);
setAllColumnsShowFocus(false);
// header()->setClickEnabled(false);
- header()->setMovable(false);
+ header()->setSectionsMovable(false);
myEditedItem = 0;
myEdit = 0;
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
myIsChanged(false)
{
- setModal( TRUE );
+ setModal( true );
setWindowTitle(tr("TLT_STUDY_PROPERTIES"));
setSizeGripEnabled( true );
# --- scripts ---
# scripts / static
-# TODO: process UIC files via PyQt4 pyuic tool, see UsePyQt4.cmake
+# TODO: process UIC files via PyQt5 pyuic tool, see UsePyQt5.cmake
SET(_plugins_SCRIPTS
minmax_dialog.py
minmax_plugin.py
# Form implementation generated from reading ui file 'minmax.ui'
#
# Created: Thu Mar 1 15:23:57 2012
-# by: PyQt4 UI code generator 4.8.1
+# by: PyQt5 UI code generator 5.5.0
#
# WARNING! All changes made in this file will be lost!
-from PyQt4 import QtCore, QtGui
+from PyQt5 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
studyId = context.studyId
sg = context.sg
- from PyQt4.QtGui import QDialog
- from PyQt4.QtGui import QMessageBox
- from PyQt4.QtCore import Qt
- from PyQt4.QtCore import SIGNAL
+ from PyQt5.QtGui import QDialog
+ from PyQt5.QtGui import QMessageBox
+ from PyQt5.QtCore import Qt
+ from PyQt5.QtCore import SIGNAL
from minmax_dialog import Ui_Dialog
# Author : Guillaume Boulant (EDF)
import sys
-from PyQt4 import QtGui
-from PyQt4 import QtCore
+from PyQt5 import QtGui
+from PyQt5 import QtCore
from tubedialog_ui import TubeDialog_UI
# Author : Guillaume Boulant (EDF)
import sys
-from PyQt4 import QtGui
-from PyQt4 import QtCore
+from PyQt5 import QtGui
+from PyQt5 import QtCore
class TubeDialog_UI(QtGui.QDialog):
import salome_pluginsmanager
def about(context):
- from PyQt4.QtGui import QMessageBox
+ from PyQt5.QtGui import QMessageBox
QMessageBox.about(None, "About SALOME pluginmanager", "SALOME plugins manager in SALOME virtual application ")
salome_pluginsmanager.AddFunction('About plugins','About SALOME pluginmanager',about)
"""
import os,sys,traceback
-from PyQt4 import QtGui
-from PyQt4 import QtCore
+from PyQt5 import QtGui
+from PyQt5 import QtCore
import salome
#
# --- options ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5X11Extras_LIBRARIES})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${Boost_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS}
${CAS_INCLUDE_DIRS}
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
- ${QT_DEFINITIONS}
+ ${_QT_DEFINITIONS}
${BOOST_DEFINITIONS}
${PYTHON_DEFINITIONS}
${CAS_DEFINITIONS}
# libraries to link to
SET(_link_LIBRARIES
- ${QT_LIBRARIES}
+ ${_QT_LIBRARIES}
${CAS_KERNEL}
${OMNIORB_LIBRARIES}
${KERNEL_SalomeNS}
* - get session state
*/
-void MessageOutput( QtMsgType type, const char* msg )
+void MessageOutput( QtMsgType type, const QMessageLogContext &context, const QString &msg )
{
switch ( type )
{
//MESSAGE( "Debug: " << msg );
break;
case QtWarningMsg:
- MESSAGE( "Warning: " << msg );
+ MESSAGE( "Warning: " << msg.toLatin1().data() );
break;
case QtFatalMsg:
- MESSAGE( "Fatal: " << msg );
+ MESSAGE( "Fatal: " << msg.toLatin1().data() );
break;
}
}
SALOME_QApplication( int& argc, char** argv ) : TestApplication( argc, argv ), myHandler ( 0 ) {}
#else
SALOME_QApplication( int& argc, char** argv )
-#ifndef WIN32
+//#ifndef WIN32
// san: Opening an X display and choosing a visual most suitable for 3D visualization
// in order to make SALOME viewers work with non-native X servers
- : QApplication( (Display*)Qtx::getDisplay(), argc, argv, Qtx::getVisual() ),
-#else
+// : QApplication( (Display*)Qtx::getDisplay(), argc, argv, Qtx::getVisual() ),
+//#else
: QApplication( argc, argv ),
-#endif
+//#endif
myHandler ( 0 ) {}
#endif
int main( int argc, char **argv )
{
// Install Qt debug messages handler
- qInstallMsgHandler( MessageOutput );
+ qInstallMessageHandler( MessageOutput );
//Set a "native" graphic system in case if application runs on the remote host
QString remote(getenv("REMOTEHOST"));
QString client(getenv("SSH_CLIENT"));
- if(remote.length() > 0 || client.length() > 0 ) {
+ /*if(remote.length() > 0 || client.length() > 0 ) {
QApplication::setGraphicsSystem(QLatin1String("native"));
- }
+ }*/
// add $QTDIR/plugins to the pluins search path for image plugins
QString qtdir = qgetenv( "QT_ROOT_DIR" );
_qappl.setApplicationVersion( salomeVersion() );
// Add application library path (to search style plugin etc...)
- QString path = QDir::convertSeparators( SUIT_Tools::addSlash( QString( ::getenv( "GUI_ROOT_DIR" ) ) ) + QString( "bin/salome" ) );
+ QString path = QDir::toNativeSeparators( SUIT_Tools::addSlash( QString( ::getenv( "GUI_ROOT_DIR" ) ) ) + QString( "bin/salome" ) );
_qappl.addLibraryPath( path );
bool isGUI = isFound( "GUI", argc, argv );
// start check servers
int current = 0;
QString error;
- int argc = QApplication::instance()->argc();
- char** argv = QApplication::instance()->argv();
+ int argc = QApplication::instance()->arguments().size();
+ char* argv[argc];
+ for ( int i = 0; i < argc; ++i)
+ {
+ argv[i] = QApplication::instance()->arguments()[i].toLatin1().data();
+ }
// 1. Check naming service
for ( int i = 0; i < myAttempts; i++ ) {
{
_argc = argc ;
_argv = argv ;
- _isGUI = FALSE ;
+ _isGUI = false ;
_runningStudies= 0 ;
_orb = CORBA::ORB::_duplicate(orb) ;
_poa = PortableServer::POA::_duplicate(poa) ;
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES} ${Qt5Network_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_SOURCE_DIR}/src/Qtx
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} qtx)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} qtx)
# --- headers ---
SET(_other_RESOURCES resources/SalomeStyle.xml)
# --- sources ---
-
-# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
-
-# sources / rcc wrappings
-QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ELSE()
+ # sources / moc wrappings
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT5_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS SalomeStyle EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${SalomeStyle_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
INSTALL(FILES "${_other_RESOURCES}" DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
#include <QPixmapCache>
#include <limits.h>
+#include <qdrawutil.h>
#define SHADOW 1
#define LINE_GR_MARGIN 10
Use Style_Salome::apply() static function to set SALOME style to the application.
*/
Style_Salome::Style_Salome()
- : QWindowsStyle()
+ : QCommonStyle()
{
// initialize SALOME style resources
Q_INIT_RESOURCE( Style );
*/
void Style_Salome::polish ( QApplication* app )
{
- QWindowsStyle::polish( app );
+ QCommonStyle::polish( app );
if ( checkDebugLevel(1) ) {
return;
void Style_Salome::polish ( QWidget* w )
{
if ( checkDebugLevel(2) ) {
- QWindowsStyle::polish( w );
+ QCommonStyle::polish( w );
return;
}
w->setAttribute( Qt::WA_Hover );
}
- QWindowsStyle::polish( w );
+ QCommonStyle::polish( w );
}
/*!
void Style_Salome::unpolish( QWidget* w )
{
if ( checkDebugLevel(3) ) {
- QWindowsStyle::unpolish( w );
+ QCommonStyle::unpolish( w );
return;
}
w->setAttribute( Qt::WA_Hover, false );
}
- QWindowsStyle::unpolish( w );
+ QCommonStyle::unpolish( w );
}
/*!
QPainter* p, const QWidget* w ) const
{
if ( checkDebugLevel(4) ) {
- QWindowsStyle::drawComplexControl( cc, opt, p, w );
+ QCommonStyle::drawComplexControl( cc, opt, p, w );
return;
}
if ((slider->subControls & SC_SliderGroove) && groove.isValid()) {
QStyleOptionSlider tmpSlider = *slider;
tmpSlider.subControls = SC_SliderGroove;
- QWindowsStyle::drawComplexControl(cc, &tmpSlider, p, w);
+ QCommonStyle::drawComplexControl(cc, &tmpSlider, p, w);
}
if (slider->subControls & SC_SliderTickmarks) {
QStyleOptionSlider tmpSlider = *slider;
if (w && ( qobject_cast<QToolBar *>(w->parentWidget() ) ||
( toolbutton->state & State_AutoRaise && !( toolbutton->state & State_MouseOver ) ) )
) {
- QWindowsStyle::drawComplexControl( cc, opt, p, w );
+ QCommonStyle::drawComplexControl( cc, opt, p, w );
return;
}
int aMinDelta = (int)model()->widgetRounding( Style_Model::ButtonRadius );
}
}
case CC_TitleBar: {
- QWindowsStyle::drawComplexControl( cc, opt, p, w );
+ QCommonStyle::drawComplexControl( cc, opt, p, w );
break;
}
case CC_GroupBox:
break;
}
case CC_Dial: {
- QWindowsStyle::drawComplexControl( cc, opt, p, w );
+ QCommonStyle::drawComplexControl( cc, opt, p, w );
break;
}
default:
- QWindowsStyle::drawComplexControl( cc, opt, p, w );
+ QCommonStyle::drawComplexControl( cc, opt, p, w );
}
}
QPainter* p, const QWidget* w ) const
{
if ( checkDebugLevel(5) ) {
- QWindowsStyle::drawControl( ce, opt, p, w );
+ QCommonStyle::drawControl( ce, opt, p, w );
return;
}
break;
}
case CE_Splitter: {
- QWindowsStyle::drawControl( ce, opt, p, w );
+ QCommonStyle::drawControl( ce, opt, p, w );
QRect r = opt->rect;
bool horiz = r.width() > r.height();
int aLen = model()->splitHandleLength();
}
QStyleOptionTab* copyTab = (QStyleOptionTab*)tab;
copyTab->rect = oldRect;
- QWindowsStyle::drawControl( ce, copyTab, p, w );
+ QCommonStyle::drawControl( ce, copyTab, p, w );
}
else
- QWindowsStyle::drawControl( ce, opt, p, w );
+ QCommonStyle::drawControl( ce, opt, p, w );
break;
}
case CE_MenuBarItem:
break;
}
default:
- QWindowsStyle::drawControl( ce, opt, p, w );
+ QCommonStyle::drawControl( ce, opt, p, w );
break;
}
}
QPainter* p, const QWidget* w ) const
{
if ( checkDebugLevel(6) ) {
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
+ QCommonStyle::drawPrimitive( pe, opt, p, w );
return;
}
break;
}
else
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
+ QCommonStyle::drawPrimitive( pe, opt, p, w );
}
break;
case PE_FrameFocusRect: {
aBrdTopCol, aBrdBotCol, false, false, isHover, true );
}
else {
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
+ QCommonStyle::drawPrimitive( pe, opt, p, w );
}
break;
}
p->setPen(opt->palette.text().color());
} // Fall through!
case PE_IndicatorViewItemCheck:
- case PE_Q3CheckListIndicator: {
+ /* case PE_Q3CheckListIndicator: {
if (!doRestore) {
p->save();
doRestore = true;
if (doRestore)
p->restore();
break;
- }
+ }*/
case PE_IndicatorRadioButton: {
if ( hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver) )
drawHoverRect(p, w->rect(), opt->palette.color( QPalette::Window ),
break;
}
case PE_Widget: {
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
+ QCommonStyle::drawPrimitive( pe, opt, p, w );
if ( !w )
break;
if( w->parent() && !qobject_cast<QMenuBar*>((QWidget*)w) )
= qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)) {
if (tbb->shape != QTabBar::RoundedNorth && tbb->shape != QTabBar::RoundedEast &&
tbb->shape != QTabBar::RoundedSouth && tbb->shape != QTabBar::RoundedWest) {
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
+ QCommonStyle::drawPrimitive( pe, opt, p, w );
break;
}
QRect aSelRect = tbb->selectedTabRect;
aPal.setBrush( QPalette::AlternateBase, QBrush( gr_alt ) );
aWdg->setPalette( aPal );
}
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
+ QCommonStyle::drawPrimitive( pe, opt, p, w );
break;
}
default:
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
+ QCommonStyle::drawPrimitive( pe, opt, p, w );
}
}
const QWidget* w ) const
{
if ( checkDebugLevel(7) ) {
- return QWindowsStyle::pixelMetric( metric, opt, w );
+ return QCommonStyle::pixelMetric( metric, opt, w );
}
- int aRes = QWindowsStyle::pixelMetric( metric, opt, w );
+ int aRes = QCommonStyle::pixelMetric( metric, opt, w );
switch( metric ) {
case PM_SliderLength: {
aRes += (int)((double)model()->sliderSize()/2);
const QSize& contentsSize, const QWidget* w ) const
{
if ( checkDebugLevel(8) ) {
- return QWindowsStyle::sizeFromContents( ct, opt,contentsSize, w );
+ return QCommonStyle::sizeFromContents( ct, opt,contentsSize, w );
}
- QSize sz = QWindowsStyle::sizeFromContents( ct, opt, contentsSize, w );
+ QSize sz = QCommonStyle::sizeFromContents( ct, opt, contentsSize, w );
switch (ct) {
case CT_TabBarTab:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
QRect res = QRect( 0, 0, sz.width(), sz.height() );
int aHalfRect = (int)Style_Tools::getMaxRect( res,
(int)model()->widgetRounding( Style_Model::EditRadius )/2 ); // left value
- QRect old_arrow = QWindowsStyle::subControlRect( CC_ComboBox, cmb,
+ QRect old_arrow = QCommonStyle::subControlRect( CC_ComboBox, cmb,
SC_ComboBoxArrow, w );
int aDelta = res.height() - old_arrow.width(); // right value
if ( cmb->editable )
const QWidget *w) const
{
if ( checkDebugLevel(9) ) {
- return QWindowsStyle::standardPixmap( stPixmap, opt, w );
+ return QCommonStyle::standardPixmap( stPixmap, opt, w );
}
switch ( stPixmap )
case SP_TitleBarMinButton:
return QPixmap( minimize_xpm );
default:
- return QWindowsStyle::standardPixmap( stPixmap, opt, w );
+ return QCommonStyle::standardPixmap( stPixmap, opt, w );
}
}
const QWidget* w ) const
{
if ( checkDebugLevel(10) ) {
- return QWindowsStyle::standardIconImplementation( standardIcon, opt, w );
+ return QCommonStyle::standardIcon( standardIcon, opt, w );
}
switch ( standardIcon )
default:
break;
}
- return QWindowsStyle::standardIconImplementation( standardIcon, opt, w );
+ return QCommonStyle::standardIcon( standardIcon, opt, w );
}
/*!
QStyleHintReturn* returnData ) const
{
if ( checkDebugLevel(11) ) {
- return QWindowsStyle::styleHint( hint, opt, w, returnData );
+ return QCommonStyle::styleHint( hint, opt, w, returnData );
}
- int aRes = QWindowsStyle::styleHint( hint, opt, w, returnData );
+ int aRes = QCommonStyle::styleHint( hint, opt, w, returnData );
switch( hint ) {
case SH_Table_GridLineColor: {
if ( opt )
SubControl sc, const QWidget* wid ) const
{
if ( checkDebugLevel(12) ) {
- return QWindowsStyle::subControlRect( cc, opt, sc, wid );
+ return QCommonStyle::subControlRect( cc, opt, sc, wid );
}
- QRect res = QWindowsStyle::subControlRect( cc, opt, sc, wid );
+ QRect res = QCommonStyle::subControlRect( cc, opt, sc, wid );
switch ( cc ) {
case CC_SpinBox: {
int x = res.x(), w = res.width(), h = res.height();
if ( sc==SC_SpinBoxUp || sc==SC_SpinBoxDown ) {
- QRect frame_r = QWindowsStyle::subControlRect( cc, opt, SC_SpinBoxFrame, wid );
+ QRect frame_r = QCommonStyle::subControlRect( cc, opt, SC_SpinBoxFrame, wid );
h = frame_r.height();
res.setX( x+w-h );
res.setWidth( h );
}
case CC_ScrollBar:
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
- QRect slider_r = QWindowsStyle::subControlRect( cc, opt, SC_ScrollBarSlider, wid );
+ QRect slider_r = QCommonStyle::subControlRect( cc, opt, SC_ScrollBarSlider, wid );
int aRect = Style_Tools::getMaxRect( slider_r, (int)model()->widgetRounding( Style_Model::ButtonRadius ) );
switch( sc ) {
case SC_ScrollBarSubPage: // between top/left button and slider
const QWidget* wid ) const
{
if ( checkDebugLevel(13) ) {
- return QWindowsStyle::subElementRect( se, opt, wid );
+ return QCommonStyle::subElementRect( se, opt, wid );
}
- QRect res = QWindowsStyle::subElementRect( se, opt, wid );
+ QRect res = QCommonStyle::subElementRect( se, opt, wid );
int aHalfRect = (int)Style_Tools::getMaxRect( res, (int)model()->widgetRounding( Style_Model::EditRadius )/2 );
int w = res.width(), h = res.height();
switch ( se ) {
case SE_ComboBoxFocusRect: {
- QRect old_r = QWindowsStyle::subControlRect( CC_ComboBox,
+ QRect old_r = QCommonStyle::subControlRect( CC_ComboBox,
qstyleoption_cast<const QStyleOptionComplex*>( opt ),
SC_ComboBoxArrow, wid );
int old_w = old_r.width();
#include "Style.h"
-#include <QWindowsStyle>
+#include <QCommonStyle>
class Style_Model;
class QPainter;
class QtxResourceMgr;
-class STYLE_SALOME_EXPORT Style_Salome : public QWindowsStyle
+class STYLE_SALOME_EXPORT Style_Salome : public QCommonStyle
{
Q_OBJECT
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
# --- options ---
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${CAS_INCLUDE_DIRS}
${OMNIORB_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
- ${QT_DEFINITIONS}
+ ${_QT_DEFINITIONS}
${CAS_DEFINITIONS}
${BOOST_DEFINITIONS}
${OMNIORB_DEFINITIONS}
# libraries to link to
SET(_link_LIBRARIES
- ${QT_LIBRARIES}
+ ${_QT_LIBRARIES}
${CAS_KERNEL}
${KERNEL_SalomeIDLKernel}
${KERNEL_SALOMELocalTrace}
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS ToolsGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${ToolsGUI_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
-
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
\ No newline at end of file
ADD_SUBDIRECTORY(Test)
-INCLUDE(UseQt4Ext)
-
# --- options ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${OMNIORB_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${PTHREAD_INCLUDE_DIR}
# additional preprocessor / compiler flags
ADD_DEFINITIONS(
${CAS_DEFINITIONS}
- ${QT_DEFINITIONS}
+ ${_QT_DEFINITIONS}
${BOOST_DEFINITIONS}
${OMNIORB_DEFINITIONS}
)
# libraries to link to
SET(_link_LIBRARIES
${OMNIORB_LIBRARIES}
- ${QT_LIBRARIES}
+ ${_QT_LIBRARIES}
${KERNEL_SalomeLifeCycleCORBA} ${KERNEL_SalomeKernelHelpers}
qtx suit std CAM ObjBrowser LightApp SalomeApp
)
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
# --- options ---
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# additional include directories
INCLUDE_DIRECTORIES(
${OMNIORB_INCLUDE_DIR}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_SOURCE_DIR}/src/GuiHelpers
${PROJECT_SOURCE_DIR}/src/TreeData
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${QT_DEFINITIONS})
+ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${_QT_DEFINITIONS})
# libraries to link to
SET(_link_LIBRARIES
${CORBA_LIBS}
- ${QT_LIBRARIES}
+ ${_QT_LIBRARIES}
SalomeTreeData SalomeGuiHelpers
${KERNEL_SalomeLifeCycleCORBA} ${KERNEL_SalomeKernelHelpers}
)
# header files / to be processed by moc
SET(_moc_HEADERS mainwindow.hxx)
-# header files / uic wrappings
-QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ # header files / uic wrappings
+ QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ # header files / uic wrappings
+ QT5_WRAP_UI(_uic_HEADERS ${_uic_files})
+ # sources / moc wrappings
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# --- sources ---
-# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
-
# sources / to compile
SET(TreeData_guitester_SOURCES MyDataModel.cxx guitester.cxx mainwindow.cxx testhelper.cxx ${_moc_SOURCES} ${_uic_HEADERS})
SET(TreeData_tester_SOURCES MyDataModel.cxx tester.cxx)
//
#include <QtGui>
+#include <QInputDialog>
#include "mainwindow.hxx"
#include "TreeModel.hxx"
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
INCLUDE(${VTK_USE_FILE})
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
${CAS_INCLUDE_DIRS}
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PTHREAD_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/src/Qtx
${PROJECT_SOURCE_DIR}/src/SUIT
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${CAS_DEFINITIONS} ${QT_DEFINITIONS})
+ADD_DEFINITIONS(${CAS_DEFINITIONS} ${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${VTK_LIBRARIES} ${CAS_KERNEL} qtx suit ${KERNEL_SALOMELocalTrace})
+SET(_link_LIBRARIES ${_QT_LIBRARIES} ${OPENGL_LIBRARIES} ${VTK_LIBRARIES} ${CAS_KERNEL} qtx suit ${KERNEL_SALOMELocalTrace})
# --- headers ---
)
# --- sources ---
-
-# sources / rcc wrappings
-QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
-
-# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ # sources / moc wrappings
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ELSE()
+ # sources / moc wrappings
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ # sources / rcc wrappings
+ QT5_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS VTKViewer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${VTKViewer_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
INSTALL(FILES ${GUIVTI_DATA} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
FILE(GLOB GUITXT_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.txt")
-INSTALL(FILES ${GUITXT_DATA} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
-
-
-
+INSTALL(FILES ${GUITXT_DATA} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
\ No newline at end of file
#include <vtkRendererCollection.h>
#include <vtkCamera.h>
#ifndef WIN32
-#include <QX11Info>
+#include <QtGui/QX11Info>
#include <vtkXOpenGLRenderWindow.h>
//#include <GL/gl.h>
//#include <GL/glu.h>
///
/// Start a one-shot timer for 10ms.
///
- mTimer->setSingleShot(TRUE) ;
+ mTimer->setSingleShot(true) ;
mTimer->start(10) ;
return 1 ;
}
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-INCLUDE(UseQt4Ext)
-
+INCLUDE(UseQtExt)
+IF (NOT SALOME_BUILD_WITH_QT5)
+ SET(_QT_INCLUDES ${QT_INCLUDES})
+ SET(_QT_DEFINITIONS ${QT_DEFINITIONS})
+ SET(_QT_LIBRARIES ${QT_LIBRARIES})
+ELSE()
+ SET(_QT_INCLUDES ${Qt5Widgets_INCLUDES})
+ SET(_QT_DEFINITIONS ${Qt5Widgets_DEFINITIONS})
+ SET(_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ENDIF()
# --- options ---
# additional include directories
INCLUDE_DIRECTORIES(
- ${QT_INCLUDES}
+ ${_QT_INCLUDES}
${PROJECT_SOURCE_DIR}/src/Qtx
)
# additional preprocessor / compiler flags
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${_QT_DEFINITIONS})
# libraries to link to
-SET(_link_LIBRARIES ${QT_LIBRARIES} qtx)
+SET(_link_LIBRARIES ${_QT_LIBRARIES} qtx)
# --- headers ---
# --- sources ---
# sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+IF (NOT SALOME_BUILD_WITH_QT5)
+ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ELSE()
+ QT5_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+ENDIF()
# sources / static
SET(_other_SOURCES
INSTALL(TARGETS ViewerTools EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
INSTALL(FILES ${ViewerTools_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
ViewerTools_DialogBase(QtxAction* theAction,
QWidget* theParent,
const char* theName = "",
- bool theModal = FALSE,
+ bool theModal = false,
Qt::WindowFlags theWFalgs = 0);
~ViewerTools_DialogBase();
GenericDialog.ui
)
-ADD_DEFINITIONS(${QT_DEFINITIONS})
+ADD_DEFINITIONS(${Qt5Widgets_DEFINITIONS})
ADD_CUSTOM_COMMAND( OUTPUT QDialogTest.cxx QDialogTest.h QDialogTest.ui
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dlgfactory.py -s -n QDialogTest -t qdialog
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/dlgfactory.py -s -n GDialogTest -t gdialog
)
-QT4_WRAP_UI(qtester_FORMS_HEADERS ${qtester_FORMS} )
-QT4_WRAP_CPP(qtester_HEADERS_MOC ${qtester_HEADERS})
+QT5_WRAP_UI(qtester_FORMS_HEADERS ${qtester_FORMS} )
+QT5_WRAP_CPP(qtester_HEADERS_MOC ${qtester_HEADERS})
-QT4_WRAP_UI(gtester_FORMS_HEADERS ${gtester_FORMS} )
-QT4_WRAP_CPP(gtester_HEADERS_MOC ${gtester_HEADERS})
+QT5_WRAP_UI(gtester_FORMS_HEADERS ${gtester_FORMS} )
+QT5_WRAP_CPP(gtester_HEADERS_MOC ${gtester_HEADERS})
-QT4_WRAP_UI(GenericDialog_FORMS_HEADERS ${GenericDialog_FORMS} )
-QT4_WRAP_CPP(GenericDialog_HEADERS_MOC ${GenericDialog_HEADERS})
+QT5_WRAP_UI(GenericDialog_FORMS_HEADERS ${GenericDialog_FORMS} )
+QT5_WRAP_CPP(GenericDialog_HEADERS_MOC ${GenericDialog_HEADERS})
ADD_EXECUTABLE(qtester ${qtester_SOURCES}
${qtester_HEADERS_MOC}
${qtester_FORMS_HEADERS}
QDialogTest.cxx
)
-TARGET_LINK_LIBRARIES(qtester ${QT_LIBRARIES})
+TARGET_LINK_LIBRARIES(qtester ${Qt5Widgets_LIBRARIES})
ADD_EXECUTABLE(gtester ${gtester_SOURCES}
${gtester_HEADERS_MOC}
${GenericDialog_FORMS_HEADERS}
GDialogTest.cxx
)
-TARGET_LINK_LIBRARIES(gtester ${QT_LIBRARIES})
+TARGET_LINK_LIBRARIES(gtester ${Qt5Widgets_LIBRARIES})
INSTALL(TARGETS qtester gtester DESTINATION ${SALOME_INSTALL_BINS})