11#include <QDoubleValidator>
14#include <QInputDialog>
35 const QString &constraint,
bool othersFixed,
bool allOthersFixed,
36 bool othersTied,
bool logOptionsEnabled)
37 : QWidget(parent), m_index(
index),
m_value(QString::number(
value,
'g', 16)), m_fixed(fixed), m_tie(tie),
38 m_constraint(constraint), m_othersFixed(othersFixed), m_allOthersFixed(allOthersFixed), m_othersTied(othersTied) {
39 auto layout =
new QHBoxLayout(
this);
40 layout->setSpacing(0);
41 layout->setContentsMargins(0, 0, 0, 0);
44 m_editor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
45 this->setFocusPolicy(Qt::StrongFocus);
49 m_button->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
50 m_button->setFocusPolicy(Qt::NoFocus);
54 layout->setStretch(0, 1);
55 layout->setStretch(1, 0);
57 auto setMenu =
new QMenu(
this);
64 setMenu->addSeparator();
66 m_fixAction->setToolTip(
"Fix value of this parameter");
80 setMenu->addSeparator();
101 setMenu->addSeparator();
122 setMenu->addSeparator();
130 m_setAllToLogAction->setToolTip(
"Set all parameters to log value from the relevant workspace");
139 connect(
m_editor, SIGNAL(textEdited(
const QString &)),
this, SLOT(
updateValue(
const QString &)));
178 if (!tie.isEmpty()) {
195 if (!tie.isEmpty()) {
213 if (!constraint.isEmpty()) {
228 if (!constraint.isEmpty()) {
248 if (evn->type() == QEvent::KeyPress) {
249 auto keyEvent =
static_cast<QKeyEvent *
>(evn);
250 if (keyEvent->key() == Qt::Key_F && keyEvent->modifiers() == Qt::ControlModifier &&
m_tie.isEmpty()) {
254 if (
m_tie.isEmpty()) {
283 auto validator =
new QDoubleValidator(
this);
284 validator->setDecimals(16);
287 m_editor->setToolTip(
"Edit local parameter value. Press Ctrl+F to fix/unfix it.");
291 m_editor->setToolTip(
"Edit local parameter tie.");
298 input.setWindowTitle(
"Set a tie.");
299 input.setTextValue(tie);
300 if (input.exec() == QDialog::Accepted) {
301 return input.textValue();
308 input.setWindowTitle(
"Set a constraint.");
309 input.setTextValue(constraint);
310 if (input.exec() == QDialog::Accepted) {
311 return input.textValue();
const std::string & m_value
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index