New method RemoveAllChild.
--HG-- branch : develop
This commit is contained in:
parent
473c90c72c
commit
d20667f056
|
@ -136,6 +136,14 @@ const VContainer *VAbstractTool::getData()const{
|
|||
return &data;
|
||||
}
|
||||
|
||||
void VAbstractTool::RemoveAllChild(QDomElement &domElement){
|
||||
if ( domElement.hasChildNodes() ){
|
||||
while ( domElement.childNodes().length() >= 1 ){
|
||||
domElement.removeChild( domElement.firstChild() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VAbstractTool::LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c){
|
||||
//коефіцієнти для рівняння відрізку
|
||||
*a = line.p2().y() - line.p1().y();
|
||||
|
|
|
@ -55,6 +55,7 @@ protected:
|
|||
void AddAttribute(QDomElement &domElement, const QString &name, const QString &value);
|
||||
const VContainer *getData() const;
|
||||
virtual void RemoveReferens(){}
|
||||
void RemoveAllChild(QDomElement &domElement);
|
||||
private:
|
||||
Q_DISABLE_COPY(VAbstractTool)
|
||||
};
|
||||
|
|
|
@ -296,11 +296,7 @@ void VToolDetail::FullUpdateFromGui(int result){
|
|||
domElement.setAttribute("supplement", QString().setNum(det.getSupplement()));
|
||||
domElement.setAttribute("closed", QString().setNum(det.getClosed()));
|
||||
domElement.setAttribute("width", QString().setNum(det.getWidth()));
|
||||
if ( domElement.hasChildNodes() ){
|
||||
while ( domElement.childNodes().length() >= 1 ){
|
||||
domElement.removeChild( domElement.firstChild() );
|
||||
}
|
||||
}
|
||||
RemoveAllChild(domElement);
|
||||
for(qint32 i = 0; i < det.CountNode(); ++i){
|
||||
AddNode(domElement, det[i]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user