mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
DXF Export: Added Ellipse and Element Text Document for export.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2746 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -422,6 +422,7 @@ void ExportDialog::generateDxf(Diagram *diagram, int width, int height, bool kee
|
||||
QStringList lines = dti -> toPlainText().split('\n');
|
||||
y += (fontSize/2) * (lines.count()-1);
|
||||
foreach (QString line, lines) {
|
||||
if (line.size() > 0)
|
||||
Createdxf::drawText(file_path, line, x, y, fontSize, dti -> rotationAngle(), 0 );
|
||||
y -= fontSize*1.06;
|
||||
}
|
||||
@@ -486,6 +487,9 @@ void ExportDialog::generateDxf(Diagram *diagram, int width, int height, bool kee
|
||||
qreal center_y = y - w/2;
|
||||
qreal radius = (w+h)/4;
|
||||
qreal endAngle = startAngle + spanAngle;
|
||||
if (startAngle == 0 && spanAngle == 360)
|
||||
Createdxf::drawCircle(file_path, radius, center_x, center_y, 0);
|
||||
else
|
||||
Createdxf::drawArc(file_path, center_x, center_y, radius, endAngle, startAngle, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -635,6 +635,18 @@ bool CustomElement::parseText(QDomElement &e, QPainter &qp) {
|
||||
text_document.setDefaultFont(used_font);
|
||||
text_document.setPlainText(e.attribute("text"));
|
||||
|
||||
//Add element to list of texts.
|
||||
ElementTextItem *eti = new ElementTextItem(e.attribute("text"));
|
||||
eti -> setFont(QETApp::diagramTextsFont(size));
|
||||
eti -> setOriginalPos(QPointF(pos_x, pos_y));
|
||||
eti -> setPos(pos_x, pos_y);
|
||||
qreal original_rotation_angle = 0.0;
|
||||
QET::attributeIsAReal(e, "rotation", &original_rotation_angle);
|
||||
eti -> setOriginalRotationAngle(original_rotation_angle);
|
||||
eti -> setRotationAngle(original_rotation_angle);
|
||||
eti -> setFollowParentRotations(e.attribute("rotate") == "true");
|
||||
list_texts_ << eti;
|
||||
|
||||
// Se positionne aux coordonnees indiquees dans la description du texte
|
||||
qp.setTransform(QTransform(), false);
|
||||
qp.translate(pos_x, pos_y);
|
||||
|
||||
Reference in New Issue
Block a user