Fixed label update on clicking OK in pattern properties dialog and the label is hidden when there is no text on it
--HG-- branch : feature
This commit is contained in:
parent
a3f4c6da0d
commit
a1c905381b
|
@ -188,6 +188,9 @@ DialogPatternProperties::DialogPatternProperties(const QString &filePath, VPatte
|
||||||
connect(ui->lineEditPatternNumber, &QLineEdit::editingFinished, this, &DialogPatternProperties::GeneralInfoChanged);
|
connect(ui->lineEditPatternNumber, &QLineEdit::editingFinished, this, &DialogPatternProperties::GeneralInfoChanged);
|
||||||
connect(ui->lineEditCompanyName, &QLineEdit::editingFinished, this, &DialogPatternProperties::GeneralInfoChanged);
|
connect(ui->lineEditCompanyName, &QLineEdit::editingFinished, this, &DialogPatternProperties::GeneralInfoChanged);
|
||||||
connect(ui->lineEditCustomerName, &QLineEdit::editingFinished, this, &DialogPatternProperties::GeneralInfoChanged);
|
connect(ui->lineEditCustomerName, &QLineEdit::editingFinished, this, &DialogPatternProperties::GeneralInfoChanged);
|
||||||
|
connect(ui->lineEditSize, &QLineEdit::editingFinished, this, &DialogPatternProperties::GeneralInfoChanged);
|
||||||
|
connect(ui->checkBoxShowDate, &QCheckBox::stateChanged, this, &DialogPatternProperties::GeneralInfoChanged);
|
||||||
|
connect(ui->checkBoxShowMeasurements, &QCheckBox::stateChanged, this, &DialogPatternProperties::GeneralInfoChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -293,6 +293,16 @@ void VTextGraphicsItem::UpdateData(const VAbstractPattern* pDoc)
|
||||||
m_tm.Update(pDoc);
|
m_tm.Update(pDoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VTextGraphicsItem::GetTextLines returns the number of lines of text to show
|
||||||
|
* @return number of lines of text
|
||||||
|
*/
|
||||||
|
int VTextGraphicsItem::GetTextLines() const
|
||||||
|
{
|
||||||
|
return m_tm.GetCount();
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief VTextGraphicsItem::GetFontSize returns the currently used text base font size
|
* @brief VTextGraphicsItem::GetFontSize returns the currently used text base font size
|
||||||
|
|
|
@ -69,6 +69,7 @@ public:
|
||||||
bool IsContained(QRectF rectBB, qreal dRot, qreal& dX, qreal& dY) const;
|
bool IsContained(QRectF rectBB, qreal dRot, qreal& dX, qreal& dY) const;
|
||||||
void UpdateData(const QString& qsName, const VPatternPieceData& data);
|
void UpdateData(const QString& qsName, const VPatternPieceData& data);
|
||||||
void UpdateData(const VAbstractPattern* pDoc);
|
void UpdateData(const VAbstractPattern* pDoc);
|
||||||
|
int GetTextLines() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mousePressEvent(QGraphicsSceneMouseEvent* pME);
|
void mousePressEvent(QGraphicsSceneMouseEvent* pME);
|
||||||
|
|
|
@ -748,6 +748,8 @@ void VToolDetail::UpdatePatternInfo()
|
||||||
patternInfo->setPos(pt);
|
patternInfo->setPos(pt);
|
||||||
patternInfo->setRotation(geom.GetRotation());
|
patternInfo->setRotation(geom.GetRotation());
|
||||||
patternInfo->Update();
|
patternInfo->Update();
|
||||||
|
if (patternInfo->GetTextLines() > 0)
|
||||||
|
{
|
||||||
patternInfo->show();
|
patternInfo->show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -755,6 +757,11 @@ void VToolDetail::UpdatePatternInfo()
|
||||||
patternInfo->hide();
|
patternInfo->hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
patternInfo->hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user