Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Fix linetype combobox in prop editor #1183

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/app/seamly2d/core/vtooloptionspropertybrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ void VToolOptionsPropertyBrowser::addPropertyLineType(Tool *tool, const QString
QMap<QString, QString> lineTypes = lineTypeList();
if (tool->type() == VToolLine::Type)
{
lineTypes.remove(LineTypeNone);
lineTypes = lineTypeNoPenRemovedList();
}
lineTypeProperty->setLineTypes(lineTypes);

Expand All @@ -706,8 +706,8 @@ template<class Tool>
void VToolOptionsPropertyBrowser::addPropertyCurveLineType(Tool *tool, const QString &propertyName)
{
VPE::LineTypeProperty *penStyleProperty = new VPE::LineTypeProperty(propertyName);
penStyleProperty->setLineTypes(curveLineTypeList());
const qint32 index = VPE::LineTypeProperty::indexOfLineType(curveLineTypeList(), tool->GetPenStyle());
penStyleProperty->setLineTypes(lineTypeNoPenRemovedList());
const qint32 index = VPE::LineTypeProperty::indexOfLineType(lineTypeNoPenRemovedList(), tool->GetPenStyle());
if (index == -1)
{
qWarning() << "Can't find line type" << tool->getLineType() << "in list";
Expand Down Expand Up @@ -750,7 +750,7 @@ void VToolOptionsPropertyBrowser::addPropertyLineColor(Tool *tool, const QString
//
// Adds a direction combobox property to the Property Editor form widget. Gets the combobox index to
// the tool's direction. Throws a warning if the property is not found in the combobox item list.
// If the index exists it sets the combobox index to the tool's direction.
// If the index exists it sets the combobox index to the tool's direction.
//
// @tparam tool Tool of the property.
// @param propertyName Name of the property.
Expand Down Expand Up @@ -2606,7 +2606,7 @@ void VToolOptionsPropertyBrowser::showOptionsToolLine(QGraphicsItem *item)
formView->setTitle(tr("Line"));

addPropertyLabel(tr("Selection"), AttrName);
addPropertyLineName(tool, AttrObjName, true);
addPropertyLineName(tool, tr("Name:"), true);
addObjectProperty(tool, tool->FirstPointName(), tr("First point:"), AttrFirstPoint, GOType::Point);
addObjectProperty(tool, tool->SecondPointName(), tr("Second point:"), AttrSecondPoint, GOType::Point);

Expand Down Expand Up @@ -3155,7 +3155,7 @@ void VToolOptionsPropertyBrowser::updateOptionsToolArc()
}

{
const qint32 index = VPE::LineTypeProperty::indexOfLineType(curveLineTypeList(), tool->GetPenStyle());
const qint32 index = VPE::LineTypeProperty::indexOfLineType(lineTypeNoPenRemovedList(), tool->GetPenStyle());
idToProperty[AttrPenStyle]->setValue(index);
}

Expand Down Expand Up @@ -3196,7 +3196,7 @@ void VToolOptionsPropertyBrowser::updateOptionsToolArcWithLength()
}

{
const qint32 index = VPE::LineTypeProperty::indexOfLineType(curveLineTypeList(), tool->GetPenStyle());
const qint32 index = VPE::LineTypeProperty::indexOfLineType(lineTypeNoPenRemovedList(), tool->GetPenStyle());
idToProperty[AttrPenStyle]->setValue(index);
}

Expand Down Expand Up @@ -3409,7 +3409,7 @@ void VToolOptionsPropertyBrowser::updateOptionsToolLine()
}

{
const qint32 index = VPE::LineTypeProperty::indexOfLineType(lineTypeList(), tool->getLineType());
const qint32 index = VPE::LineTypeProperty::indexOfLineType(lineTypeNoPenRemovedList(), tool->getLineType());
idToProperty[AttrLineType]->setValue(index);
}

Expand Down Expand Up @@ -3788,7 +3788,7 @@ void VToolOptionsPropertyBrowser::updateOptionsToolSpline()
tool->getLineColor()));

{
const qint32 index = VPE::LineTypeProperty::indexOfLineType(curveLineTypeList(), tool->GetPenStyle());
const qint32 index = VPE::LineTypeProperty::indexOfLineType(lineTypeNoPenRemovedList(), tool->GetPenStyle());
idToProperty[AttrPenStyle]->setValue(index);
}

