mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
added English comments
This commit is contained in:
@@ -307,10 +307,12 @@ ElementContent ElementView::pasteAreaDefined(const QRectF &target_rect) {
|
|||||||
@param pos Coin superieur gauche du rectangle cible
|
@param pos Coin superieur gauche du rectangle cible
|
||||||
*/
|
*/
|
||||||
ElementContent ElementView::paste(const QDomDocument &xml_document, const QPointF &pos) {
|
ElementContent ElementView::paste(const QDomDocument &xml_document, const QPointF &pos) {
|
||||||
|
// object to retrieve content added to the scheme by pasting
|
||||||
// objet pour recuperer le contenu ajoute au schema par le coller
|
// objet pour recuperer le contenu ajoute au schema par le coller
|
||||||
ElementContent content_pasted;
|
ElementContent content_pasted;
|
||||||
m_scene -> fromXml(xml_document, pos, false, &content_pasted);
|
m_scene -> fromXml(xml_document, pos, false, &content_pasted);
|
||||||
|
|
||||||
|
// if something has actually been added to the scheme, an undo object is created
|
||||||
// si quelque chose a effectivement ete ajoute au schema, on cree un objet d'annulation
|
// si quelque chose a effectivement ete ajoute au schema, on cree un objet d'annulation
|
||||||
if (content_pasted.count()) {
|
if (content_pasted.count()) {
|
||||||
m_scene -> clearSelection();
|
m_scene -> clearSelection();
|
||||||
@@ -334,6 +336,7 @@ ElementContent ElementView::pasteWithOffset(const QDomDocument &xml_document) {
|
|||||||
QRectF pasted_content_bounding_rect = m_scene -> boundingRectFromXml(xml_document);
|
QRectF pasted_content_bounding_rect = m_scene -> boundingRectFromXml(xml_document);
|
||||||
if (pasted_content_bounding_rect.isEmpty()) return(content_pasted);
|
if (pasted_content_bounding_rect.isEmpty()) return(content_pasted);
|
||||||
|
|
||||||
|
// paste copied parts with offset
|
||||||
// copier/coller avec decalage
|
// copier/coller avec decalage
|
||||||
QRectF final_pasted_content_bounding_rect;
|
QRectF final_pasted_content_bounding_rect;
|
||||||
++ offset_paste_count_;
|
++ offset_paste_count_;
|
||||||
@@ -594,10 +597,12 @@ void ElementView::drawBackground(QPainter *p, const QRectF &r) {
|
|||||||
@return
|
@return
|
||||||
*/
|
*/
|
||||||
QRectF ElementView::applyMovement(const QRectF &start, const QPointF &offset) {
|
QRectF ElementView::applyMovement(const QRectF &start, const QPointF &offset) {
|
||||||
|
// calculates the offset to be applied from the offset
|
||||||
// calcule le decalage a appliquer a partir de l'offset
|
// calcule le decalage a appliquer a partir de l'offset
|
||||||
QPointF final_offset;
|
QPointF final_offset;
|
||||||
final_offset.rx() = start.width() + offset.x();
|
final_offset.rx() = start.width() + offset.x();
|
||||||
|
|
||||||
|
// applies the calculated offset
|
||||||
// applique le decalage ainsi calcule
|
// applique le decalage ainsi calcule
|
||||||
return(start.translated(final_offset));
|
return(start.translated(final_offset));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user