mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-23 02:10:52 +01:00
Dans l'editeur d'elements, les changements de dimensions et de point de saisie sont desormais annulables
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@119 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -384,6 +384,10 @@ void ElementScene::fromXml(const QDomDocument &xml_document) {
|
||||
}
|
||||
}
|
||||
|
||||
QRectF ElementScene::sceneContent() const {
|
||||
return(itemsBoundingRect().unite(QRectF(-_hotspot, QSizeF(width(), height()))));
|
||||
}
|
||||
|
||||
QUndoStack &ElementScene::undoStack() {
|
||||
return(undo_stack);
|
||||
}
|
||||
@@ -446,15 +450,16 @@ void ElementScene::slot_editSizeHotSpot() {
|
||||
|
||||
// lance le dialogue
|
||||
if (dialog_sh.exec() == QDialog::Accepted) {
|
||||
setWidth(hotspot_editor -> elementWidth());
|
||||
setHeight(hotspot_editor -> elementHeight());
|
||||
setHotspot(hotspot_editor -> hotspot());
|
||||
if (hotspot_editor -> mustTranslateParts()) {
|
||||
QPoint translation = hotspot_editor -> offsetParts();
|
||||
foreach(QGraphicsItem *qgi, items()) {
|
||||
qgi -> translate(translation.x(), translation.y());
|
||||
}
|
||||
}
|
||||
undo_stack.push(
|
||||
new ChangeHotspotCommand(
|
||||
this,
|
||||
QSize(width(), height()),
|
||||
hotspot_editor -> elementSize(),
|
||||
_hotspot,
|
||||
hotspot_editor -> hotspot(),
|
||||
hotspot_editor -> mustTranslateParts() ? hotspot_editor -> offsetParts() : QPoint()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user