Expand All @@ -3809,7 +3809,7 @@ void VToolOptionsPropertyBrowser::updateOptionsToolCubicBezier()
tool->getLineColor()));

{
const qint32 index = VPE::LineTypeProperty::indexOfLineType(curveLineTypeList(), tool->GetPenStyle());
const qint32 index = VPE::LineTypeProperty::indexOfLineType(lineTypeNoPenRemovedList(), tool->GetPenStyle());
idToProperty[AttrPenStyle]->setValue(index);
}

Expand Down Expand Up @@ -3854,7 +3854,7 @@ void VToolOptionsPropertyBrowser::updateOptionsToolSplinePath()
tool->getLineColor()));

{
const qint32 index = VPE::LineTypeProperty::indexOfLineType(curveLineTypeList(), tool->GetPenStyle());
const qint32 index = VPE::LineTypeProperty::indexOfLineType(lineTypeNoPenRemovedList(), tool->GetPenStyle());
idToProperty[AttrPenStyle]->setValue(index);
}

Expand All @@ -3876,7 +3876,7 @@ void VToolOptionsPropertyBrowser::updateOptionsToolCubicBezierPath()
tool->getLineColor()));

{
const qint32 index = VPE::LineTypeProperty::indexOfLineType(curveLineTypeList(), tool->GetPenStyle());
const qint32 index = VPE::LineTypeProperty::indexOfLineType(lineTypeNoPenRemovedList(), tool->GetPenStyle());
idToProperty[AttrPenStyle]->setValue(index);
}

Expand Down Expand Up @@ -4114,7 +4114,7 @@ void VToolOptionsPropertyBrowser::updateOptionsToolEllipticalArc()
}

{
const qint32 index = VPE::LineTypeProperty::indexOfLineType(curveLineTypeList(), tool->GetPenStyle());
const qint32 index = VPE::LineTypeProperty::indexOfLineType(lineTypeNoPenRemovedList(), tool->GetPenStyle());
idToProperty[AttrPenStyle]->setValue(index);
}

Expand Down
2 changes: 1 addition & 1 deletion src/libs/ifc/ifcdef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ QString PenStyleToLineType(Qt::PenStyle penStyle)
}

