[qet] [2674] Diagram View now white and gray, Print always in white |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 2674
Author: abhishekm71
Date: 2013-12-29 14:25:09 +0100 (Sun, 29 Dec 2013)
Log Message:
-----------
Diagram View now white and gray, Print always in white
Modified Paths:
--------------
trunk/sources/diagram.cpp
trunk/sources/diagram.h
trunk/sources/diagramprintdialog.h
trunk/sources/diagramview.cpp
Modified: trunk/sources/diagram.cpp
===================================================================
--- trunk/sources/diagram.cpp 2013-12-28 20:39:38 UTC (rev 2673)
+++ trunk/sources/diagram.cpp 2013-12-29 13:25:09 UTC (rev 2674)
@@ -39,6 +39,7 @@
// static variable to keep track of present background color of the diagram.
QColor Diagram::background_color = Qt::white;
+
/**
Constructeur
@param parent Le QObject parent du schema
@@ -123,17 +124,16 @@
// dessine un fond blanc
p -> setPen(Qt::NoPen);
+
//set brush color to present background color.
p -> setBrush(Diagram::background_color);
+
p -> drawRect(r);
if (draw_grid_) {
+
// dessine les points de la grille
- // if background color is black, then grid spots shall be white, else they shall be black in color.
- if (Diagram::background_color == Qt::black)
- p -> setPen(Qt::white);
- else
- p -> setPen(Qt::black);
+ p -> setPen(Qt::black);
p -> setBrush(Qt::NoBrush);
qreal limite_x = r.x() + r.width();
qreal limite_y = r.y() + r.height();
@@ -936,15 +936,6 @@
return(elements_list);
}
-QList <Element *> Diagram::elements() const {
- QList<Element *> element_list;
- foreach (QGraphicsItem *qgi, items()) {
- if (Element *elmt = qgraphicsitem_cast<Element *>(qgi))
- element_list <<elmt;
- }
- return (element_list);
-}
-
/**
Initialise un deplacement d'elements, conducteurs et champs de texte sur le
schema.
Modified: trunk/sources/diagram.h
===================================================================
--- trunk/sources/diagram.h 2013-12-28 20:39:38 UTC (rev 2673)
+++ trunk/sources/diagram.h 2013-12-29 13:25:09 UTC (rev 2674)
@@ -79,6 +79,7 @@
static const qreal margin;
/// background color of diagram
static QColor background_color;
+
private:
QGraphicsLineItem *conductor_setter_;
ElementsMover *elements_mover_;
@@ -165,7 +166,6 @@
bool isEmpty() const;
QList<CustomElement *> customElements() const;
- QList<Element *> elements() const;
QSet<DiagramTextItem *> selectedTexts() const;
QSet<ConductorTextItem *> selectedConductorTexts() const;
QSet<Conductor *> selectedConductors() const;
Modified: trunk/sources/diagramprintdialog.h
===================================================================
--- trunk/sources/diagramprintdialog.h 2013-12-28 20:39:38 UTC (rev 2673)
+++ trunk/sources/diagramprintdialog.h 2013-12-29 13:25:09 UTC (rev 2674)
@@ -83,6 +83,7 @@
QLineEdit *filepath_field_;
QPushButton *browse_button_;
QDialogButtonBox *buttons_;
+
QColor backup_diagram_background_color;
};
#endif
Modified: trunk/sources/diagramview.cpp
===================================================================
--- trunk/sources/diagramview.cpp 2013-12-28 20:39:38 UTC (rev 2673)
+++ trunk/sources/diagramview.cpp 2013-12-29 13:25:09 UTC (rev 2674)
@@ -652,9 +652,11 @@
/// TODO implement an undo command to allow the user to undo/redo this action
scene -> defaultConductorProperties = new_conductors;
}
+
// adjustSceneRect shall be called whenever the user accepts the dialog
// even if no changes have been made.
// Added so that diagram refreshes after back-ground color change.
+
//if (adjust_scene)
adjustSceneRect();
}