diff --git a/Code/Mantid/MantidQt/API/CMakeLists.txt b/Code/Mantid/MantidQt/API/CMakeLists.txt index 60554c9efc809ade8d70b97f5edc5de3df5d6219..0f060ef593b32d408929416bae95616ab0db8a3b 100644 --- a/Code/Mantid/MantidQt/API/CMakeLists.txt +++ b/Code/Mantid/MantidQt/API/CMakeLists.txt @@ -16,7 +16,6 @@ set ( SRC_FILES src/PropertyWidget.cpp src/PropertyWidgetFactory.cpp src/PythonRunner.cpp - src/SafeQwtPlot.cpp src/SyncedCheckboxes.cpp src/TextPropertyWidget.cpp src/UserSubWindow.cpp @@ -47,7 +46,6 @@ set ( INC_FILES inc/MantidQtAPI/PropertyWidget.h inc/MantidQtAPI/PropertyWidgetFactory.h inc/MantidQtAPI/PythonRunner.h - inc/MantidQtAPI/SafeQwtPlot.h inc/MantidQtAPI/SyncedCheckboxes.h inc/MantidQtAPI/TextPropertyWidget.h inc/MantidQtAPI/UserSubWindow.h diff --git a/Code/Mantid/MantidQt/CMakeLists.txt b/Code/Mantid/MantidQt/CMakeLists.txt index ab6d945fc17cde86152b29537d70e9af7059a505..03ff5b13cb664c3021971b8ecd0ba2c06055da38 100644 --- a/Code/Mantid/MantidQt/CMakeLists.txt +++ b/Code/Mantid/MantidQt/CMakeLists.txt @@ -113,6 +113,7 @@ include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ) # Other folders that need to be included... include_directories ( ${CMAKE_CURRENT_SOURCE_DIR}/SliceViewer/inc ) +include_directories ( ${CMAKE_CURRENT_SOURCE_DIR}/MantidWidgets/inc ) include_directories ( ${CMAKE_CURRENT_BINARY_DIR}/SliceViewer ) # to find the ui_*.h auto-generated files # This creates the target library, just for python bindings diff --git a/Code/Mantid/MantidQt/DesignerPlugins/inc/MantidQtDesignerPlugins/PluginCollectionInterface.h b/Code/Mantid/MantidQt/DesignerPlugins/inc/MantidQtDesignerPlugins/PluginCollectionInterface.h index 4b1f404c25d0ca874688f96fbf436085ed9b8809..b4e1e05f9e6d077fcb981d55322e49e8cff363bd 100644 --- a/Code/Mantid/MantidQt/DesignerPlugins/inc/MantidQtDesignerPlugins/PluginCollectionInterface.h +++ b/Code/Mantid/MantidQt/DesignerPlugins/inc/MantidQtDesignerPlugins/PluginCollectionInterface.h @@ -12,6 +12,9 @@ #include "MantidQtMantidWidgets/InstrumentSelector.h" #include "MantidQtMantidWidgets/WorkspaceSelector.h" #include "MantidQtSliceViewer/ColorBarWidget.h" +#include "MantidQtSliceViewer/SliceViewer.h" +#include "MantidQtSliceViewer/LineViewer.h" +#include "MantidQtMantidWidgets/SafeQwtPlot.h" /** The PluginCollectionInterface implements the interface for the plugin library and holds a @@ -113,4 +116,16 @@ DECLARE_WIDGET_PLUGIN(ColorBarWidgetPlugin, MantidQt::SliceViewer::ColorBarWidget, "Shows a color scale and allow user to change it"); +DECLARE_WIDGET_PLUGIN(SliceViewerPlugin, + MantidQt::SliceViewer::SliceViewer, + "Shows 2D slices of MDWorkspaces"); + +DECLARE_WIDGET_PLUGIN(LineViewerPlugin, + MantidQt::SliceViewer::LineViewer, + "Shows 1D lines selected in a LineViewer"); + +DECLARE_WIDGET_PLUGIN(SafeQwtPlotPlugin, + MantidQt::MantidWidgets::SafeQwtPlot, + "Version of QwtPlot with workspace-level thread safety"); + #endif diff --git a/Code/Mantid/MantidQt/DesignerPlugins/src/PluginCollectionInterface.cpp b/Code/Mantid/MantidQt/DesignerPlugins/src/PluginCollectionInterface.cpp index 192bf55cf07a2ac7eaaca2b2eb618f1b943ca0c0..1e0626a0baf094d13fa5992377e26b996b776007 100644 --- a/Code/Mantid/MantidQt/DesignerPlugins/src/PluginCollectionInterface.cpp +++ b/Code/Mantid/MantidQt/DesignerPlugins/src/PluginCollectionInterface.cpp @@ -18,6 +18,9 @@ PluginCollectionInterface::PluginCollectionInterface(QObject *parent) : QObject( m_widgets.append(new ScriptEditorPlugin(this)); m_widgets.append(new AlgorithmSelectorWidgetPlugin(this)); m_widgets.append(new ColorBarWidgetPlugin(this)); + m_widgets.append(new SliceViewerPlugin(this)); + m_widgets.append(new LineViewerPlugin(this)); + m_widgets.append(new SafeQwtPlotPlugin(this)); m_widgets.append(new FitBrowserPlugin(this)); m_widgets.append(new MuonFitBrowserPlugin(this)); diff --git a/Code/Mantid/MantidQt/Factory/CMakeLists.txt b/Code/Mantid/MantidQt/Factory/CMakeLists.txt index 1545e3877071b1ad3d0aa2fee7bf5e4d6a120bbd..266c5a0c26b29b4c04956cac4dde49062149f77c 100644 --- a/Code/Mantid/MantidQt/Factory/CMakeLists.txt +++ b/Code/Mantid/MantidQt/Factory/CMakeLists.txt @@ -19,6 +19,7 @@ set ( TEST_FILES include_directories ( inc ) include_directories ( ../SliceViewer/inc ) +include_directories ( ../MantidWidgets/inc ) ########################################################################### # Main Library Target diff --git a/Code/Mantid/MantidQt/MantidWidgets/CMakeLists.txt b/Code/Mantid/MantidQt/MantidWidgets/CMakeLists.txt index 500a64553d539d22a46d99cf053021265bcf3393..fe87e9df0fb17d26507f8d2900147ce81f51962b 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/CMakeLists.txt +++ b/Code/Mantid/MantidQt/MantidWidgets/CMakeLists.txt @@ -15,6 +15,7 @@ set ( SRC_FILES src/PropertyHandler.cpp src/RangeSelector.cpp src/RenameParDialog.cpp + src/SafeQwtPlot.cpp src/SaveWorkspaces.cpp src/ScriptEditor.cpp src/SelectWorkspacesDialog.cpp @@ -29,34 +30,7 @@ set ( SRC_UNITY_IGNORE_FILES src/ICatSearch.cpp ) -# Include files aren't required, but this makes them appear in Visual Studio -set ( INC_FILES - inc/MantidQtMantidWidgets/AlgorithmSelectorWidget.h - inc/MantidQtMantidWidgets/DiagResults.h - inc/MantidQtMantidWidgets/FitPropertyBrowser.h - inc/MantidQtMantidWidgets/ICatAdvancedSearch.h - inc/MantidQtMantidWidgets/ICatInvestigation.h - inc/MantidQtMantidWidgets/ICatMyDataSearch.h - inc/MantidQtMantidWidgets/ICatSearch.h - inc/MantidQtMantidWidgets/ICatUtils.h - inc/MantidQtMantidWidgets/InstrumentSelector.h - inc/MantidQtMantidWidgets/MWDiag.h - inc/MantidQtMantidWidgets/MWRunFiles.h - inc/MantidQtMantidWidgets/MultifitSetupDialog.h - inc/MantidQtMantidWidgets/MuonFitPropertyBrowser.h - inc/MantidQtMantidWidgets/PropertyHandler.h - inc/MantidQtMantidWidgets/RangeSelector.h - inc/MantidQtMantidWidgets/RenameParDialog.h - inc/MantidQtMantidWidgets/SaveWorkspaces.h - inc/MantidQtMantidWidgets/ScriptEditor.h - inc/MantidQtMantidWidgets/SelectWorkspacesDialog.h - inc/MantidQtMantidWidgets/SequentialFitDialog.h - inc/MantidQtMantidWidgets/UserFunctionDialog.h - inc/MantidQtMantidWidgets/WidgetDllOption.h - inc/MantidQtMantidWidgets/WorkspaceSelector.h - inc/MantidQtMantidWidgets/pythonCalc.h -) - +# Header files with Q_OBJECT that qmake will "moc" set ( MOC_FILES inc/MantidQtMantidWidgets/AlgorithmSelectorWidget.h inc/MantidQtMantidWidgets/DiagResults.h @@ -75,6 +49,7 @@ set ( MOC_FILES inc/MantidQtMantidWidgets/pythonCalc.h inc/MantidQtMantidWidgets/RangeSelector.h inc/MantidQtMantidWidgets/RenameParDialog.h + inc/MantidQtMantidWidgets/SafeQwtPlot.h inc/MantidQtMantidWidgets/SaveWorkspaces.h inc/MantidQtMantidWidgets/ScriptEditor.h inc/MantidQtMantidWidgets/SelectWorkspacesDialog.h @@ -83,6 +58,13 @@ set ( MOC_FILES inc/MantidQtMantidWidgets/WorkspaceSelector.h ) +# Add the include files are NOT already in MOC_FILES +set ( INC_FILES + ${MOC_FILES} + inc/MantidQtMantidWidgets/WidgetDllOption.h +) + +# QtDesigner UI files to process set ( UI_FILES inc/MantidQtMantidWidgets/ICatAdvancedSearch.ui inc/MantidQtMantidWidgets/ICatInvestigation.ui diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/SafeQwtPlot.h b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/SafeQwtPlot.h similarity index 90% rename from Code/Mantid/MantidQt/API/inc/MantidQtAPI/SafeQwtPlot.h rename to Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/SafeQwtPlot.h index cbc04396ef26e07dcde5d2671d3ae4acd9dd9601..8163e3d771dac5aca2c2e172ed0861fe2a877e99 100644 --- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/SafeQwtPlot.h +++ b/Code/Mantid/MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/SafeQwtPlot.h @@ -1,5 +1,5 @@ -#ifndef MANTID_API_SAFEQWTPLOT_H_ -#define MANTID_API_SAFEQWTPLOT_H_ +#ifndef MANTID_MANTIDWIDGETS_SAFEQWTPLOT_H_ +#define MANTID_MANTIDWIDGETS_SAFEQWTPLOT_H_ #include "MantidKernel/System.h" #include <qwt_plot.h> @@ -10,7 +10,7 @@ namespace MantidQt { -namespace API +namespace MantidWidgets { /** A version of QwtPlot that adds a layer of thread safety. @@ -46,6 +46,8 @@ namespace API */ class DLLExport SafeQwtPlot : public QwtPlot { + Q_OBJECT + public: explicit SafeQwtPlot(QWidget * parent = NULL); explicit SafeQwtPlot(const QwtText &title, QWidget *p = NULL); @@ -62,7 +64,7 @@ namespace API }; -} // namespace API +} // namespace MantidWidgets } // namespace MantidQt -#endif /* MANTID_API_SAFEQWTPLOT_H_ */ +#endif /* MANTID_MANTIDWIDGETS_SAFEQWTPLOT_H_ */ diff --git a/Code/Mantid/MantidQt/API/src/SafeQwtPlot.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/SafeQwtPlot.cpp similarity index 94% rename from Code/Mantid/MantidQt/API/src/SafeQwtPlot.cpp rename to Code/Mantid/MantidQt/MantidWidgets/src/SafeQwtPlot.cpp index 8bf0d0dcf69dc951ec5a7e0c177259336a96b874..1445e1d033273895e367fa0fb33f17471cea2a20 100644 --- a/Code/Mantid/MantidQt/API/src/SafeQwtPlot.cpp +++ b/Code/Mantid/MantidQt/MantidWidgets/src/SafeQwtPlot.cpp @@ -1,4 +1,4 @@ -#include "MantidQtAPI/SafeQwtPlot.h" +#include "MantidQtMantidWidgets/SafeQwtPlot.h" #include "MantidKernel/System.h" #include "MantidKernel/ReadLock.h" @@ -6,7 +6,7 @@ using namespace Mantid::Kernel; namespace MantidQt { -namespace API +namespace MantidWidgets { @@ -63,4 +63,4 @@ namespace API } } // namespace MantidQt -} // namespace API +} // namespace MantidWidgets diff --git a/Code/Mantid/MantidQt/SliceViewer/CMakeLists.txt b/Code/Mantid/MantidQt/SliceViewer/CMakeLists.txt index 854d3288280b0e0849df47d350ce2df0e7fa50d0..2703d1ce574cbf2a5827d4aef74850839d377324 100644 --- a/Code/Mantid/MantidQt/SliceViewer/CMakeLists.txt +++ b/Code/Mantid/MantidQt/SliceViewer/CMakeLists.txt @@ -62,6 +62,7 @@ set ( TEST_PY_FILES include_directories ( inc ) include_directories ( ../../QtPropertyBrowser/src ) +include_directories ( ../MantidWidgets/inc ) ########################################################################### diff --git a/Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/SliceViewer.h b/Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/SliceViewer.h index 2f9556365f594aea486fd85e19bc0dc1d42ea47c..3160ebc58f11d59fb03a513dfc2a887d22a298cd 100644 --- a/Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/SliceViewer.h +++ b/Code/Mantid/MantidQt/SliceViewer/inc/MantidQtSliceViewer/SliceViewer.h @@ -9,7 +9,7 @@ #include "MantidGeometry/MDGeometry/MDHistoDimension.h" #include "MantidKernel/VMD.h" #include "MantidQtAPI/MantidColorMap.h" -#include "MantidQtAPI/SafeQwtPlot.h" +#include "MantidQtMantidWidgets/SafeQwtPlot.h" #include "MantidQtAPI/SyncedCheckboxes.h" #include "MantidQtSliceViewer/LineOverlay.h" #include "QwtRasterDataMD.h" @@ -140,7 +140,7 @@ private: Ui::SliceViewerClass ui; /// Main plot object - MantidQt::API::SafeQwtPlot * m_plot; + MantidQt::MantidWidgets::SafeQwtPlot * m_plot; /// Spectrogram plot QwtPlotSpectrogram * m_spect; diff --git a/Code/Mantid/MantidQt/SliceViewer/src/SliceViewer.cpp b/Code/Mantid/MantidQt/SliceViewer/src/SliceViewer.cpp index 9aff59fa076dd5bd88cddf38721940308186a3ad..90899236a5d6dd4fd5e7f70d0245ca5a9e70cb6e 100644 --- a/Code/Mantid/MantidQt/SliceViewer/src/SliceViewer.cpp +++ b/Code/Mantid/MantidQt/SliceViewer/src/SliceViewer.cpp @@ -49,7 +49,7 @@ #include <vector> #include "MantidKernel/V3D.h" #include "MantidKernel/ReadLock.h" -#include "MantidQtAPI/SafeQwtPlot.h" +#include "MantidQtMantidWidgets/SafeQwtPlot.h" #include "MantidKernel/MultiThreaded.h" @@ -65,7 +65,6 @@ using Poco::XML::Node; using Poco::XML::NodeList; using Poco::XML::NodeIterator; using Poco::XML::NodeFilter; -using MantidQt::API::SafeQwtPlot; namespace MantidQt { @@ -89,7 +88,7 @@ SliceViewer::SliceViewer(QWidget *parent) // Create the plot m_spectLayout = new QHBoxLayout(ui.frmPlot); - m_plot = new SafeQwtPlot(); + m_plot = new MantidQt::MantidWidgets::SafeQwtPlot(); m_plot->autoRefresh(); m_spectLayout->addWidget(m_plot, 1, 0);