27 #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 mainLayout =
new QVBoxLayout;
47 mainLayout->setMargin(0);
48 mainLayout->setSpacing(0);
52 setLayout(mainLayout);
60 connect(
m_treeView, &QTreeView::customContextMenuRequested,
this,
76 QVector<ParameterItem*> result;
77 QModelIndexList proxyIndexes =
selectionModel()->selectedIndexes();
78 for (
auto proxyIndex : proxyIndexes) {
80 result.push_back(parItem);
120 "JobItem doesn't have sample or instrument model.");
156 if (proxyIndex.isValid())
157 selectionModel()->select(proxyIndex, QItemSelectionModel::Select);
185 message.append(
"Current parameter values cause simulation failure.\n\n");
186 message.append(
jobItem()->getComments());
204 if (
jobItem()->getStatus() ==
"Fitting") {
206 m_treeView->setDragDropMode(QAbstractItemView::NoDragDrop);
209 if (
jobItem()->isValidForFitting())
210 m_treeView->setDragDropMode(QAbstractItemView::DragOnly);
229 QModelIndex index =
m_treeView->currentIndex();
230 QWidget* editor =
m_treeView->indexWidget(index);
233 m_delegate->closeEditor(editor, QAbstractItemDelegate::NoHint);
235 m_treeView->selectionModel()->clearSelection();
#define ASSERT(condition)
Defines class GUIHelpers functions.
Defines class IntensityDataItem.
Defines classes for ParameterTreeItems.
Defines class ParameterTuningDelegate.
Defines class ParameterTuningModel.
Defines class WarningSign.
void setZAxisLocked(bool state)
static const QString P_STATUS
void runJob(const QModelIndex &index)
void restore(JobItem *jobItem)
restore instrument and sample model from backup for given JobItem
void setOnPropertyChange(std::function< void(QString)> f, const void *caller=0)
The ParameterItem class represent a tuning value in a parameter tuning tree.
void setReadOnly(bool isReadOnly)
void setSliderRangeFactor(double value)
void currentLinkChanged(SessionItem *item)
The ParameterTuningModel class represents parameters which can be tuned in real time in ParameterTuni...
ParameterItem * getParameterItem(const QModelIndex &proxyIndex) const
Returns ParameterItem from given proxy index.
ModelMapper * mapper()
Returns the current model mapper of this item. Creates new one if necessary.
SessionModel * model() const
Returns model of this item.
QModelIndex index() const
Returns model index of this item.
The WarningSign controls appearance of WarningSignWidget on top of parent widget.
void clear()
Clears warning message;.
void setWarningMessage(const QString &warningMessage)
Shows warning sign on the screen.
IntensityDataItem * intensityDataItem(SessionItem *parent)
Returns IntensityDataItem contained as a child in givent parent.
QString const & name(EShape k)