mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
Dans Fichier > Exporter :
*suppression de l'option "conserver les couleurs" *desactivation par defaut de l'option "dessiner la grille" Dans l'editeur d'element : *activation par defaut de l'antialiasing sur les cercles, ellipses et arcs de cercles poses par l'utilisateur *le dernier element pose est automatiquement selectionne git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@162 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -133,16 +133,25 @@ QWidget *CustomElementGraphicPart::elementInformations() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CustomElementGraphicPart::setProperty(const QString &property, const QVariant &value) {
|
void CustomElementGraphicPart::setProperty(const QString &property, const QVariant &value) {
|
||||||
|
bool change_made = false;
|
||||||
if (property == "line-style") {
|
if (property == "line-style") {
|
||||||
setLineStyle(static_cast<LineStyle>(value.toInt()));
|
setLineStyle(static_cast<LineStyle>(value.toInt()));
|
||||||
|
change_made = true;
|
||||||
} else if (property == "line-weight") {
|
} else if (property == "line-weight") {
|
||||||
setLineWeight(static_cast<LineWeight>(value.toInt()));
|
setLineWeight(static_cast<LineWeight>(value.toInt()));
|
||||||
|
change_made = true;
|
||||||
} else if (property == "filling") {
|
} else if (property == "filling") {
|
||||||
setFilling(static_cast<Filling>(value.toInt()));
|
setFilling(static_cast<Filling>(value.toInt()));
|
||||||
|
change_made = true;
|
||||||
} else if (property == "color") {
|
} else if (property == "color") {
|
||||||
setColor(static_cast<Color>(value.toInt()));
|
setColor(static_cast<Color>(value.toInt()));
|
||||||
|
change_made = true;
|
||||||
} else if (property == "antialias") {
|
} else if (property == "antialias") {
|
||||||
setAntialiased(value.toBool());
|
setAntialiased(value.toBool());
|
||||||
|
change_made = true;
|
||||||
|
}
|
||||||
|
if (change_made) {
|
||||||
|
style_editor -> updateForm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,8 @@ void AddPartCommand::undo() {
|
|||||||
void AddPartCommand::redo() {
|
void AddPartCommand::redo() {
|
||||||
// le premier appel a redo, lors de la construction de l'objet, ne doit pas se faire
|
// le premier appel a redo, lors de la construction de l'objet, ne doit pas se faire
|
||||||
if (first_redo) {
|
if (first_redo) {
|
||||||
|
editor_scene -> clearSelection();
|
||||||
|
part -> setSelected(true);
|
||||||
first_redo = false;
|
first_redo = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,14 +128,17 @@ void ElementScene::mousePressEvent(QGraphicsSceneMouseEvent *e) {
|
|||||||
case Ellipse:
|
case Ellipse:
|
||||||
current_ellipse = new PartEllipse(element_editor, 0, this);
|
current_ellipse = new PartEllipse(element_editor, 0, this);
|
||||||
current_ellipse -> setRect(QRectF(e -> scenePos(), QSizeF(0.0, 0.0)));
|
current_ellipse -> setRect(QRectF(e -> scenePos(), QSizeF(0.0, 0.0)));
|
||||||
|
current_ellipse -> setProperty("antialias", true);
|
||||||
break;
|
break;
|
||||||
case Arc:
|
case Arc:
|
||||||
current_arc = new PartArc(element_editor, 0, this);
|
current_arc = new PartArc(element_editor, 0, this);
|
||||||
current_arc -> setRect(QRectF(e -> scenePos(), QSizeF(0.0, 0.0)));
|
current_arc -> setRect(QRectF(e -> scenePos(), QSizeF(0.0, 0.0)));
|
||||||
|
current_arc -> setProperty("antialias", true);
|
||||||
break;
|
break;
|
||||||
case Circle:
|
case Circle:
|
||||||
current_circle = new PartCircle(element_editor, 0, this);
|
current_circle = new PartCircle(element_editor, 0, this);
|
||||||
current_circle -> setRect(QRectF(e -> scenePos(), QSizeF(0.0, 0.0)));
|
current_circle -> setRect(QRectF(e -> scenePos(), QSizeF(0.0, 0.0)));
|
||||||
|
current_circle -> setProperty("antialias", true);
|
||||||
break;
|
break;
|
||||||
case Polygon:
|
case Polygon:
|
||||||
if (current_polygon == NULL) {
|
if (current_polygon == NULL) {
|
||||||
|
|||||||
@@ -16,9 +16,6 @@ ExportDialog::ExportDialog(Diagram *dia, QWidget *parent) : QDialog(parent) {
|
|||||||
diagram_ratio = (qreal)diagram_size.width() / (qreal)diagram_size.height();
|
diagram_ratio = (qreal)diagram_size.width() / (qreal)diagram_size.height();
|
||||||
dontchangewidth = dontchangeheight = false;
|
dontchangewidth = dontchangeheight = false;
|
||||||
|
|
||||||
// vecteur contenant 256 nuances de gris, pour exporter les images sans couleur
|
|
||||||
for (int i = 0 ; i < 256 ; ++ i) ColorTab << qRgb(i, i, i);
|
|
||||||
|
|
||||||
// la taille du dialogue est fixee
|
// la taille du dialogue est fixee
|
||||||
setFixedSize(800, 360);
|
setFixedSize(800, 360);
|
||||||
setWindowTitle(tr("Exporter"));
|
setWindowTitle(tr("Exporter"));
|
||||||
@@ -54,7 +51,6 @@ ExportDialog::ExportDialog(Diagram *dia, QWidget *parent) : QDialog(parent) {
|
|||||||
connect(draw_inset, SIGNAL(stateChanged(int) ), this, SLOT(slot_refreshPreview()));
|
connect(draw_inset, SIGNAL(stateChanged(int) ), this, SLOT(slot_refreshPreview()));
|
||||||
connect(draw_columns, SIGNAL(stateChanged(int) ), this, SLOT(slot_refreshPreview()));
|
connect(draw_columns, SIGNAL(stateChanged(int) ), this, SLOT(slot_refreshPreview()));
|
||||||
connect(draw_terminals, SIGNAL(stateChanged(int) ), this, SLOT(slot_refreshPreview()));
|
connect(draw_terminals, SIGNAL(stateChanged(int) ), this, SLOT(slot_refreshPreview()));
|
||||||
connect(keep_colors, SIGNAL(stateChanged(int) ), this, SLOT(slot_refreshPreview()));
|
|
||||||
connect(width, SIGNAL(valueChanged(int) ), this, SLOT(slot_refreshPreview()));
|
connect(width, SIGNAL(valueChanged(int) ), this, SLOT(slot_refreshPreview()));
|
||||||
connect(height, SIGNAL(valueChanged(int) ), this, SLOT(slot_refreshPreview()));
|
connect(height, SIGNAL(valueChanged(int) ), this, SLOT(slot_refreshPreview()));
|
||||||
connect(export_border, SIGNAL(toggled (bool)), this, SLOT(slot_changeUseBorder()));
|
connect(export_border, SIGNAL(toggled (bool)), this, SLOT(slot_changeUseBorder()));
|
||||||
@@ -126,7 +122,6 @@ QGroupBox *ExportDialog::setupOptionsGroupBox() {
|
|||||||
// dessiner la grille
|
// dessiner la grille
|
||||||
draw_grid = new QCheckBox(tr("Dessiner la grille"), groupbox_options);
|
draw_grid = new QCheckBox(tr("Dessiner la grille"), groupbox_options);
|
||||||
optionshlayout -> addWidget(draw_grid, 1, 0);
|
optionshlayout -> addWidget(draw_grid, 1, 0);
|
||||||
draw_grid -> setChecked(diagram -> displayGrid());
|
|
||||||
|
|
||||||
// dessiner le cadre
|
// dessiner le cadre
|
||||||
draw_border = new QCheckBox(tr("Dessiner le cadre"), groupbox_options);
|
draw_border = new QCheckBox(tr("Dessiner le cadre"), groupbox_options);
|
||||||
@@ -143,13 +138,9 @@ QGroupBox *ExportDialog::setupOptionsGroupBox() {
|
|||||||
optionshlayout -> addWidget(draw_columns, 2, 1);
|
optionshlayout -> addWidget(draw_columns, 2, 1);
|
||||||
draw_columns -> setChecked(diagram -> border_and_inset.columnsAreDisplayed());
|
draw_columns -> setChecked(diagram -> border_and_inset.columnsAreDisplayed());
|
||||||
|
|
||||||
// Conserver les couleurs
|
|
||||||
keep_colors = new QCheckBox(tr("Conserver les couleurs"), groupbox_options);
|
|
||||||
optionshlayout -> addWidget(keep_colors, 3, 0);
|
|
||||||
|
|
||||||
// dessiner les bornes
|
// dessiner les bornes
|
||||||
draw_terminals = new QCheckBox(tr("Dessiner les bornes"), groupbox_options);
|
draw_terminals = new QCheckBox(tr("Dessiner les bornes"), groupbox_options);
|
||||||
optionshlayout -> addWidget(draw_terminals, 3, 1);
|
optionshlayout -> addWidget(draw_terminals, 3, 0);
|
||||||
|
|
||||||
return(groupbox_options);
|
return(groupbox_options);
|
||||||
}
|
}
|
||||||
@@ -277,11 +268,6 @@ QImage ExportDialog::generateImage() {
|
|||||||
keep_aspect_ratio -> isChecked() ? Qt::KeepAspectRatio : Qt::IgnoreAspectRatio
|
keep_aspect_ratio -> isChecked() ? Qt::KeepAspectRatio : Qt::IgnoreAspectRatio
|
||||||
);
|
);
|
||||||
|
|
||||||
// convertit l'image en niveaux de gris si besoin
|
|
||||||
if (!keep_colors -> isChecked()) {
|
|
||||||
image = image.convertToFormat(QImage::Format_Indexed8, ColorTab, Qt::ThresholdDither);
|
|
||||||
}
|
|
||||||
|
|
||||||
saveReloadDiagramParameters(false);
|
saveReloadDiagramParameters(false);
|
||||||
|
|
||||||
return(image);
|
return(image);
|
||||||
@@ -348,7 +334,7 @@ void ExportDialog::generateSvg(QFile &file) {
|
|||||||
svg_engine.setOutputDevice(&file);
|
svg_engine.setOutputDevice(&file);
|
||||||
QPainter svg_painter(&svg_engine);
|
QPainter svg_painter(&svg_engine);
|
||||||
picture.play(&svg_painter);
|
picture.play(&svg_painter);
|
||||||
/// @todo gerer l'enlevement des couleurs
|
|
||||||
saveReloadDiagramParameters(false);
|
saveReloadDiagramParameters(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ class ExportDialog : public QDialog {
|
|||||||
QCheckBox *draw_inset;
|
QCheckBox *draw_inset;
|
||||||
QCheckBox *draw_columns;
|
QCheckBox *draw_columns;
|
||||||
QCheckBox *draw_terminals;
|
QCheckBox *draw_terminals;
|
||||||
QCheckBox *keep_colors;
|
|
||||||
QRadioButton *export_elements;
|
QRadioButton *export_elements;
|
||||||
QRadioButton *export_border;
|
QRadioButton *export_border;
|
||||||
QDialogButtonBox *buttons;
|
QDialogButtonBox *buttons;
|
||||||
|
|||||||
Reference in New Issue
Block a user