Unverified Commit 8d9f695d authored by Gagik Vardanyan's avatar Gagik Vardanyan Committed by GitHub
Browse files

Merge pull request #32389 from mantidproject/move_guis_to_qt_folder

Move interfaces out of scripts folder
parents f157ce38 b50d2acc
......@@ -106,7 +106,7 @@ build/
.builds
*.egg-info/
Framework/Kernel/inc/MantidKernel/GitHubApiHelper.h
qt/python/mantidqt/resources.py
qt/python/mantidqt/mantidqt/resources.py
qt/applications/workbench/workbench/app/resources.py
# Visual C++ cache files
......
......@@ -29,5 +29,5 @@ repos:
hooks:
- id: flake8
# Have to manually copy this from the .flake8 as flake8 will just ignore the config if the file is passed
exclude: Framework/PythonInterface/test|qt/applications/workbench/workbench/app/resources.py|qt/python/mantidqt/resources.py|qt/python/mantidqt/dialogs/errorreports/resources_qt4.py|qt/python/mantidqt/dialogs/errorreports/resources_qt5.py|Testing/PerformanceTests|Testing/SystemTests/lib|Testing/SystemTests/scripts|Testing/SystemTests/tests/framework/reference|scripts/ErrorReporter/ui_errorreport.py
exclude: Framework/PythonInterface/test|qt/applications/workbench/workbench/app/resources.py|qt/python/mantidqt/mantidqt/resources.py|qt/python/mantidqt/mantidqt/dialogs/errorreports/resources_qt4.py|qt/python/mantidqt/mantidqt/dialogs/errorreports/resources_qt5.py|Testing/PerformanceTests|Testing/SystemTests/lib|Testing/SystemTests/scripts|Testing/SystemTests/tests/framework/reference|scripts/ErrorReporter/ui_errorreport.py
args: ['--extend-ignore=E999,F821,E127']
......@@ -572,6 +572,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/inc/MantidKernel/GitHubApiHelper.h.in
# the part that turns relative into absolute paths in the properties file
set(MANTID_ROOT ${CMAKE_SOURCE_DIR})
# This keeps things working for people building just the framework project
set(PYTHON_INTERFACES_DIR ${MANTID_ROOT}/qt/python/mantidqtinterfaces/mantidqtinterfaces)
if(${CMAKE_PROJECT_NAME} STREQUAL "MantidFramework")
set(MANTID_ROOT ${CMAKE_SOURCE_DIR}/..)
endif()
......
......@@ -135,7 +135,6 @@ ConfigServiceImpl::ConfigServiceImpl()
setBaseDirectory();
m_configPaths.insert("mantidqt.python_interfaces_directory");
m_configPaths.insert("framework.plugins.directory");
m_configPaths.insert("mantidqt.plugins.directory");
m_configPaths.insert("instrumentDefinition.directory");
......
......@@ -25,9 +25,6 @@ mantidqt.python_interfaces = ILL/Drill.py Direct/DGS_Reduction.py Direct/DGSPlan
mantidqt.python_interfaces_io_registry = Engineering_Diffraction_register.py
# Directory containing the above startup scripts
mantidqt.python_interfaces_directory = @MANTID_ROOT@/scripts
# Where to find mantid framework plugins
framework.plugins.directory = @FRAMEWORK_PLUGINS_DIR@
......
......@@ -10,7 +10,6 @@ from mantid.api import AlgorithmFactory, PythonAlgorithm, ITableWorkspacePropert
from mantid.simpleapi import CreateEmptyTableWorkspace
from mantid.kernel import Direction
from mantid import mtd
from Muon.GUI import ElementalAnalysis
LABELS = {"Primary": "Primary energy", "Secondary": "Secondary energy"}
......@@ -80,6 +79,8 @@ class PeakMatching(PythonAlgorithm):
doc='Name of the table containing the weighted count of elements in all matches')
def get_default_peak_data(self):
# import locally dynamically so we don't introduce a qt dependency into the framework
from mantidqtinterfaces.Muon.GUI import ElementalAnalysis
path = os.path.join(os.path.dirname(ElementalAnalysis.__file__), "peak_data.json")
with open(path, 'r') as file_to_read:
peak_data = json.load(file_to_read)
......
......@@ -118,7 +118,6 @@ class ConfigServiceTest(unittest.TestCase):
# test with single string
do_test(';'.join(new_path_list))
def test_appending_paths(self):
new_path_list = self._setup_test_areas()
try:
......@@ -155,7 +154,8 @@ class ConfigServiceTest(unittest.TestCase):
'workspace.sendto.SansView.arguments', 'workspace.sendto.SansView.saveusing', # related to SASview in menu
'workspace.sendto.SansView.target', 'workspace.sendto.SansView.visible', # related to SASview in menu
'workspace.sendto.name.SansView', # related to SASview in menu
'catalog.oncat.token.accessToken', 'catalog.oncat.token.expiresIn', 'catalog.oncat.token.refreshToken', 'catalog.oncat.token.scope', 'catalog.oncat.token.tokenType', # Shouldn't be changed by users.
# Shouldn't be changed by users.
'catalog.oncat.token.accessToken', 'catalog.oncat.token.expiresIn', 'catalog.oncat.token.refreshToken', 'catalog.oncat.token.scope', 'catalog.oncat.token.tokenType',
########## TODO should be documented!
'filefinder.casesensitive',
......@@ -173,8 +173,7 @@ class ConfigServiceTest(unittest.TestCase):
'curvefitting.defaultPeak', 'curvefitting.findPeaksFWHM', 'curvefitting.findPeaksTolerance', 'curvefitting.guiExclude',
'logging.channels.consoleChannel.class', 'logging.channels.consoleChannel.formatter', 'logging.formatters.f1.class', 'logging.formatters.f1.pattern', 'logging.formatters.f1.times', 'logging.loggers.root.channel.channel1', 'logging.loggers.root.channel.class',
'MantidOptions.ReusePlotInstances',
'mantidqt.python_interfaces', 'mantidqt.python_interfaces_directory'
]
'mantidqt.python_interfaces']
# create the list of things
undocumented = []
......@@ -193,7 +192,6 @@ class ConfigServiceTest(unittest.TestCase):
if len(undocumented) > 0:
raise AssertionError('{} undocumented properties: {}'.format(len(undocumented), undocumented))
def _setup_test_areas(self):
"""Create a new data search path string
"""
......@@ -225,5 +223,6 @@ class ConfigServiceTest(unittest.TestCase):
except OSError:
pass
if __name__ == '__main__':
unittest.main()
......@@ -8,7 +8,7 @@
from systemtesting import MantidSystemTest
from mantid.simpleapi import CreateWorkspace, LinearBackground, FlatBackground, Gaussian, CalculateChiSquared, mtd
from CrystalField.fitting import makeWorkspace
from PyChop import PyChop2
from mantidqtinterfaces.PyChop import PyChop2
import numpy as np
......
......@@ -17,8 +17,8 @@ from qtpy.QtCore import Qt, QPoint
from mantid.kernel import config
from mantid.simpleapi import mtd, GroupWorkspaces
from Interface.ui.drill.view.DrillView import *
from Interface.ui.drill.view.DrillSettingsDialog import *
from mantidqtinterfaces.drill.view.DrillView import *
from mantidqtinterfaces.drill.view.DrillSettingsDialog import *
app = QApplication(sys.argv)
......
......@@ -35,8 +35,8 @@ class PythonInterfacesStartupTest(systemtesting.MantidSystemTest):
"""
def __init__(self):
super(PythonInterfacesStartupTest, self).__init__()
self._interface_directory = ConfigService.getString('mantidqt.python_interfaces_directory')
import mantidqtinterfaces
self._interface_directory = os.path.dirname(mantidqtinterfaces.__file__)
self._interface_scripts = [interface.split("/")[1] for interface in ConfigService.getString('mantidqt.python_interfaces').split()]
def runTest(self):
......
......@@ -77,7 +77,7 @@ Mantid, to do a single point calculation of the flux and resolution
.. code:: python
from PyChop import PyChop2
from mantidqtinterfaces.PyChop import PyChop2
resolution, flux = PyChop2.calculate(inst='maps', chtyp='a', freq=500, ei=600, etrans=range(0,550,50))
The parameters are in order, so ``PyChop2.calculate('maps','a',500,600,range(0,550,50))``
......
......@@ -282,7 +282,7 @@ Or using an arbitrary function `my_func`::
Finally, the :ref:`PyChop` interface may be used to generate the resolution function for a particular spectrometer::
from PyChop import PyChop2
from mantidqtinterfaces.PyChop import PyChop2
marires = PyChop2('MARI')
marires.setChopper('S')
marires.setFrequency(250)
......
......@@ -51,7 +51,7 @@ Fitting with resolution function
.. code-block:: python
from CrystalField import CrystalField, CrystalFieldFit, Background, Function, ResolutionModel
from PyChop import PyChop2
from mantidqtinterfaces.PyChop import PyChop2
# load the data
data_ws1 = Load('MER38435_10p22meV.txt')
......
......@@ -66,6 +66,15 @@ def _get_splash_image():
Qt.SmoothTransformation)
def _get_interface_dir():
"""
Returns the path to the directory containing the mantidqt interfaces launch scripts
This is the path to the mantidqtinterfaces package
"""
import mantidqtinterfaces
return os.path.dirname(mantidqtinterfaces.__file__)
SPLASH = QSplashScreen(_get_splash_image(), Qt.WindowStaysOnTopHint)
SPLASH.show()
SPLASH.showMessage("Starting...", int(Qt.AlignBottom | Qt.AlignLeft
......@@ -369,7 +378,8 @@ class MainWindow(QMainWindow):
def populate_interfaces_menu(self):
"""Populate then Interfaces menu with all Python and C++ interfaces"""
self.interfaces_menu.clear()
interface_dir = ConfigService['mantidqt.python_interfaces_directory']
interface_dir = _get_interface_dir()
self.interface_list, registers_to_run = self._discover_python_interfaces(interface_dir)
self._discover_cpp_interfaces(self.interface_list)
hidden_interfaces = ConfigService['interfaces.categories.hidden'].split(';')
......
......@@ -10,6 +10,7 @@
"""
Defines the QMainWindow of the application and the main() entry point.
"""
import os
import unittest
import sys
......@@ -150,7 +151,6 @@ class MainWindowTest(unittest.TestCase):
@patch('workbench.app.mainwindow.add_actions')
def test_interfaces_menu_texts_are_correct(self, _):
interface_dir = './interfaces/'
example_interfaces = {
'General': ['TOFCalculator'],
'Direct': ['DGS_Reduction.py', 'DGSPlanner.py', 'PyChop.py', 'MSlice.py', 'ALF View']
......@@ -159,7 +159,6 @@ class MainWindowTest(unittest.TestCase):
with patch('workbench.app.mainwindow.ConfigService',
new={
'interfaces.categories.hidden': '',
'mantidqt.python_interfaces_directory': interface_dir
}):
self.main_window._discover_python_interfaces = Mock(return_value=(example_interfaces, {}))
self.main_window._discover_cpp_interfaces = Mock()
......@@ -180,7 +179,8 @@ class MainWindowTest(unittest.TestCase):
@patch('workbench.app.mainwindow.add_actions')
def test_that_populate_interfaces_menu_discovers_interfaces(self, _):
interface_dir = './interfaces/'
import mantidqtinterfaces
interface_dir = os.path.dirname(mantidqtinterfaces.__file__)
interfaces = {'category': ['interface.py']}
self.main_window._discover_python_interfaces = Mock(return_value=(interfaces, {}))
......@@ -189,7 +189,6 @@ class MainWindowTest(unittest.TestCase):
with patch('workbench.app.mainwindow.ConfigService',
new={
'interfaces.categories.hidden': '',
'mantidqt.python_interfaces_directory': interface_dir
}):
self.main_window.create_menus()
self.main_window.populate_interfaces_menu()
......@@ -198,14 +197,13 @@ class MainWindowTest(unittest.TestCase):
self.main_window._discover_cpp_interfaces.assert_called_with(interfaces)
def test_that_populate_interfaces_menu_ignores_hidden_interfaces(self):
interface_dir = './interfaces/'
self.main_window._discover_python_interfaces = Mock(return_value=({
'category1': ['interface1.py'],
'category2': ['interface2.py']
}, {}))
self.main_window._discover_cpp_interfaces = Mock()
self.main_window.interfaces_menu = Mock()
ConfigService_dict = {'interfaces.categories.hidden': 'category1;category2', 'mantidqt.python_interfaces_directory': interface_dir}
ConfigService_dict = {'interfaces.categories.hidden': 'category1;category2'}
with patch.object(self.main_window, 'interfaces_menu') as mock_interfaces_menu:
with patch('workbench.app.mainwindow.ConfigService', new=ConfigService_dict):
......
# This file manages building/installation of the mantidqt and mantidqtpython
# Python wrappers.
include(PythonPackageTargetFunctions)
# mantidqt
if(ENABLE_WORKBENCH)
if(APPLE)
set(_install_lib_dirs)
if(ENABLE_WORKBENCH)
list(APPEND _install_lib_dirs ${WORKBENCH_SITE_PACKAGES})
endif()
else()
set(_install_lib_dirs "${SITE_PACKAGES}")
endif()
add_python_package(mantidqt INSTALL_LIB_DIRS ${_install_lib_dirs})
# Now add any compiled sip targets
add_subdirectory(mantidqt)
# Setup dependency chain
add_dependencies(mantidqt PythonInterface)
if(ENABLE_WORKBENCH)
# Configure resources data in place for ease of development. The output file
# is added to the toplevel gitignore
set(_qrc_file ${CMAKE_CURRENT_LIST_DIR}/resources.qrc)
set(_output_res_py ${CMAKE_CURRENT_LIST_DIR}/mantidqt/resources.py)
configure_file(create_resources.cmake.in create_resources.cmake @ONLY)
add_custom_command(
OUTPUT ${_output_res_py}
COMMAND ${CMAKE_COMMAND} -P create_resources.cmake
COMMENT "Generating mantidqt resources module"
DEPENDS ${_qrc_file}
)
add_custom_target(mantidqt_resources ALL DEPENDS ${_output_res_py})
add_dependencies(
mantidqt mantidqt_resources mantidqt_commonqt5 mantidqt_instrumentviewqt5 mantidqt_iconsqt5
)
if(MSVC)
# Debug builds need libraries that are linked with MSVC debug runtime
add_custom_command(
TARGET mantidqt POST_BUILD
COMMAND
if 1==$<CONFIG:Debug> ${CMAKE_COMMAND} -E copy_directory
${MSVC_PYTHON_EXECUTABLE_DIR}/msvc-site-packages/debug/PyQt5
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/PyQt5
COMMENT "Copying debug PyQt5 to bin/Debug"
)
endif()
endif()
# Testing
add_dependencies(GUITests mantidqt)
# ctest targets
set(PYTHON_TEST_FILES
mantidqt/test/test_algorithm_observer.py
mantidqt/test/test_import.py
mantidqt/dialogs/errorreports/test/test_errorreport_presenter.py
mantidqt/dialogs/test/test_algorithm_dialog.py
mantidqt/dialogs/test/test_spectraselectiondialog.py
mantidqt/dialogs/test/test_spectraselectorutils.py
mantidqt/plotting/test/test_figuretype.py
mantidqt/plotting/test/test_functions.py
mantidqt/plotting/test/test_tiledplots.py
mantidqt/project/test/test_plotssaver.py
mantidqt/project/test/test_plotsloader.py
mantidqt/project/test/test_project.py
mantidqt/project/test/test_projectloader.py
mantidqt/project/test/test_projectsaver.py
mantidqt/project/test/test_workspaceloader.py
mantidqt/project/test/test_workspacesaver.py
mantidqt/project/test/test_projectparser_mantidplot.py
mantidqt/utils/test/test_async.py
mantidqt/utils/test/test_async_qt_adaptor.py
mantidqt/utils/test/test_modal_tester.py
mantidqt/utils/test/test_qt_utils.py
mantidqt/utils/test/test_writetosignal.py
mantidqt/utils/qt/test/test_line_edit_double_validator.py
mantidqt/utils/qt/test/test_qappthreadcall.py
mantidqt/widgets/test/test_messagedisplay.py
mantidqt/widgets/test/test_fitpropertybrowser.py
mantidqt/widgets/test/test_fitpropertybrowserbase.py
mantidqt/widgets/test/test_fitpropertybrowserplotinteraction.py
mantidqt/widgets/test/test_functionbrowser.py
mantidqt/widgets/samplelogs/test/test_samplelogs_model.py
mantidqt/widgets/samplelogs/test/test_samplelogs_presenter.py
mantidqt/widgets/observers/test/test_ads_observer.py
mantidqt/widgets/observers/test/test_observing_presenter.py
mantidqt/widgets/observers/test/test_observing_view.py
mantidqt/widgets/embedded_find_replace_dialog/test/test_embedded_find_replace_dialog_presenter.py
)
if(ENABLE_WORKBENCH)
# ctest target for widgets that only get tested in qt5, because they are
# only used in the workbench
set(PYTHON_WIDGET_QT5_ONLY_TESTS
mantidqt/widgets/algorithmselector/test/test_algorithm_factory_observer.py
mantidqt/widgets/algorithmselector/test/test_algorithmselector.py
mantidqt/widgets/codeeditor/test/test_codeeditor.py
mantidqt/widgets/codeeditor/test/test_completion.py
mantidqt/widgets/codeeditor/test/test_execution.py
mantidqt/widgets/codeeditor/test/test_errorformatter.py
mantidqt/widgets/codeeditor/test/test_interpreter.py
mantidqt/widgets/codeeditor/test/test_interpreter_view.py
mantidqt/widgets/codeeditor/test/test_multifileinterpreter.py
mantidqt/widgets/codeeditor/test/test_multifileinterpreter_view.py
mantidqt/widgets/codeeditor/tab_widget/test/test_codeeditor_tab_presenter.py
mantidqt/widgets/codeeditor/tab_widget/test/test_codeeditor_tab_view.py
mantidqt/widgets/fitpropertybrowser/addfunctiondialog/test/test_addfunctiondialogpresenter.py
mantidqt/widgets/fitpropertybrowser/addfunctiondialog/test/test_addfunctiondialogview.py
mantidqt/widgets/instrumentview/test/test_instrumentview_io.py
mantidqt/widgets/instrumentview/test/test_instrumentview_view.py
mantidqt/widgets/memorywidget/test/test_memoryinfo.py
mantidqt/widgets/memorywidget/test/test_memorypresenter.py
mantidqt/widgets/plotconfigdialog/axestabwidget/test/test_axestabwidgetpresenter.py
mantidqt/widgets/plotconfigdialog/curvestabwidget/test/test_curveproperties.py
mantidqt/widgets/plotconfigdialog/curvestabwidget/test/test_curvestabwidgetpresenter.py
mantidqt/widgets/plotconfigdialog/curvestabwidget/test/test_markertabwidget_view.py
mantidqt/widgets/plotconfigdialog/test/test_apply_all_properties.py
mantidqt/widgets/plotconfigdialog/imagestabwidget/test/test_imagestabwidgetpresenter.py
mantidqt/widgets/plotconfigdialog/test/test_plotconfigdialogpresenter.py
mantidqt/widgets/samplelogs/test/test_samplelogs_view.py
mantidqt/widgets/samplematerialdialog/test/test_samplematerial_presenter.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_cursortracker.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_imageinfowidget.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_model.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_movemousecursor.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_presenter.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_sliceinfo.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_transform.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_view.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_zoom.py
mantidqt/widgets/sliceviewer/peaksviewer/test/test_peaksviewer_actions.py
mantidqt/widgets/sliceviewer/peaksviewer/test/test_peaksviewer_model.py
mantidqt/widgets/sliceviewer/peaksviewer/test/test_peaksviewer_presenter.py
mantidqt/widgets/sliceviewer/peaksviewer/test/test_peaksviewer_view.py
mantidqt/widgets/sliceviewer/peaksviewer/test/test_peaksviewer_peaksviewercollectionpresenter.py
mantidqt/widgets/sliceviewer/peaksviewer/test/test_peaksviewer_peaksworkspaceselectormodel.py
mantidqt/widgets/sliceviewer/peaksviewer/test/test_peaksviewer_peaksworkspaceselectorpresenter.py
mantidqt/widgets/sliceviewer/peaksviewer/test/test_peaksviewer_sliceviewer_add_delete_peaks_integration.py
mantidqt/widgets/sliceviewer/peaksviewer/representation/test/test_peaksviewer_representation_alpha.py
mantidqt/widgets/sliceviewer/peaksviewer/representation/test/test_peaksviewer_representation_draw.py
mantidqt/widgets/sliceviewer/peaksviewer/representation/test/test_peaksviewer_representation_painter.py
mantidqt/widgets/sliceviewer/peaksviewer/representation/test/test_peaksviewer_representation_nonintegrated.py
mantidqt/widgets/sliceviewer/peaksviewer/representation/test/test_peaksviewer_representation_ellipsoid.py
mantidqt/widgets/superplot/test/test_superplot_model.py
mantidqt/widgets/superplot/test/test_superplot_presenter.py
mantidqt/widgets/superplot/test/test_superplot_view.py
mantidqt/widgets/test/test_jupyterconsole.py
mantidqt/widgets/workspacecalculator/test/test_workspacecalculator_view.py
mantidqt/widgets/workspacecalculator/test/test_workspacecalculator_presenter.py
mantidqt/widgets/workspacecalculator/test/test_workspacecalculator_model.py
mantidqt/widgets/workspacedisplay/test/test_data_copier.py
mantidqt/widgets/workspacedisplay/test/test_workspacedisplay_view.py
mantidqt/widgets/workspacedisplay/test/test_user_notifier.py
mantidqt/widgets/workspacedisplay/matrix/test/test_matrixworkspacedisplay_model.py
mantidqt/widgets/workspacedisplay/matrix/test/test_matrixworkspacedisplay_presenter.py
mantidqt/widgets/workspacedisplay/matrix/test/test_matrixworkspacedisplay_table_view_model.py
mantidqt/widgets/workspacedisplay/matrix/test/test_matrixworkspacedisplay_view.py
mantidqt/widgets/workspacedisplay/matrix/test/test_matrixworkspacedisplay_io.py
mantidqt/widgets/workspacedisplay/table/test/test_tableworkspacedisplay_error_column.py
mantidqt/widgets/workspacedisplay/table/test/test_tableworkspacedisplay_marked_columns.py
mantidqt/widgets/workspacedisplay/table/test/test_tableworkspacedisplay_tableworkspace_item.py
mantidqt/widgets/workspacedisplay/table/test/test_tableworkspacedisplay_model.py
mantidqt/widgets/workspacedisplay/table/test/test_tableworkspacedisplay_presenter.py
mantidqt/widgets/workspacedisplay/table/test/test_tableworkspacedisplay_view.py
mantidqt/widgets/workspacedisplay/table/test/test_tableworkspacedisplay_io.py
mantidqt/widgets/workspacewidget/test/test_workspacetreewidget.py
mantidqt/icons/test/test_icons.py
)
# Tests
set(PYUNITTEST_QT_API pyqt5)
pyunittest_add_test(
${CMAKE_CURRENT_SOURCE_DIR} mantidqt_qt5 ${PYTHON_TEST_FILES}
${PYTHON_WIDGET_QT5_ONLY_TESTS}
)
endif()
add_subdirectory(mantidqtinterfaces)
endif()
include(SipQtTargetFunctions)
set(COMMON_INC_DIR ${CMAKE_CURRENT_LIST_DIR}/../../widgets/common/inc)
set(COMMON_SIP_DIR ${CMAKE_CURRENT_LIST_DIR}/../sip)
set(_header_depends
${COMMON_SIP_DIR}/vector.sip.h
${COMMON_SIP_DIR}/string.sip
${COMMON_SIP_DIR}/vector.sip
${COMMON_INC_DIR}/MantidQtWidgets/Common/AlgorithmDialog.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/Message.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/MessageDisplay.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/WorkspacePresenter/WorkspaceTreeWidget.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/HintStrategy.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/Hint.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/Batch/Row.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/Batch/RowLocation.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/Batch/JobTreeView.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/Batch/JobTreeViewSignalAdapter.h
${COMMON_INC_DIR}/MantidQtWidgets/Common/InstrumentSelector.h
)
list(APPEND common_link_libs ${CORE_MANTIDLIBS} ${POCO_LIBRARIES}
PythonInterfaceCore
)
# Wrapper module linked against Qt5
# This file manages building/installation of the mantidqt and mantidqtpython
# Python wrappers.
include(PythonPackageTargetFunctions)
# mantidqt
if(ENABLE_WORKBENCH)
mtd_add_sip_module(
MODULE_NAME _commonqt5
TARGET_NAME mantidqt_commonqt5
HEADER_DEPS ${_header_depends}
SIP_SRC _common.sip
PYQT_VERSION 5
INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR} ${COMMON_SIP_DIR}
LINK_LIBS MantidQtWidgetsCommonQt5
${common_link_libs}
Qt5::Core
Qt5::Widgets
Qt5::Gui
Qt5::Qscintilla
API
INSTALL_DIR ${WORKBENCH_SITE_PACKAGES}/mantidqt
LINUX_INSTALL_RPATH "\$ORIGIN/.."
OSX_INSTALL_RPATH "@loader_path/.."
FOLDER Qt5
if(APPLE)
set(_install_lib_dirs)
if(ENABLE_WORKBENCH)
list(APPEND _install_lib_dirs ${WORKBENCH_SITE_PACKAGES})
endif()
else()
set(_install_lib_dirs "${SITE_PACKAGES}")
endif()
add_python_package(mantidqt INSTALL_LIB_DIRS ${_install_lib_dirs})
# Now add any compiled sip targets
add_subdirectory(mantidqt)
# Setup dependency chain
add_dependencies(mantidqt PythonInterface)
if(ENABLE_WORKBENCH)
# Configure resources data in place for ease of development. The output file
# is added to the toplevel gitignore
set(_qrc_file ${CMAKE_CURRENT_LIST_DIR}/resources.qrc)
set(_output_res_py ${CMAKE_CURRENT_LIST_DIR}/mantidqt/resources.py)
configure_file(create_resources.cmake.in create_resources.cmake @ONLY)
add_custom_command(
OUTPUT ${_output_res_py}
COMMAND ${CMAKE_COMMAND} -P create_resources.cmake
COMMENT "Generating mantidqt resources module"
DEPENDS ${_qrc_file}
)
add_custom_target(mantidqt_resources ALL DEPENDS ${_output_res_py})
add_dependencies(
mantidqt mantidqt_resources mantidqt_commonqt5 mantidqt_instrumentviewqt5 mantidqt_iconsqt5
)
if(MSVC)
# Debug builds need libraries that are linked with MSVC debug runtime
add_custom_command(
TARGET mantidqt POST_BUILD
COMMAND
if 1==$<CONFIG:Debug> ${CMAKE_COMMAND} -E copy_directory
${MSVC_PYTHON_EXECUTABLE_DIR}/msvc-site-packages/debug/PyQt5
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/PyQt5
COMMENT "Copying debug PyQt5 to bin/Debug"
)
endif()
endif()
# Testing
add_dependencies(GUITests mantidqt)
# ctest targets
set(PYTHON_TEST_FILES
mantidqt/test/test_algorithm_observer.py
mantidqt/test/test_import.py
mantidqt/dialogs/errorreports/test/test_errorreport_presenter.py
mantidqt/dialogs/test/test_algorithm_dialog.py
mantidqt/dialogs/test/test_spectraselectiondialog.py
mantidqt/dialogs/test/test_spectraselectorutils.py
mantidqt/plotting/test/test_figuretype.py
mantidqt/plotting/test/test_functions.py
mantidqt/plotting/test/test_tiledplots.py
mantidqt/project/test/test_plotssaver.py
mantidqt/project/test/test_plotsloader.py
mantidqt/project/test/test_project.py
mantidqt/project/test/test_projectloader.py
mantidqt/project/test/test_projectsaver.py
mantidqt/project/test/test_workspaceloader.py
mantidqt/project/test/test_workspacesaver.py
mantidqt/project/test/test_projectparser_mantidplot.py
mantidqt/utils/test/test_async.py
mantidqt/utils/test/test_async_qt_adaptor.py
mantidqt/utils/test/test_modal_tester.py
mantidqt/utils/test/test_qt_utils.py
mantidqt/utils/test/test_writetosignal.py
mantidqt/utils/qt/test/test_line_edit_double_validator.py
mantidqt/utils/qt/test/test_qappthreadcall.py
mantidqt/widgets/test/test_messagedisplay.py
mantidqt/widgets/test/test_fitpropertybrowser.py
mantidqt/widgets/test/test_fitpropertybrowserbase.py
mantidqt/widgets/test/test_fitpropertybrowserplotinteraction.py
mantidqt/widgets/test/test_functionbrowser.py
mantidqt/widgets/samplelogs/test/test_samplelogs_model.py
mantidqt/widgets/samplelogs/test/test_samplelogs_presenter.py
mantidqt/widgets/observers/test/test_ads_observer.py
mantidqt/widgets/observers/test/test_observing_presenter.py
mantidqt/widgets/observers/test/test_observing_view.py
mantidqt/widgets/embedded_find_replace_dialog/test/test_embedded_find_replace_dialog_presenter.py
)
endif()
add_subdirectory(icons)
add_subdirectory(widgets/instrumentview)
if(ENABLE_WORKBENCH)
# ctest target for widgets that only get tested in qt5, because they are
# only used in the workbench
set(PYTHON_WIDGET_QT5_ONLY_TESTS
mantidqt/widgets/algorithmselector/test/test_algorithm_factory_observer.py
mantidqt/widgets/algorithmselector/test/test_algorithmselector.py
mantidqt/widgets/codeeditor/test/test_codeeditor.py
mantidqt/widgets/codeeditor/test/test_completion.py
mantidqt/widgets/codeeditor/test/test_execution.py
mantidqt/widgets/codeeditor/test/test_errorformatter.py
mantidqt/widgets/codeeditor/test/test_interpreter.py
mantidqt/widgets/codeeditor/test/test_interpreter_view.py
mantidqt/widgets/codeeditor/test/test_multifileinterpreter.py
mantidqt/widgets/codeeditor/test/test_multifileinterpreter_view.py
mantidqt/widgets/codeeditor/tab_widget/test/test_codeeditor_tab_presenter.py
mantidqt/widgets/codeeditor/tab_widget/test/test_codeeditor_tab_view.py
mantidqt/widgets/fitpropertybrowser/addfunctiondialog/test/test_addfunctiondialogpresenter.py
mantidqt/widgets/fitpropertybrowser/addfunctiondialog/test/test_addfunctiondialogview.py
mantidqt/widgets/instrumentview/test/test_instrumentview_io.py
mantidqt/widgets/instrumentview/test/test_instrumentview_view.py
mantidqt/widgets/memorywidget/test/test_memoryinfo.py
mantidqt/widgets/memorywidget/test/test_memorypresenter.py
mantidqt/widgets/plotconfigdialog/axestabwidget/test/test_axestabwidgetpresenter.py
mantidqt/widgets/plotconfigdialog/curvestabwidget/test/test_curveproperties.py
mantidqt/widgets/plotconfigdialog/curvestabwidget/test/test_curvestabwidgetpresenter.py
mantidqt/widgets/plotconfigdialog/curvestabwidget/test/test_markertabwidget_view.py
mantidqt/widgets/plotconfigdialog/test/test_apply_all_properties.py
mantidqt/widgets/plotconfigdialog/imagestabwidget/test/test_imagestabwidgetpresenter.py
mantidqt/widgets/plotconfigdialog/test/test_plotconfigdialogpresenter.py
mantidqt/widgets/samplelogs/test/test_samplelogs_view.py
mantidqt/widgets/samplematerialdialog/test/test_samplematerial_presenter.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_cursortracker.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_imageinfowidget.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_model.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_movemousecursor.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_presenter.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_sliceinfo.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_transform.py
mantidqt/widgets/sliceviewer/test/test_sliceviewer_view.py