mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Rapatriement dans la branche 0.3 des revisions 833 a 839.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@840 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -268,7 +268,7 @@ void BorderInset::draw(QPainter *qp, qreal x, qreal y) {
|
|||||||
qp -> drawText(inset_date, Qt::AlignVCenter | Qt::AlignLeft, QString(tr(" Date : %1", "inset content")).arg(bi_date.toString("dd/MM/yyyy")));
|
qp -> drawText(inset_date, Qt::AlignVCenter | Qt::AlignLeft, QString(tr(" Date : %1", "inset content")).arg(bi_date.toString("dd/MM/yyyy")));
|
||||||
|
|
||||||
qp -> drawRect(inset_title);
|
qp -> drawRect(inset_title);
|
||||||
qp -> drawText(inset_title, Qt::AlignVCenter | Qt::AlignCenter, QString(tr("Titre du document : %1", "inset content")).arg(bi_title));
|
qp -> drawText(inset_title, Qt::AlignVCenter | Qt::AlignCenter, QString("%1").arg(bi_title));
|
||||||
|
|
||||||
qp -> drawRect(inset_file);
|
qp -> drawRect(inset_file);
|
||||||
qp -> drawText(inset_file, Qt::AlignVCenter | Qt::AlignLeft, QString(tr(" Fichier : %1", "inset content")).arg(bi_filename));
|
qp -> drawText(inset_file, Qt::AlignVCenter | Qt::AlignLeft, QString(tr(" Fichier : %1", "inset content")).arg(bi_filename));
|
||||||
|
|||||||
@@ -111,11 +111,13 @@ void Diagram::drawBackground(QPainter *p, const QRectF &r) {
|
|||||||
int g_y = (int)ceil(r.y());
|
int g_y = (int)ceil(r.y());
|
||||||
while (g_y % yGrid) ++ g_y;
|
while (g_y % yGrid) ++ g_y;
|
||||||
|
|
||||||
|
QPolygon points;
|
||||||
for (int gx = g_x ; gx < limite_x ; gx += xGrid) {
|
for (int gx = g_x ; gx < limite_x ; gx += xGrid) {
|
||||||
for (int gy = g_y ; gy < limite_y ; gy += yGrid) {
|
for (int gy = g_y ; gy < limite_y ; gy += yGrid) {
|
||||||
p -> drawPoint(gx, gy);
|
points << QPoint(gx, gy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
p -> drawPoints(points);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_border) border_and_inset.draw(p, margin, margin);
|
if (use_border) border_and_inset.draw(p, margin, margin);
|
||||||
|
|||||||
@@ -121,7 +121,12 @@ void DiagramPrintDialog::exec() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Apercu avant impression
|
// Apercu avant impression
|
||||||
|
#if defined Q_WS_X11
|
||||||
|
// suite a quelques soucis avec xfwm, on se contente d'une fenetre sous X11
|
||||||
|
QETPrintPreviewDialog preview_dialog(project_, printer_, parentWidget(), Qt::Window);
|
||||||
|
#else
|
||||||
QETPrintPreviewDialog preview_dialog(project_, printer_, parentWidget());
|
QETPrintPreviewDialog preview_dialog(project_, printer_, parentWidget());
|
||||||
|
#endif
|
||||||
connect(
|
connect(
|
||||||
&preview_dialog,
|
&preview_dialog,
|
||||||
SIGNAL(paintRequested(const QList<Diagram *> &, bool, const ExportProperties, QPrinter *)),
|
SIGNAL(paintRequested(const QList<Diagram *> &, bool, const ExportProperties, QPrinter *)),
|
||||||
|
|||||||
@@ -25,15 +25,23 @@
|
|||||||
@param parent QWidget parent de ce widget
|
@param parent QWidget parent de ce widget
|
||||||
*/
|
*/
|
||||||
DiagramsChooser::DiagramsChooser(QETProject *project, QWidget *parent) :
|
DiagramsChooser::DiagramsChooser(QETProject *project, QWidget *parent) :
|
||||||
QFrame(parent),
|
QScrollArea(parent),
|
||||||
project_(project),
|
project_(project),
|
||||||
|
widget0_(0),
|
||||||
vlayout0_(0)
|
vlayout0_(0)
|
||||||
{
|
{
|
||||||
setFrameShadow(QFrame::Sunken);
|
setFrameShadow(QFrame::Sunken);
|
||||||
setFrameShape(QFrame::StyledPanel);
|
setFrameShape(QFrame::StyledPanel);
|
||||||
setLineWidth(3);
|
setLineWidth(3);
|
||||||
setMidLineWidth(3);
|
setMidLineWidth(3);
|
||||||
|
|
||||||
|
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||||
|
setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||||
|
|
||||||
updateList();
|
updateList();
|
||||||
|
|
||||||
|
setWidget(widget0_);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -163,7 +171,6 @@ void DiagramsChooser::updateList() {
|
|||||||
diagrams_.insert(diagram, checkbox);
|
diagrams_.insert(diagram, checkbox);
|
||||||
vlayout0_ -> addWidget(checkbox, 0, Qt::AlignLeft | Qt::AlignTop);
|
vlayout0_ -> addWidget(checkbox, 0, Qt::AlignLeft | Qt::AlignTop);
|
||||||
}
|
}
|
||||||
vlayout0_ -> addStretch();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -172,5 +179,9 @@ void DiagramsChooser::updateList() {
|
|||||||
void DiagramsChooser::buildLayout() {
|
void DiagramsChooser::buildLayout() {
|
||||||
if (vlayout0_) return;
|
if (vlayout0_) return;
|
||||||
vlayout0_ = new QVBoxLayout();
|
vlayout0_ = new QVBoxLayout();
|
||||||
setLayout(vlayout0_);
|
widget0_ = new QWidget();
|
||||||
|
widget0_ -> setLayout(vlayout0_);
|
||||||
|
widget0_ -> setMinimumSize(170, 0);
|
||||||
|
widget0_ -> setMaximumSize(470, 10000);
|
||||||
|
widget0_ -> setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class Diagram;
|
|||||||
Cette classe represente un widget permettant de choisir 0 a n schemas parmi
|
Cette classe represente un widget permettant de choisir 0 a n schemas parmi
|
||||||
ceux d'un projet.
|
ceux d'un projet.
|
||||||
*/
|
*/
|
||||||
class DiagramsChooser : public QFrame {
|
class DiagramsChooser : public QScrollArea {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
// constructeurs, destructeur
|
// constructeurs, destructeur
|
||||||
@@ -55,6 +55,7 @@ class DiagramsChooser : public QFrame {
|
|||||||
// attributs
|
// attributs
|
||||||
private:
|
private:
|
||||||
QETProject *project_;
|
QETProject *project_;
|
||||||
|
QWidget *widget0_;
|
||||||
QVBoxLayout *vlayout0_;
|
QVBoxLayout *vlayout0_;
|
||||||
QHash<Diagram *, QCheckBox *> diagrams_;
|
QHash<Diagram *, QCheckBox *> diagrams_;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ QETPrintPreviewDialog::QETPrintPreviewDialog(QETProject *project, QPrinter *prin
|
|||||||
connect(diagrams_list_, SIGNAL(selectionChanged()), preview_, SLOT(updatePreview()));
|
connect(diagrams_list_, SIGNAL(selectionChanged()), preview_, SLOT(updatePreview()));
|
||||||
connect(diagrams_list_, SIGNAL(selectionChanged()), this, SLOT(checkDiagramsCount()));
|
connect(diagrams_list_, SIGNAL(selectionChanged()), this, SLOT(checkDiagramsCount()));
|
||||||
|
|
||||||
setWindowState(Qt::WindowMaximized);
|
setWindowState(windowState() | Qt::WindowMaximized);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -148,6 +148,20 @@ void QETPrintPreviewDialog::zoomOut() {
|
|||||||
updateZoomList();
|
updateZoomList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Selectionne tous les schemas
|
||||||
|
*/
|
||||||
|
void QETPrintPreviewDialog::selectAllDiagrams() {
|
||||||
|
diagrams_list_ -> setSelectedAllDiagrams(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Deselectionne tous les schemas
|
||||||
|
*/
|
||||||
|
void QETPrintPreviewDialog::selectNoDiagram() {
|
||||||
|
diagrams_list_ -> setSelectedAllDiagrams(false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Met en place le dialogue
|
Met en place le dialogue
|
||||||
*/
|
*/
|
||||||
@@ -155,6 +169,8 @@ void QETPrintPreviewDialog::build() {
|
|||||||
preview_ = new QPrintPreviewWidget(printer_);
|
preview_ = new QPrintPreviewWidget(printer_);
|
||||||
diagrams_label_ = new QLabel(tr("Sch\351mas \340 imprimer\240:"));
|
diagrams_label_ = new QLabel(tr("Sch\351mas \340 imprimer\240:"));
|
||||||
diagrams_list_ = new DiagramsChooser(project_);
|
diagrams_list_ = new DiagramsChooser(project_);
|
||||||
|
diagrams_select_all_ = new QPushButton(tr("Tout cocher"));
|
||||||
|
diagrams_select_none_ = new QPushButton(tr("Tout d\351cocher"));
|
||||||
toggle_diagrams_list_ = new QAction(QET::Icons::Diagram, tr("Cacher la liste des sch\351mas"), this);
|
toggle_diagrams_list_ = new QAction(QET::Icons::Diagram, tr("Cacher la liste des sch\351mas"), this);
|
||||||
toggle_print_options_ = new QAction(QET::Icons::Configure, tr("Cacher les options d'impression"), this);
|
toggle_print_options_ = new QAction(QET::Icons::Configure, tr("Cacher les options d'impression"), this);
|
||||||
adjust_width_ = new QAction(QET::Icons::ViewFitWidth, tr("Ajuster la largeur"), this);
|
adjust_width_ = new QAction(QET::Icons::ViewFitWidth, tr("Ajuster la largeur"), this);
|
||||||
@@ -245,6 +261,8 @@ void QETPrintPreviewDialog::build() {
|
|||||||
buttons_ -> addButton(new QPushButton(QET::Icons::DocumentPrint, tr("Imprimer")), QDialogButtonBox::AcceptRole);
|
buttons_ -> addButton(new QPushButton(QET::Icons::DocumentPrint, tr("Imprimer")), QDialogButtonBox::AcceptRole);
|
||||||
buttons_ -> addButton(QDialogButtonBox::Cancel);
|
buttons_ -> addButton(QDialogButtonBox::Cancel);
|
||||||
|
|
||||||
|
connect(diagrams_select_all_, SIGNAL(released()), this, SLOT(selectAllDiagrams()));
|
||||||
|
connect(diagrams_select_none_, SIGNAL(released()), this, SLOT(selectNoDiagram()));
|
||||||
connect(toggle_diagrams_list_, SIGNAL(toggled(bool)), this, SLOT(setDiagramsListVisible(bool)));
|
connect(toggle_diagrams_list_, SIGNAL(toggled(bool)), this, SLOT(setDiagramsListVisible(bool)));
|
||||||
connect(toggle_print_options_, SIGNAL(toggled(bool)), this, SLOT(setPrintOptionsVisible(bool)));
|
connect(toggle_print_options_, SIGNAL(toggled(bool)), this, SLOT(setPrintOptionsVisible(bool)));
|
||||||
connect(adjust_width_, SIGNAL(triggered()), preview_, SLOT(fitToWidth()));
|
connect(adjust_width_, SIGNAL(triggered()), preview_, SLOT(fitToWidth()));
|
||||||
@@ -286,6 +304,8 @@ void QETPrintPreviewDialog::build() {
|
|||||||
|
|
||||||
vlayout2_ -> addWidget(diagrams_label_);
|
vlayout2_ -> addWidget(diagrams_label_);
|
||||||
vlayout2_ -> addWidget(diagrams_list_);
|
vlayout2_ -> addWidget(diagrams_list_);
|
||||||
|
vlayout2_ -> addWidget(diagrams_select_all_);
|
||||||
|
vlayout2_ -> addWidget(diagrams_select_none_);
|
||||||
|
|
||||||
hlayout0_ -> addLayout(vlayout2_);
|
hlayout0_ -> addLayout(vlayout2_);
|
||||||
hlayout0_ -> addWidget(preview_);
|
hlayout0_ -> addWidget(preview_);
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ class QETPrintPreviewDialog : public QDialog {
|
|||||||
void fitDiagramToPage(bool);
|
void fitDiagramToPage(bool);
|
||||||
void zoomIn();
|
void zoomIn();
|
||||||
void zoomOut();
|
void zoomOut();
|
||||||
|
void selectAllDiagrams();
|
||||||
|
void selectNoDiagram();
|
||||||
|
|
||||||
// attributs
|
// attributs
|
||||||
private:
|
private:
|
||||||
@@ -70,6 +72,8 @@ class QETPrintPreviewDialog : public QDialog {
|
|||||||
QPrintPreviewWidget *preview_;
|
QPrintPreviewWidget *preview_;
|
||||||
QLabel *diagrams_label_;
|
QLabel *diagrams_label_;
|
||||||
DiagramsChooser *diagrams_list_;
|
DiagramsChooser *diagrams_list_;
|
||||||
|
QPushButton *diagrams_select_all_;
|
||||||
|
QPushButton *diagrams_select_none_;
|
||||||
QAction *toggle_diagrams_list_;
|
QAction *toggle_diagrams_list_;
|
||||||
QAction *toggle_print_options_;
|
QAction *toggle_print_options_;
|
||||||
QAction *adjust_width_;
|
QAction *adjust_width_;
|
||||||
|
|||||||
Reference in New Issue
Block a user