mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Minor fix : locked item isn't moved by arrow key or multiple selections.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4030 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -80,6 +80,25 @@ void DiagramContent::clear() {
|
||||
otherConductors.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DiagramContent::removeNonMovableItems
|
||||
* Remove all non movable item.
|
||||
* @return : return the numbers of removed item
|
||||
*/
|
||||
int DiagramContent::removeNonMovableItems()
|
||||
{
|
||||
int count_ = 0;
|
||||
|
||||
foreach(Element *elmt, elements)
|
||||
if (!elmt->isMovable()) elements.remove(elmt); ++count_;
|
||||
foreach(DiagramImageItem *img, images)
|
||||
if (!img->isMovable()) images.remove(img); ++count_;
|
||||
foreach (QetShapeItem *shape, shapes)
|
||||
if (!shape->isMovable()) shapes.remove(shape); ++count_;
|
||||
|
||||
return count_;
|
||||
}
|
||||
|
||||
/**
|
||||
@param filter Types desires
|
||||
@return la liste des items formant le contenu du schema
|
||||
|
||||
@@ -78,6 +78,7 @@ class DiagramContent {
|
||||
QString sentence(int = All) const;
|
||||
int count(int = All) const;
|
||||
void clear();
|
||||
int removeNonMovableItems();
|
||||
};
|
||||
QDebug &operator<<(QDebug, DiagramContent &);
|
||||
#endif
|
||||
|
||||
@@ -76,6 +76,7 @@ int ElementsMover::beginMovement(Diagram *diagram, QGraphicsItem *driver_item) {
|
||||
current_movement_ = QPointF(0.0, 0.0);
|
||||
|
||||
moved_content_ = diagram -> selectedContent();
|
||||
moved_content_.removeNonMovableItems();
|
||||
|
||||
if (!moved_content_.count()) return(-1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user