28 #include <QVBoxLayout>
33 , m_parameterTuningModel(nullptr)
35 , m_treeView(new QTreeView)
39 setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
42 m_treeView->setContextMenuPolicy(Qt::CustomContextMenu);
43 m_treeView->setDragDropMode(QAbstractItemView::NoDragDrop);
44 m_treeView->setAttribute(Qt::WA_MacShowFocusRect,
false);
46 auto* resetValuesAction =
new QAction(QIcon(
":/images/undo-variant.svg"),
"Reset values",
this);
47 resetValuesAction->setToolTip(
"Reset parameter tree to initial values");
48 connect(resetValuesAction, &QAction::triggered,
this,
52 toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
53 toolbar->addAction(resetValuesAction);
55 auto* mainLayout =
new QVBoxLayout;
56 mainLayout->setMargin(0);
57 mainLayout->setSpacing(0);
58 mainLayout->addWidget(toolbar);
61 setLayout(mainLayout);
69 connect(
m_treeView, &QTreeView::customContextMenuRequested,
this,
83 QVector<ParameterItem*> result;
86 result.push_back(parItem);
125 throw Error(
"ModelTuningWidget::updateParameterModel() -> Error."
126 "JobItem doesn't have sample or instrument model.");
194 m_treeView->setDragDropMode(QAbstractItemView::NoDragDrop);
197 if (
jobItem()->isValidForFitting())
198 m_treeView->setDragDropMode(QAbstractItemView::DragOnly);
217 QModelIndex index =
m_treeView->currentIndex();
218 QWidget* editor =
m_treeView->indexWidget(index);
221 m_delegate->closeEditor(editor, QAbstractItemDelegate::NoHint);
223 m_treeView->selectionModel()->clearSelection();
232 message.append(
"Current parameter values cause simulation failure.\n\n");
233 message.append(
jobItem()->getComments());
Defines class CautionSign.
Defines class IntensityDataItem.
JobStatus
The JobStatus enum lists the possible states of a job.
@ Fitting
the job is busy fitting
Defines classes for ParameterTreeItems.
Defines class ParameterTuningDelegate.
Defines class ParameterTuningModel.
The CautionSign controls appearance of CautionSignWidget on top of parent widget.
void clear()
Clears caution message;.
void setCautionMessage(const QString &cautionMessage)
Shows caution sign on the screen. If clear of previous caution sign had happened just few msec ago,...
void setZAxisLocked(bool state)
void jobStatusChanged(const JobStatus status)
void runJob(JobItem *jobItem)
void restore(JobItem *jobItem)
restore instrument and sample model from backup for given JobItem
The ParameterItem class represent a tuning value in a parameter tuning tree.
void setReadOnly(bool isReadOnly)
void setSliderRangeFactor(double value)
void currentLinkChanged(ParameterItem *item)
The ParameterTuningModel class represents parameters which can be tuned in real time in ParameterTuni...
QModelIndex indexForItem(ParameterItem *item) const
ParameterItem * getParameterItem(const QModelIndex &index) const
Returns ParameterItem from given index.
SessionModel * model() const
Returns model of this item.
IntensityDataItem * intensityDataItem(SessionItem *parent)
Returns IntensityDataItem contained as a child in givent parent.