mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 06:20:53 +01:00
Corrections de bugs mineurs au niveau de l'impression :
* les objets selectionnes etaient imprimes tels quels * apres selection d'un chemin pour un fichier PDF/PS sous Windows, celuik-ci apparaissait avec des / et non des \ * ce meme champ evite desormais d'afficher des doubles / ou doubles \ git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@823 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -320,6 +320,7 @@ void DiagramPrintDialog::browseFilePrintTypeDialog() {
|
|||||||
|
|
||||||
if (!filepath.isEmpty()) {
|
if (!filepath.isEmpty()) {
|
||||||
if (!filepath.endsWith(extension)) filepath += extension;
|
if (!filepath.endsWith(extension)) filepath += extension;
|
||||||
|
filepath = QDir::toNativeSeparators(QDir::cleanPath(filepath));
|
||||||
filepath_field_ -> setText(filepath);
|
filepath_field_ -> setText(filepath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -372,6 +373,10 @@ void DiagramPrintDialog::printDiagram(Diagram *diagram, bool fit_page, const Exp
|
|||||||
|
|
||||||
saveReloadDiagramParameters(diagram, options, true);
|
saveReloadDiagramParameters(diagram, options, true);
|
||||||
|
|
||||||
|
// deselectionne tous les elements
|
||||||
|
QList<QGraphicsItem *> selected_elmts = diagram -> selectedItems();
|
||||||
|
foreach (QGraphicsItem *qgi, selected_elmts) qgi -> setSelected(false);
|
||||||
|
|
||||||
if (fit_page) {
|
if (fit_page) {
|
||||||
// impression adaptee sur une seule page
|
// impression adaptee sur une seule page
|
||||||
diagram -> render(qp, QRectF(), diagramRect(diagram), Qt::KeepAspectRatio);
|
diagram -> render(qp, QRectF(), diagramRect(diagram), Qt::KeepAspectRatio);
|
||||||
@@ -415,10 +420,7 @@ void DiagramPrintDialog::printDiagram(Diagram *diagram, bool fit_page, const Exp
|
|||||||
QVector<QRect> pages_to_print;
|
QVector<QRect> pages_to_print;
|
||||||
for (int i = 0 ; i < v_pages_count ; ++ i) {
|
for (int i = 0 ; i < v_pages_count ; ++ i) {
|
||||||
for (int j = 0 ; j < h_pages_count ; ++ j) {
|
for (int j = 0 ; j < h_pages_count ; ++ j) {
|
||||||
//int page_number = (i * h_pages_count) + j + 1;
|
|
||||||
//if (page_number >= first_page && page_number <= last_page) {
|
|
||||||
pages_to_print << pages_grid.at(i).at(j);
|
pages_to_print << pages_grid.at(i).at(j);
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//qDebug() << " " << pages_to_print.count() << " pages a imprimer :";
|
//qDebug() << " " << pages_to_print.count() << " pages a imprimer :";
|
||||||
@@ -438,6 +440,10 @@ void DiagramPrintDialog::printDiagram(Diagram *diagram, bool fit_page, const Exp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// restaure les elements selectionnes
|
||||||
|
foreach (QGraphicsItem *qgi, selected_elmts) qgi -> setSelected(true);
|
||||||
|
|
||||||
saveReloadDiagramParameters(diagram, options, false);
|
saveReloadDiagramParameters(diagram, options, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -513,7 +513,7 @@ void ProjectView::printProject() {
|
|||||||
QString dir_path = project_ -> currentDir();
|
QString dir_path = project_ -> currentDir();
|
||||||
|
|
||||||
// determine un chemin pour le pdf / ps
|
// determine un chemin pour le pdf / ps
|
||||||
QString file_name = QDir::toNativeSeparators(dir_path + "/" + doc_name);
|
QString file_name = QDir::toNativeSeparators(QDir::cleanPath(dir_path + "/" + doc_name));
|
||||||
|
|
||||||
DiagramPrintDialog print_dialog(project_, this);
|
DiagramPrintDialog print_dialog(project_, this);
|
||||||
print_dialog.setDocName(doc_name);
|
print_dialog.setDocName(doc_name);
|
||||||
|
|||||||
Reference in New Issue
Block a user