Revert previous commit

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2676 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
scorpio810
2013-12-29 13:39:48 +00:00
parent 5eecfedd02
commit c0262b4fc1
4 changed files with 15 additions and 9 deletions

View File

@@ -39,7 +39,6 @@ const qreal Diagram::margin = 5.0;
// 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 @@ void Diagram::drawBackground(QPainter *p, const QRectF &r) {
// 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 @@ QList<CustomElement *> Diagram::customElements() const {
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.