Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs #6616. Specialized version of property manager for parameters
- Loading branch information
1 parent
62ba1c1
commit a3210c0
Showing
6 changed files
with
72 additions
and
6 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
17 changes: 17 additions & 0 deletions
17
Code/Mantid/QtPropertyBrowser/src/ParameterPropertyManager.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,17 @@ | ||
#include "ParameterPropertyManager.h" | ||
#include "qtpropertymanager.h" | ||
|
||
ParameterPropertyManager::ParameterPropertyManager(QObject *parent) | ||
: QtDoublePropertyManager(parent) | ||
{} | ||
|
||
/** | ||
* Adds error parameter value to property display | ||
* @param property :: Property we want to display | ||
* @return Text representation of the property | ||
* @see QtAbstractPropertyManager | ||
*/ | ||
QString ParameterPropertyManager::valueText(const QtProperty* property) const | ||
{ | ||
return QtDoublePropertyManager::valueText(property) + " (Error here)"; | ||
} |
42 changes: 42 additions & 0 deletions
42
Code/Mantid/QtPropertyBrowser/src/ParameterPropertyManager.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,42 @@ | ||
#ifndef PARAMETERPROPERTYMANAGER_H | ||
#define PARAMETERPROPERTYMANAGER_H | ||
|
||
#include "qtpropertymanager.h" | ||
|
||
/** ParameterPropertyManager : specialized version of QtDoublePropertyManager for fitting parameters. | ||
Is capable to store/display parameter errors in addition to value. | ||
Copyright © 2014 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://github.com/mantidproject/mantid> | ||
Code Documentation is available at: <http://doxygen.mantidproject.org> | ||
*/ | ||
class ParameterPropertyManager : public QtDoublePropertyManager | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
ParameterPropertyManager(QObject *parent = 0); | ||
|
||
protected: | ||
/// Text representation of the property | ||
virtual QString valueText(const QtProperty *property) const; | ||
}; | ||
|
||
#endif // PARAMETERPROPERTYMANAGER_H |