[qet] [2676] Revert previous commit

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 2676
Author:   scorpio810
Date:     2013-12-29 14:39:48 +0100 (Sun, 29 Dec 2013)
Log Message:
-----------
Revert previous commit

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-29 13:27:46 UTC (rev 2675)
+++ trunk/sources/diagram.cpp	2013-12-29 13:39:48 UTC (rev 2676)
@@ -39,7 +39,6 @@
 
 // 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
@@ -124,16 +123,17 @@
 	
 	// 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
-		p -> setPen(Qt::black);
+		// 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 -> setBrush(Qt::NoBrush);
 		qreal limite_x = r.x() + r.width();
 		qreal limite_y = r.y() + r.height();
@@ -936,6 +936,15 @@
 	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-29 13:27:46 UTC (rev 2675)
+++ trunk/sources/diagram.h	2013-12-29 13:39:48 UTC (rev 2676)
@@ -79,7 +79,6 @@
 	static const qreal margin;
 	/// background color of diagram
 	static QColor background_color;
-	
 	private:
 	QGraphicsLineItem *conductor_setter_;
 	ElementsMover *elements_mover_;
@@ -166,6 +165,7 @@
 	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-29 13:27:46 UTC (rev 2675)
+++ trunk/sources/diagramprintdialog.h	2013-12-29 13:39:48 UTC (rev 2676)
@@ -83,7 +83,6 @@
 	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-29 13:27:46 UTC (rev 2675)
+++ trunk/sources/diagramview.cpp	2013-12-29 13:39:48 UTC (rev 2676)
@@ -652,11 +652,9 @@
 			/// 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();
 	}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/