Use in dialog tool's container with data after creation tool with Apply button.

--HG--
branch : develop
This commit is contained in:
dismine 2014-07-25 14:22:25 +03:00
parent 1cb1166824
commit ccbdff7fb5
6 changed files with 22 additions and 21 deletions

View File

@ -272,7 +272,7 @@
<item> <item>
<widget class="QLabel" name="labelFirstPoint"> <widget class="QLabel" name="labelFirstPoint">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -338,7 +338,7 @@
<item> <item>
<widget class="QLabel" name="labelPointShoulder"> <widget class="QLabel" name="labelPointShoulder">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -383,6 +383,12 @@
</item> </item>
<item> <item>
<widget class="QComboBox" name="comboBoxLineType"> <widget class="QComboBox" name="comboBoxLineType">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Show line from first point to our point</string> <string>Show line from first point to our point</string>
</property> </property>
@ -469,7 +475,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Length of lines</string> <string>Length of arcs</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -1075,12 +1075,6 @@ void DialogTool::ShowVariable(const QHash<key, val> *var)
listWidget->setCurrentRow (0); listWidget->setCurrentRow (0);
} }
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::DialogApply()
{
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogTool::ShowVisToolTip(const QString &toolTip) void DialogTool::ShowVisToolTip(const QString &toolTip)
{ {
@ -1092,3 +1086,10 @@ void DialogTool::ShowDialog(bool click)
{ {
Q_UNUSED(click); Q_UNUSED(click);
} }
//---------------------------------------------------------------------------------------------------------------------
void DialogTool::SetAssociatedTool(VAbstractTool *tool)
{
this->associatedTool=tool;
this->data = tool->getData();
}

View File

@ -83,7 +83,7 @@ public slots:
/** /**
* @brief DialogApply save data and emit signal DialogApplied. * @brief DialogApply save data and emit signal DialogApplied.
*/ */
virtual void DialogApply(); virtual void DialogApply(){}
virtual void DialogRejected(); virtual void DialogRejected();
void FormulaChanged(); void FormulaChanged();
/** /**
@ -110,7 +110,6 @@ public slots:
virtual void ValChenged(int row); virtual void ValChenged(int row);
virtual void UpdateList(); virtual void UpdateList();
virtual void PointNameChanged(){} virtual void PointNameChanged(){}
protected: protected:
Q_DISABLE_COPY(DialogTool) Q_DISABLE_COPY(DialogTool)
@ -318,10 +317,4 @@ inline VAbstractTool *DialogTool::GetAssociatedTool()
return this->associatedTool; return this->associatedTool;
} }
//---------------------------------------------------------------------------------------------------------------------
inline void DialogTool::SetAssociatedTool(VAbstractTool *tool)
{
this->associatedTool=tool;
}
#endif // DIALOGTOOL_H #endif // DIALOGTOOL_H

View File

@ -41,8 +41,8 @@ const QString VToolPoint::TagName = QStringLiteral("point");
* @param id object id in container. * @param id object id in container.
* @param parent parent object. * @param parent parent object.
*/ */
VToolPoint::VToolPoint(VPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent):VDrawTool(doc, data, id), VToolPoint::VToolPoint(VPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent)
QGraphicsEllipseItem(parent), radius(DefPointRadius), namePoint(0), lineName(0) :VDrawTool(doc, data, id), QGraphicsEllipseItem(parent), radius(DefPointRadius), namePoint(0), lineName(0)
{ {
radius = qApp->toPixel(DefPointRadius/*mm*/, Unit::Mm); radius = qApp->toPixel(DefPointRadius/*mm*/, Unit::Mm);
namePoint = new VGraphicsSimpleTextItem(this); namePoint = new VGraphicsSimpleTextItem(this);

View File

@ -99,6 +99,7 @@ public:
static const QStringList Styles(); static const QStringList Styles();
static void AddRecord(const quint32 id, const Tool &toolType, VPattern *doc); static void AddRecord(const quint32 id, const Tool &toolType, VPattern *doc);
static Qt::PenStyle LineStyle(const QString &typeLine); static Qt::PenStyle LineStyle(const QString &typeLine);
const VContainer *getData() const;
public slots: public slots:
/** /**
* @brief FullUpdateFromFile update tool data form file. * @brief FullUpdateFromFile update tool data form file.
@ -142,7 +143,6 @@ protected:
* @brief RefreshDataInFile refresh attributes in file. If attributes don't exist create them. * @brief RefreshDataInFile refresh attributes in file. If attributes don't exist create them.
*/ */
virtual void RefreshDataInFile()=0; virtual void RefreshDataInFile()=0;
const VContainer *getData() const;
/** /**
* @brief RemoveReferens decrement value of reference. * @brief RemoveReferens decrement value of reference.
*/ */

View File

@ -34,7 +34,8 @@
* @param data container with variables * @param data container with variables
* @param parent parent object * @param parent parent object
*/ */
VDataTool::VDataTool(VContainer *data, QObject *parent): QObject(parent), data(*data), _referens(1) VDataTool::VDataTool(VContainer *data, QObject *parent)
: QObject(parent), data(*data), _referens(1)
{ {
SCASSERT(data != nullptr); SCASSERT(data != nullptr);
} }