-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs #3803. Make a new MuonFitPropertyBrowser.
Inherit from FitPropertyBrowser and be modified for muon use.
- Loading branch information
1 parent
954f35b
commit 0f66f22
Showing
15 changed files
with
901 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
Code/Mantid/MantidQt/DesignerPlugins/inc/MantidQtDesignerPlugins/MuonFitBrowserPlugin.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#ifndef MUONFITBROWSERPLUGIN_H | ||
#define MUONFITBROWSERPLUGIN_H | ||
|
||
#include <QDesignerCustomWidgetInterface> | ||
|
||
/** | ||
The MuonFitBrowserPlugin creates a Qt designer plugin of the FitPropertyBrowser. | ||
@author Robert Whitley, ISIS, RAL | ||
@date 27/02/2012 | ||
Copyright © 2010-12 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory | ||
This file is part of Mantid. | ||
Mantid is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 3 of the License, or | ||
(at your option) any later version. | ||
Mantid 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 General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid> | ||
*/ | ||
class MuonFitBrowserPlugin : public QObject, public QDesignerCustomWidgetInterface | ||
{ | ||
Q_OBJECT | ||
Q_INTERFACES(QDesignerCustomWidgetInterface) | ||
|
||
public: | ||
/// Default constructor | ||
MuonFitBrowserPlugin(QObject *parent = 0); | ||
/// Initialize the plugin | ||
void initialize(QDesignerFormEditorInterface *core); | ||
/// Returns a pointer to a newly constructed widget for this plugin wraps | ||
QWidget *createWidget(QWidget *parent); | ||
/// Returns if the plugin is initliaized | ||
bool isInitialized() const; | ||
/// Returns if this plugins is able to contain other widgets | ||
bool isContainer() const; | ||
/// Returns the fully-qualified class name | ||
QString name() const; | ||
/// Returns the group name within the designer | ||
QString group() const; | ||
/// Returns the icon to use | ||
QIcon icon() const; | ||
/// Returns a tool tip for the widget | ||
QString toolTip() const; | ||
/// Returns a short description of the widget | ||
QString whatsThis() const; | ||
/// Returns the include file that appears at the top of the generated .h file | ||
QString includeFile() const; | ||
/// Returns the XML that defines the widget and its properties | ||
QString domXml() const; | ||
|
||
private: | ||
/// Are we initialized? | ||
bool m_initialized; | ||
}; | ||
|
||
#endif |
119 changes: 119 additions & 0 deletions
119
Code/Mantid/MantidQt/DesignerPlugins/src/MuonFitBrowserPlugin.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
#include "MantidQtMantidWidgets/MuonFitPropertyBrowser.h" | ||
#include "MantidQtDesignerPlugins/MuonFitBrowserPlugin.h" | ||
#include <QDesignerFormEditorInterface> | ||
#include <QtPlugin> | ||
|
||
|
||
using namespace MantidQt::MantidWidgets; | ||
|
||
/** | ||
* Default constructor | ||
* @param parent :: The parent of the plugin (default: NULL) | ||
*/ | ||
MuonFitBrowserPlugin::MuonFitBrowserPlugin(QObject *parent) : QObject(parent), m_initialized(false) | ||
{ | ||
} | ||
|
||
/** | ||
* Initialize the plugin | ||
* @param formEditor :: A pointer to the interface that will control this plugin | ||
*/ | ||
void MuonFitBrowserPlugin::initialize(QDesignerFormEditorInterface * formEditor) | ||
{ | ||
(void) formEditor; | ||
if (m_initialized) | ||
{ | ||
return; | ||
} | ||
m_initialized = true; | ||
} | ||
|
||
/** | ||
* Create a widget of the type wrapped by the plugin | ||
* @param parent :: The parent widget | ||
* @returns A newly constructed widget for the wrapped type. | ||
*/ | ||
QWidget *MuonFitBrowserPlugin::createWidget(QWidget *parent) | ||
{ | ||
return new MuonFitPropertyBrowser(parent); | ||
} | ||
|
||
/** | ||
* Returns whether the plugin initialized or not | ||
* @returns True if initialize() has been called, false otherwise | ||
*/ | ||
bool MuonFitBrowserPlugin::isInitialized() const | ||
{ | ||
return m_initialized; | ||
} | ||
|
||
/** | ||
* Returns whether this widget can contain other widgets | ||
* @returns True if other widgets can be placed within this widget, false otherwise | ||
*/ | ||
bool MuonFitBrowserPlugin::isContainer() const | ||
{ | ||
return false; | ||
} | ||
|
||
/** | ||
* Returns the class name of the widget that this plugin manages | ||
* @returns A string containing the fully qualified class name of the widget | ||
*/ | ||
QString MuonFitBrowserPlugin::name() const | ||
{ | ||
return "MantidQt::MantidWidgets::MuonFitPropertyBrowser"; | ||
} | ||
|
||
/** | ||
* Returns the group within the designer that this plugin should be placed | ||
* @returns The name of the group of widgets in the designer | ||
*/ | ||
QString MuonFitBrowserPlugin::group() const | ||
{ | ||
return "MantidWidgets"; | ||
} | ||
|
||
/** | ||
* Returns the icon to display in the designer | ||
* @returns An icon that is used within the designer | ||
*/ | ||
QIcon MuonFitBrowserPlugin::icon() const | ||
{ | ||
return QIcon(); | ||
} | ||
|
||
/** | ||
* The tooltip for the widget | ||
* @returns A string containing the tooltip for this widget | ||
*/ | ||
QString MuonFitBrowserPlugin::toolTip() const | ||
{ | ||
return "The menu for fitting functions within Muon Analysis"; | ||
} | ||
|
||
/** A short description of the widget | ||
* @returns A string containing a short description of the widget | ||
*/ | ||
QString MuonFitBrowserPlugin::whatsThis() const | ||
{ | ||
return "The menu for fitting functions within Muon Analysis"; | ||
} | ||
|
||
/** | ||
* The include file to use when generating the header file | ||
* @returns A string containing the path to the widget's header file | ||
*/ | ||
QString MuonFitBrowserPlugin::includeFile() const | ||
{ | ||
return "MantidQtMantidWidgets/MuonFitPropertyBrowser.h"; | ||
} | ||
|
||
/** | ||
* Returns the XML used to define the widget in the designer | ||
* @returns A string containing the XML for the widget | ||
*/ | ||
QString MuonFitBrowserPlugin::domXml() const | ||
{ | ||
return "<widget class=\"MantidQt::MantidWidgets::MuonFitPropertyBrowser\" name=\"fitBrowser\" />"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.