Merged develop into feature

--HG--
branch : feature
This commit is contained in:
Bojan Kverh 2016-10-13 19:53:49 +02:00
commit 39afb81321
9 changed files with 25 additions and 4 deletions

View File

@ -68,13 +68,15 @@ void VWidgetDetails::UpdateList()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VWidgetDetails::InLayoutStateChanged(int row, int column) void VWidgetDetails::InLayoutStateChanged(int row, int column)
{ {
QTableWidgetItem *item = ui->tableWidget->item(row, 0);
const quint32 id = item->data(Qt::UserRole).toUInt();
emit Highlight(id);
if (column != 0) if (column != 0)
{ {
return; return;
} }
QTableWidgetItem *item = ui->tableWidget->item(row, column);
const quint32 id = item->data(Qt::UserRole).toUInt();
const QHash<quint32, VDetail> *allDetails = m_data->DataDetails(); const QHash<quint32, VDetail> *allDetails = m_data->DataDetails();
const bool inLayout = not allDetails->value(id).IsInLayout(); const bool inLayout = not allDetails->value(id).IsInLayout();

View File

@ -48,6 +48,9 @@ public:
explicit VWidgetDetails(VContainer *data, VAbstractPattern *doc, QWidget *parent = nullptr); explicit VWidgetDetails(VContainer *data, VAbstractPattern *doc, QWidget *parent = nullptr);
virtual ~VWidgetDetails(); virtual ~VWidgetDetails();
signals:
void Highlight(quint32 id);
public slots: public slots:
void UpdateList(); void UpdateList();

View File

@ -3510,6 +3510,7 @@ void MainWindow::InitDocksContain()
detailsWidget = new VWidgetDetails(pattern, doc, this); detailsWidget = new VWidgetDetails(pattern, doc, this);
connect(doc, &VPattern::FullUpdateFromFile, detailsWidget, &VWidgetDetails::UpdateList); connect(doc, &VPattern::FullUpdateFromFile, detailsWidget, &VWidgetDetails::UpdateList);
connect(detailsWidget, &VWidgetDetails::Highlight, sceneDetails, &VMainGraphicsScene::HighlightItem);
detailsWidget->setVisible(false); detailsWidget->setVisible(false);
} }

View File

@ -757,7 +757,6 @@ void QmuParserBase::ApplyFunc( QStack<token_type> &a_stOpt, QStack<token_type> &
} }
token_type funTok = a_stOpt.pop(); token_type funTok = a_stOpt.pop();
// cppcheck-suppress assertWithSideEffect
assert(funTok.GetFuncAddr()); assert(funTok.GetFuncAddr());
// Binary operators must rely on their internal operator number // Binary operators must rely on their internal operator number

View File

@ -354,6 +354,7 @@ void VToolDetail::Create(const quint32 &_id, const VDetail &newDetail, VMainGrap
connect(detail, &VToolDetail::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(detail, &VToolDetail::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
connect(scene, &VMainGraphicsScene::EnableDetailItemHover, detail, &VToolDetail::AllowHover); connect(scene, &VMainGraphicsScene::EnableDetailItemHover, detail, &VToolDetail::AllowHover);
connect(scene, &VMainGraphicsScene::EnableDetailItemSelection, detail, &VToolDetail::AllowSelecting); connect(scene, &VMainGraphicsScene::EnableDetailItemSelection, detail, &VToolDetail::AllowSelecting);
connect(scene, &VMainGraphicsScene::HighlightDetail, detail, &VToolDetail::Highlight);
doc->AddTool(id, detail); doc->AddTool(id, detail);
} }
} }
@ -1262,3 +1263,9 @@ void VToolDetail::retranslateUi()
UpdateLabel(); UpdateLabel();
UpdatePatternInfo(); UpdatePatternInfo();
} }
//---------------------------------------------------------------------------------------------------------------------
void VToolDetail::Highlight(quint32 id)
{
setSelected(this->id == id);
}

View File

@ -102,6 +102,7 @@ public slots:
virtual void ResetChildren(QGraphicsItem* pItem); virtual void ResetChildren(QGraphicsItem* pItem);
virtual void UpdateAll(); virtual void UpdateAll();
virtual void retranslateUi(); virtual void retranslateUi();
void Highlight(quint32 id);
protected: protected:
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget) Q_DECL_OVERRIDE; QWidget *widget) Q_DECL_OVERRIDE;

View File

@ -155,7 +155,7 @@ qreal VisToolMove::LengthValue() const
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolMove::SetLength(const QString &expression) void VisToolMove::SetLength(const QString &expression)
{ {
length = FindVal(expression, Visualization::data->PlainVariables()); length = FindLength(expression, Visualization::data->PlainVariables());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -303,6 +303,12 @@ void VMainGraphicsScene::ItemsSelection(const SelectionType &type)
emit ItemSelection(type); emit ItemSelection(type);
} }
//---------------------------------------------------------------------------------------------------------------------
void VMainGraphicsScene::HighlightItem(quint32 id)
{
emit HighlightDetail(id);
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VMainGraphicsScene::ToggleLabelSelection(bool enabled) void VMainGraphicsScene::ToggleLabelSelection(bool enabled)
{ {

View File

@ -75,6 +75,7 @@ public slots:
void EnableItemMove(bool move); void EnableItemMove(bool move);
void EnableDetailsMode(bool mode); void EnableDetailsMode(bool mode);
void ItemsSelection(const SelectionType &type); void ItemsSelection(const SelectionType &type);
void HighlightItem(quint32 id);
void ToggleLabelSelection(bool enabled); void ToggleLabelSelection(bool enabled);
void TogglePointSelection(bool enabled); void TogglePointSelection(bool enabled);
@ -126,6 +127,7 @@ signals:
void EnableToolMove(bool move); void EnableToolMove(bool move);
void CurveDetailsMode(bool mode); void CurveDetailsMode(bool mode);
void ItemSelection(const SelectionType &type); void ItemSelection(const SelectionType &type);
void HighlightDetail(quint32 id);
void EnableLabelItemSelection(bool enable); void EnableLabelItemSelection(bool enable);
void EnablePointItemSelection(bool enable); void EnablePointItemSelection(bool enable);