diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 452b6d859..3dea9ee93 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -289,7 +289,7 @@ Qt::PenStyle VAbstractTool::LineStyle(const QString &typeLine) break; } } -QString VAbstractTool::getTypeLine() const +QString VAbstractTool::getLineType() const { return typeLine; } diff --git a/src/app/tools/vabstracttool.h b/src/app/tools/vabstracttool.h index 74ab724b7..b945ec805 100644 --- a/src/app/tools/vabstracttool.h +++ b/src/app/tools/vabstracttool.h @@ -101,7 +101,7 @@ public: static Qt::PenStyle LineStyle(const QString &typeLine); const VContainer *getData() const; - QString getTypeLine() const; + QString getLineType() const; //void setTypeLine(const QString &value)=0; QMap PointsList() const; public slots: diff --git a/src/app/widgets/vtooloptionspropertybrowser.cpp b/src/app/widgets/vtooloptionspropertybrowser.cpp index 8893b4b6e..787821ded 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.cpp +++ b/src/app/widgets/vtooloptionspropertybrowser.cpp @@ -128,15 +128,20 @@ void VToolOptionsPropertyBrowser::userChangedData(VProperty *property) } case VToolEndLine::Type: { + VToolEndLine *i = qgraphicsitem_cast(currentItem); if (id == QLatin1String("name")) { SetPointName(variant.toString()); } else if (id == QLatin1String("basePoint")) { - VToolEndLine *i = qgraphicsitem_cast(currentItem); i->setBasePointId(variant.toUInt()); } + else if (id == QLatin1String("lineType")) + { + + i->setTypeLine(variant.toString()); + } break; } default: @@ -194,6 +199,10 @@ void VToolOptionsPropertyBrowser::UpdateOptions() idToProperty[QLatin1String("name")]->setValue(i->name()); idToProperty[QLatin1String("basePoint")]->setValue(i->getBasePointId()); + QStringList styles = VAbstractTool::Styles(); + qint32 index = styles.indexOf(i->getLineType()); + idToProperty[QLatin1String("lineType")]->setValue(index); + break; } case VGraphicsSimpleTextItem::Type: @@ -240,7 +249,7 @@ void VToolOptionsPropertyBrowser::ShowItemOptions(QGraphicsItem *item) { VToolEndLine *i = qgraphicsitem_cast(item); QDockWidget *parent = qobject_cast(this->parent()); - parent->setWindowTitle(tr("Tool options (End of line)")); + parent->setWindowTitle(tr("Tool options (Point at distance and angle)")); VProperty* itemName = new VProperty(tr("Point name")); itemName->setValue(i->name()); @@ -252,10 +261,12 @@ void VToolOptionsPropertyBrowser::ShowItemOptions(QGraphicsItem *item) pointsProperty->setValue(i->getBasePointId()); AddProperty(pointsProperty, QLatin1String("basePoint")); -// VEnumProperty *enumProperty = new VEnumProperty(tr("list")); -// QStringList list = QStringList()<<"a1"<<"a2"<<"a3"; -// enumProperty->setLiterals(list); -// AddProperty(enumProperty, QLatin1String("list")); + VEnumProperty *lineTypeProperty = new VEnumProperty(tr("Line type")); + lineTypeProperty->setLiterals(VAbstractTool::Styles()); + QStringList styles = VAbstractTool::Styles(); + qint32 index = styles.indexOf(i->getLineType()); + lineTypeProperty->setValue(index); + AddProperty(lineTypeProperty, QLatin1String("lineType")); break; } case VGraphicsSimpleTextItem::Type: