mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 08:10:52 +01:00
Classe "Borne" renommee en "Terminal"
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@45 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
10
element.cpp
10
element.cpp
@@ -8,7 +8,7 @@
|
||||
Constructeur pour un element sans scene ni parent
|
||||
*/
|
||||
Element::Element(QGraphicsItem *parent, Diagram *scene) : QGraphicsItem(parent, scene) {
|
||||
peut_relier_ses_propres_bornes = false;
|
||||
peut_relier_ses_propres_terminals = false;
|
||||
setZValue(10);
|
||||
}
|
||||
|
||||
@@ -107,17 +107,17 @@ QPixmap Element::pixmap() {
|
||||
QVariant Element::itemChange(GraphicsItemChange change, const QVariant &value) {
|
||||
if (change == QGraphicsItem::ItemPositionChange) {
|
||||
foreach(QGraphicsItem *qgi, children()) {
|
||||
if (Borne *p = qgraphicsitem_cast<Borne *>(qgi)) p -> updateConducteur(value.toPointF());
|
||||
if (Terminal *p = qgraphicsitem_cast<Terminal *>(qgi)) p -> updateConducteur(value.toPointF());
|
||||
}
|
||||
} else if (change == QGraphicsItem::ItemSelectedChange) {
|
||||
foreach(QGraphicsItem *qgi, children()) {
|
||||
if (Borne *p = qgraphicsitem_cast<Borne *>(qgi)) p -> updateConducteur();
|
||||
if (Terminal *p = qgraphicsitem_cast<Terminal *>(qgi)) p -> updateConducteur();
|
||||
}
|
||||
}
|
||||
return(QGraphicsItem::itemChange(change, value));
|
||||
}
|
||||
|
||||
bool Element::setOrientation(Borne::Orientation o) {
|
||||
bool Element::setOrientation(Terminal::Orientation o) {
|
||||
// verifie que l'orientation demandee est acceptee
|
||||
if (!acceptOrientation(o)) return(false);
|
||||
prepareGeometryChange();
|
||||
@@ -126,7 +126,7 @@ bool Element::setOrientation(Borne::Orientation o) {
|
||||
ori = o;
|
||||
update();
|
||||
foreach(QGraphicsItem *qgi, children()) {
|
||||
if (Borne *p = qgraphicsitem_cast<Borne *>(qgi)) p -> updateConducteur();
|
||||
if (Terminal *p = qgraphicsitem_cast<Terminal *>(qgi)) p -> updateConducteur();
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user