//---------------------------------------------------------------------------------------------------------------------
QMap<QString, QString> curveLineTypeList()
QMap<QString, QString> lineTypeNoPenRemovedList()
{
QMap<QString, QString> map = lineTypeList();
map.remove(LineTypeNone);
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ifc/ifcdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ QStringList LineTypes();
Qt::PenStyle lineTypeToPenStyle(const QString &lineType);
QString PenStyleToLineType(Qt::PenStyle penStyle);
QMap<QString, QString> lineTypeList();
QMap<QString, QString> curveLineTypeList();
QMap<QString, QString> lineTypeNoPenRemovedList();

QMap<QString, QString> lineWeightList();
QMap<QString, QString> directionList();
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogalongline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ DialogAlongLine::~DialogAlongLine()

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogarc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void DialogArc::setRadius(const QString &value)

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogbisector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ DialogBisector::~DialogBisector()

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogcutarc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ DialogCutArc::~DialogCutArc()

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogcutspline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void DialogCutSpline::setSplineId(const quint32 &value)

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void DialogCutSplinePath::setSplinePathId(const quint32 &value)

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ void DialogEllipticalArc::DeployRotationAngleTextEdit()

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogendline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void DialogEndLine::FXLength()

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogheight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ void DialogHeight::SetP2LineId(const quint32 &value)

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ void DialogLine::SaveData()

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialoglineintersect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ DialogLineIntersect::~DialogLineIntersect()

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialognormal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ DialogNormal::~DialogNormal()

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogpointofcontact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void DialogPointOfContact::DeployFormulaTextEdit()

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogshoulderpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ DialogShoulderPoint::~DialogShoulderPoint()

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogspline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ DialogSpline::~DialogSpline()

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogsplinepath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ void DialogSplinePath::setLineColor(const QString &value)

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type don't show this id in list
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/dialogtriangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ DialogTriangle::~DialogTriangle()

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/point_intersectxy_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void PointIntersectXYDialog::setLineColor(const QString &value)

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vtools/dialogs/tools/union_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool UnionDialog::retainPieces() const

//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ChoosedObject gets id and type of selected object. Save correct data and ignore wrong.
* @brief ChosenObject gets id and type of selected object. Save correct data and ignore wrong.
* @param id id of point or piece
* @param type type of object
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ void VAbstractOperation::InitCurve(quint32 id, VContainer *data, GOType curveTyp
{
showContextMenu(event, id);
});
connect(curve, &VSimpleCurve::Choosed, this, [this, sceneType](quint32 id)
connect(curve, &VSimpleCurve::Chosen, this, [this, sceneType](quint32 id)
{
emit chosenTool(id, sceneType);
});
Expand Down Expand Up @@ -701,7 +701,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default")
point->setParentItem(this);
point->SetType(GOType::Point);
point->setToolTip(complexPointToolTip(item.id));
connect(point, &VSimplePoint::Choosed, this, [this](quint32 id)
connect(point, &VSimplePoint::Chosen, this, [this](quint32 id)
{
emit chosenTool(id, SceneObject::Point);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ VToolDoublePoint::VToolDoublePoint(VAbstractPattern *doc, VContainer *data, quin
firstPoint = new VSimplePoint(p1id, QColor(qApp->Settings()->getPointNameColor()));
firstPoint->setParentItem(this);
firstPoint->setToolTip(complexToolTip(p1id));
connect(firstPoint, &VSimplePoint::Choosed, this, &VToolDoublePoint::point1Chosen);
connect(firstPoint, &VSimplePoint::Chosen, this, &VToolDoublePoint::point1Chosen);
connect(firstPoint, &VSimplePoint::Selected, this, &VToolDoublePoint::point1Selected);
connect(firstPoint, &VSimplePoint::showContextMenu, this, &VToolDoublePoint::showContextMenu);
connect(firstPoint, &VSimplePoint::Delete, this, &VToolDoublePoint::deletePoint);
Expand All @@ -100,7 +100,7 @@ VToolDoublePoint::VToolDoublePoint(VAbstractPattern *doc, VContainer *data, quin
secondPoint = new VSimplePoint(p2id, QColor(qApp->Settings()->getPointNameColor()));
secondPoint->setParentItem(this);
secondPoint->setToolTip(complexToolTip(p2id));
connect(secondPoint, &VSimplePoint::Choosed, this, &VToolDoublePoint::point2Chosen);
connect(secondPoint, &VSimplePoint::Chosen, this, &VToolDoublePoint::point2Chosen);
connect(secondPoint, &VSimplePoint::Selected, this, &VToolDoublePoint::point2Selected);
connect(secondPoint, &VSimplePoint::showContextMenu, this, &VToolDoublePoint::showContextMenu);
connect(secondPoint, &VSimplePoint::Delete, this, &VToolDoublePoint::deletePoint);
Expand Down
2 changes: 1 addition & 1 deletion src/libs/vwidgets/vmaingraphicsscene.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public slots:
void ItemClicked(QGraphicsItem* pItem);

/**
* @brief ChosenObject send option choosed object.
* @brief ChosenObject send option Chosen object.
* @param id object id.
* @param type object scene type.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/libs/vwidgets/vsimplecurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ void VSimpleCurve::RefreshGeometry(const QSharedPointer<VAbstractCurve> &curve)
}

//---------------------------------------------------------------------------------------------------------------------
void VSimpleCurve::CurveChoosed()
void VSimpleCurve::CurveChosen()
{
emit Choosed(id);
emit Chosen(id);
}

//---------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -130,7 +130,7 @@ void VSimpleCurve::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
emit Choosed(id);
emit Chosen(id);
}
}
}
Expand All @@ -142,7 +142,7 @@ void VSimpleCurve::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
emit Choosed(id);
emit Chosen(id);
}
}
QGraphicsPathItem::mouseReleaseEvent(event);
Expand Down
6 changes: 3 additions & 3 deletions src/libs/vwidgets/vsimplecurve.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ class VSimpleCurve : public VAbstractSimple, public VCurvePathItem
void RefreshGeometry(const QSharedPointer<VAbstractCurve> &curve);
signals:
/**
* @brief Choosed send id when clicked.
* @brief Chosen send id when clicked.
* @param id point id.
*/
void Choosed(quint32 id);
void Chosen(quint32 id);
void Selected(bool selected, quint32 id);

public slots:
void CurveChoosed();
void CurveChosen();
void CurveSelected(bool selected);

protected:
Expand Down
Loading
Loading