Mantid
Loading...
Searching...
No Matches
LocalParameterEditor.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include <QWidget>
10
11class QLineEdit;
12class QAction;
13class QPushButton;
14
15namespace MantidQt {
16namespace MantidWidgets {
17
18class EditLocalParameterDialog;
23class LocalParameterEditor : public QWidget {
24 Q_OBJECT
25public:
26 LocalParameterEditor(QWidget *parent, int index, double value, bool fixed, const QString &tie,
27 const QString &constraint, bool othersFixed, bool allOthersFixed, bool othersTied,
28 bool logOptionsEnabled);
29signals:
30 void setAllValues(double /*_t1*/);
31 void fixParameter(int /*_t1*/, bool /*_t2*/);
32 void setAllFixed(bool /*_t1*/);
33 void setTie(int /*_t1*/, QString /*_t2*/);
34 void setTieAll(QString /*_t1*/);
35 void setConstraint(int /*_t1*/, QString /*_t2*/);
36 void setConstraintAll(QString /*_t1*/);
37 void setValueToLog(int /*_t1*/);
39private slots:
40 void setAll();
41 void fixParameter();
42 void fixAll();
43 void unfixAll();
44 void setTie();
45 void removeTie();
46 void setTieAll();
47 void removeAllTies();
48 void setConstraint();
49 void removeConstraint();
50 void setConstraintAll();
52 void updateValue(const QString &value);
53 void setToLog();
54 void setLogOptionsEnabled(bool enabled);
55
56private:
57 bool eventFilter(QObject *widget, QEvent *evn) override;
58 void setEditorState();
59 static QString setTieDialog(const QString &tie);
60 static QString setConstraintDialog(const QString &tie);
61 QLineEdit *m_editor;
62 QPushButton *m_button;
64 QAction *m_fixAction;
77
79 QString m_value;
80 bool m_fixed;
81 QString m_tie;
82 QString m_constraint;
87};
88
89} // namespace MantidWidgets
90} // namespace MantidQt
double value
The value of the point.
Definition: FitMW.cpp:51
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
An editor widget for editing a local parameter value.
static QString setConstraintDialog(const QString &tie)
void removeAllTies()
Remove ties from all parameters.
void removeTie()
Send a signal to remove a tie.
void setLogOptionsEnabled(bool enabled)
Slot: when log checkbox state changes, enable/disable the "set to log" and "set all to log" options.
void unfixAll()
Send a signal to unfix all parameters.
void setToLog()
Send a signal to set value to log.
static QString setTieDialog(const QString &tie)
Open an input dialog to enter a tie expression.
void setAll()
Send a signal to set all parameters to the value in the editor.
void setEditorState()
Set the state of the editor elements (the line editor and the button) according to the state of the p...
void fixAll()
Send a signal to fix all parameters.
bool eventFilter(QObject *widget, QEvent *evn) override
Filter events in the line editor to emulate a shortcut (F to fix/unfix).
void updateValue(const QString &value)
SLOT: when user edits value, make sure m_value is updated.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...