Skip to content
Snippets Groups Projects
Commit 5c6f18d3 authored by David Li's avatar David Li Committed by Pospelov, Gennady
Browse files

fixing instrument view

parent aa8d72e9
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@ SessionItem::SessionItem(const QString &modelType)
setData(SessionModel::ModelTypeRole, modelType);
setDisplayName(modelType);
setDecimals(3);
}
/*!
......@@ -579,7 +580,7 @@ void SessionItem::emitDataChanged(int role)
{
if (m_model) {
QModelIndex index = m_model->indexOfItem(this);
m_model->dataChanged(index, index, QVector<int>() << role);
m_model->dataChanged(index, index.sibling(index.row(), 1), QVector<int>() << role);
}
}
......
......@@ -20,6 +20,7 @@
#include "GroupInfoBox.h"
#include "GUIHelpers.h"
#include "ComponentInfoBox.h"
#include "BeamDistributionItem.h"
#include <QGroupBox>
#include <QVBoxLayout>
#include <QLabel>
......@@ -97,14 +98,14 @@ void BeamEditorWidget::setBeamItem(BeamItem *beamItem)
m_intensityEditor->addItem(m_beamItem->getItem(BeamItem::P_INTENSITY));
SessionItem *wavelengthItem = m_beamItem->getGroupItem(BeamItem::P_WAVELENGTH);
m_wavelengthPresenter->addPropertyItems(wavelengthItem);
m_wavelengthPresenter->addPropertyItems(wavelengthItem->getItem(BeamDistributionItem::P_DISTRIBUTION));
SessionItem *inclinationAngleItem
= m_beamItem->getGroupItem(BeamItem::P_INCLINATION_ANGLE);
m_inclinationAnglePresenter->addPropertyItems(inclinationAngleItem);
m_inclinationAnglePresenter->addPropertyItems(inclinationAngleItem->getItem(BeamDistributionItem::P_DISTRIBUTION));
SessionItem *azimuthalAngleItem = m_beamItem->getGroupItem(BeamItem::P_AZIMUTHAL_ANGLE);
m_azimuthalAnglePresenter->addPropertyItems(azimuthalAngleItem);
m_azimuthalAnglePresenter->addPropertyItems(azimuthalAngleItem->getItem(BeamDistributionItem::P_DISTRIBUTION));
}
void BeamEditorWidget::onDialogRequest(SessionItem *item, QString name)
......
......@@ -68,8 +68,8 @@ void ComponentBoxEditor::updateItem(SessionItem *item, QtVariantProperty *parent
void ComponentBoxEditor::onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
{
if (topLeft != bottomRight)
return;
// if (topLeft != bottomRight)
// return;
SessionModel *model = qobject_cast<SessionModel *>(sender());
Q_ASSERT(model);
......
......@@ -88,8 +88,8 @@ void ComponentEditor::onDataChanged(const QModelIndex &topLeft,
const QModelIndex &bottomRight,
const QVector<int> &roles)
{
if (topLeft != bottomRight)
return;
// if (topLeft != bottomRight)
// return;
SessionModel *model = qobject_cast<SessionModel *>(sender());
Q_ASSERT(model);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment