Selected detail is also selected in the list.
--HG-- branch : develop
This commit is contained in:
parent
d38e81cecb
commit
972c70e608
|
@ -65,6 +65,22 @@ void VWidgetDetails::UpdateList()
|
|||
FillTable(m_data->DataDetails());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VWidgetDetails::SelectDetail(quint32 id)
|
||||
{
|
||||
const int rowCount = ui->tableWidget->rowCount();
|
||||
for (int row = 0; row < rowCount; ++row)
|
||||
{
|
||||
QTableWidgetItem *item = ui->tableWidget->item(row, 0);
|
||||
|
||||
if (item->data(Qt::UserRole).toUInt() == id)
|
||||
{
|
||||
ui->tableWidget->setCurrentItem(item);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VWidgetDetails::InLayoutStateChanged(int row, int column)
|
||||
{
|
||||
|
|
|
@ -53,6 +53,7 @@ signals:
|
|||
|
||||
public slots:
|
||||
void UpdateList();
|
||||
void SelectDetail(quint32 id);
|
||||
|
||||
private slots:
|
||||
void InLayoutStateChanged(int row, int column);
|
||||
|
|
|
@ -3511,6 +3511,7 @@ void MainWindow::InitDocksContain()
|
|||
detailsWidget = new VWidgetDetails(pattern, doc, this);
|
||||
connect(doc, &VPattern::FullUpdateFromFile, detailsWidget, &VWidgetDetails::UpdateList);
|
||||
connect(doc, &VPattern::UpdateInLayoutList, detailsWidget, &VWidgetDetails::UpdateList);
|
||||
connect(doc, &VPattern::ShowDetail, detailsWidget, &VWidgetDetails::SelectDetail);
|
||||
connect(detailsWidget, &VWidgetDetails::Highlight, sceneDetails, &VMainGraphicsScene::HighlightItem);
|
||||
detailsWidget->setVisible(false);
|
||||
}
|
||||
|
|
|
@ -1208,6 +1208,12 @@ void VAbstractPattern::CheckInLayoutList()
|
|||
emit UpdateInLayoutList();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractPattern::SelectedDetail(quint32 id)
|
||||
{
|
||||
emit ShowDetail(id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractPattern::ToolExists(const quint32 &id) const
|
||||
{
|
||||
|
|
|
@ -292,6 +292,7 @@ signals:
|
|||
void SetEnabledGUI(bool enabled);
|
||||
void CheckLayout();
|
||||
void UpdateInLayoutList();
|
||||
void ShowDetail(quint32 id);
|
||||
void SetCurrentPP(const QString &patterPiece);
|
||||
|
||||
public slots:
|
||||
|
@ -300,6 +301,7 @@ public slots:
|
|||
void NeedFullParsing();
|
||||
void ClearScene();
|
||||
void CheckInLayoutList();
|
||||
void SelectedDetail(quint32 id);
|
||||
|
||||
protected:
|
||||
/** @brief nameActivDraw name current pattern peace. */
|
||||
|
|
|
@ -671,6 +671,7 @@ void VToolDetail::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
|
||||
if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick)
|
||||
{
|
||||
doc->SelectedDetail(id);
|
||||
emit ChoosedTool(id, SceneObject::Detail);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user