1 /***************************************************************************
2 * copyright (C) 2008 by Marco Gittler (g.marco@freenet.de) *
3 * Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
21 #include "graphicsscenerectmove.h"
24 #include <QGraphicsSceneMouseEvent>
25 #include <QGraphicsRectItem>
26 #include <QGraphicsSvgItem>
27 #include <QGraphicsView>
29 #include <QTextCursor>
32 #include <QApplication>
36 GraphicsSceneRectMove::GraphicsSceneRectMove(QObject *parent) :
37 QGraphicsScene(parent),
39 m_resizeMode(NoResize),
40 m_tool(TITLE_RECTANGLE)
44 setBackgroundBrush(QBrush(Qt::transparent));
47 void GraphicsSceneRectMove::setSelectedItem(QGraphicsItem *item)
50 m_selectedItem = item;
51 item->setSelected(true);
55 TITLETOOL GraphicsSceneRectMove::tool()
60 void GraphicsSceneRectMove::setTool(TITLETOOL tool)
65 setCursor(Qt::CrossCursor);
68 setCursor(Qt::IBeamCursor);
71 setCursor(Qt::ArrowCursor);
76 void GraphicsSceneRectMove::keyPressEvent(QKeyEvent * keyEvent)
78 if (m_selectedItem == NULL) {
79 QGraphicsScene::keyPressEvent(keyEvent);
83 if (m_selectedItem->type() == 8) {
84 QGraphicsTextItem *t = static_cast<QGraphicsTextItem *>(m_selectedItem);
85 if (t->textInteractionFlags() & Qt::TextEditorInteraction) {
86 QGraphicsScene::keyPressEvent(keyEvent);
90 if (keyEvent->modifiers() & Qt::ControlModifier) diff = 10;
91 switch (keyEvent->key()) {
93 m_selectedItem->setPos(m_selectedItem->pos() - QPointF(diff, 0));
97 m_selectedItem->setPos(m_selectedItem->pos() + QPointF(diff, 0));
101 m_selectedItem->setPos(m_selectedItem->pos() - QPointF(0, diff));
105 m_selectedItem->setPos(m_selectedItem->pos() + QPointF(0, diff));
109 case Qt::Key_Backspace:
110 delete m_selectedItem;
111 m_selectedItem = NULL;
112 emit selectionChanged();
115 QGraphicsScene::keyPressEvent(keyEvent);
117 emit actionFinished();
121 void GraphicsSceneRectMove::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* e)
123 QPointF p = e->scenePos();
125 m_resizeMode = NoResize;
126 m_selectedItem = NULL;
127 QGraphicsItem* g = items(QRectF(p , QSizeF(4, 4)).toRect()).at(0);
129 if (g->type() == 8) {
130 QGraphicsTextItem *t = static_cast<QGraphicsTextItem *>(g);
132 t->setTextInteractionFlags(Qt::TextEditorInteraction);
133 } else emit doubleClickEvent();
135 QGraphicsScene::mouseDoubleClickEvent(e);
138 void GraphicsSceneRectMove::mouseReleaseEvent(QGraphicsSceneMouseEvent *e)
140 if (m_tool == TITLE_RECTANGLE && m_selectedItem) setSelectedItem(m_selectedItem);
141 QGraphicsScene::mouseReleaseEvent(e);
142 emit actionFinished();
145 void GraphicsSceneRectMove::mousePressEvent(QGraphicsSceneMouseEvent* e)
147 m_clickPoint = e->screenPos();
148 QPointF p = e->scenePos();
150 m_resizeMode = NoResize;
151 const QList <QGraphicsItem *> list = items(QRectF(p , QSizeF(4, 4)).toRect());
152 QGraphicsItem *item = NULL;
153 bool hasSelected = false;
155 if (m_tool == TITLE_SELECT) {
156 foreach(QGraphicsItem *g, list) {
157 kDebug() << " - - CHECKING ITEM Z:" << g->zValue() << ", TYPE: " << g->type();
158 // check is there is a selected item in list
159 if (g->zValue() > -1000 && g->isSelected()) {
166 if (m_selectedItem && m_selectedItem->type() == 8) {
167 // disable text editing
168 QGraphicsTextItem *t = static_cast<QGraphicsTextItem *>(m_selectedItem);
169 t->textCursor().setPosition(0);
170 QTextBlock cur = t->textCursor().block();
171 t->setTextCursor(QTextCursor(cur));
172 t->setTextInteractionFlags(Qt::NoTextInteraction);
174 m_selectedItem = NULL;
175 foreach(QGraphicsItem* g, list) {
176 if (g->zValue() > -1000) {
183 m_sceneClickPoint = e->scenePos();
184 m_selectedItem = item;
185 kDebug() << "///////// ITEM TYPE: " << item->type();
186 if (item->type() == 8) {
187 QGraphicsTextItem *t = static_cast<QGraphicsTextItem *>(item);
188 if (t->textInteractionFlags() == Qt::TextEditorInteraction) {
189 QGraphicsScene::mousePressEvent(e);
192 t->setTextInteractionFlags(Qt::NoTextInteraction);
193 setCursor(Qt::ClosedHandCursor);
194 } else if (item->type() == 3 || item->type() == 13 || item->type() == 7) {
196 if (m_selectedItem->type() == 3)
197 r = ((QGraphicsRectItem*)m_selectedItem)->rect();
199 r = m_selectedItem->boundingRect();
201 * The vertices of the rectangle (check for matrix
202 * transformation); to be replaced by QTransform::map()?
204 QPointF itemOrigin = item->scenePos();
205 QTransform transform = item->transform();
206 QPointF topLeft(transform.m11() * r.toRect().left() + transform.m21() * r.toRect().top() + transform.m31() + itemOrigin.x(), transform.m22() * r.toRect().top() + transform.m12() * r.toRect().left() + transform.m32() + itemOrigin.y());
207 QPointF bottomLeft(transform.m11() * r.toRect().left() + transform.m21() * r.toRect().bottom() + transform.m31() + itemOrigin.x(), transform.m22() * r.toRect().bottom() + transform.m12() * r.toRect().left() + transform.m32() + itemOrigin.y());
208 QPointF topRight(transform.m11() * r.toRect().right() + transform.m21() * r.toRect().top() + transform.m31() + itemOrigin.x(), transform.m22() * r.toRect().top() + transform.m12() * r.toRect().right() + transform.m32() + itemOrigin.y());
209 QPointF bottomRight(transform.m11() * r.toRect().right() + transform.m21() * r.toRect().bottom() + transform.m31() + itemOrigin.x(), transform.m22() * r.toRect().bottom() + transform.m12() * r.toRect().right() + transform.m32() + itemOrigin.y());
210 // The borders (using the transformed coordinates)
211 QGraphicsLineItem borderTop(topLeft.x(), topLeft.y(), topRight.x(), topRight.y());
212 QGraphicsLineItem borderRight(topRight.x(), topRight.y(), bottomRight.x(), bottomRight.y());
213 QGraphicsLineItem borderBottom(bottomRight.x(), bottomRight.y(), bottomLeft.x(), bottomLeft.y());
214 QGraphicsLineItem borderLeft(bottomLeft.x(), bottomLeft.y(), topLeft.x(), topLeft.y());
215 // The area interested by the mouse pointer
216 QPainterPath mouseArea;
217 mouseArea.addRect(e->scenePos().toPoint().x() - 3 / m_zoom, e->scenePos().toPoint().y() - 3 / m_zoom, 6 / m_zoom, 6 / m_zoom);
218 // Check for collisions between the mouse and the borders
219 if (borderLeft.collidesWithPath(mouseArea) && borderTop.collidesWithPath(mouseArea))
220 m_resizeMode = TopLeft;
221 else if (borderLeft.collidesWithPath(mouseArea) && borderBottom.collidesWithPath(mouseArea))
222 m_resizeMode = BottomLeft;
223 else if (borderRight.collidesWithPath(mouseArea) && borderTop.collidesWithPath(mouseArea))
224 m_resizeMode = TopRight;
225 else if (borderRight.collidesWithPath(mouseArea) && borderBottom.collidesWithPath(mouseArea))
226 m_resizeMode = BottomRight;
227 else if (borderLeft.collidesWithPath(mouseArea))
229 else if (borderRight.collidesWithPath(mouseArea))
230 m_resizeMode = Right;
231 else if (borderTop.collidesWithPath(mouseArea))
233 else if (borderBottom.collidesWithPath(mouseArea))
236 setCursor(Qt::ClosedHandCursor);
239 QGraphicsScene::mousePressEvent(e);
240 } else if (m_tool == TITLE_RECTANGLE) {
241 m_sceneClickPoint = e->scenePos();
242 m_selectedItem = NULL;
243 } else if (m_tool == TITLE_TEXT) {
244 m_selectedItem = addText(QString());
245 emit newText((QGraphicsTextItem *) m_selectedItem);
246 m_selectedItem->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
247 ((QGraphicsTextItem *)m_selectedItem)->setTextInteractionFlags(Qt::TextEditorInteraction);
248 m_selectedItem->setPos(e->scenePos());
249 QGraphicsScene::mousePressEvent(e);
252 kDebug() << "////// MOUSE CLICK, RESIZE MODE: " << m_resizeMode;
256 void GraphicsSceneRectMove::clearTextSelection()
258 if (m_selectedItem && m_selectedItem->type() == 8) {
259 // disable text editing
260 QGraphicsTextItem *t = static_cast<QGraphicsTextItem *>(m_selectedItem);
261 t->textCursor().setPosition(0);
262 QTextBlock cur = t->textCursor().block();
263 t->setTextCursor(QTextCursor(cur));
264 t->setTextInteractionFlags(Qt::NoTextInteraction);
266 m_selectedItem = NULL;
271 void GraphicsSceneRectMove::mouseMoveEvent(QGraphicsSceneMouseEvent* e)
273 if ((e->screenPos() - m_clickPoint).manhattanLength() < QApplication::startDragDistance()) {
277 if (m_selectedItem && e->buttons() & Qt::LeftButton) {
278 if (m_selectedItem->type() == 3 || m_selectedItem->type() == 13 || m_selectedItem->type() == 7) {
280 if (m_selectedItem->type() == 3)
281 newrect = ((QGraphicsRectItem*)m_selectedItem)->rect();
283 newrect = m_selectedItem->boundingRect();
284 QPointF newpoint = e->scenePos();
286 * The vertices of the rectangle (check for matrix
287 * transformation); to be replaced by QTransform::map()?
289 QPointF itemOrigin = m_selectedItem->scenePos();
290 QTransform transform = m_selectedItem->transform();
291 QPointF topLeft(transform.m11() * newrect.toRect().left() + transform.m21() * newrect.toRect().top() + transform.m31() + itemOrigin.x(), transform.m22() * newrect.toRect().top() + transform.m12() * newrect.toRect().left() + transform.m32() + itemOrigin.y());
292 QPointF bottomLeft(transform.m11() * newrect.toRect().left() + transform.m21() * newrect.toRect().bottom() + transform.m31() + itemOrigin.x(), transform.m22() * newrect.toRect().bottom() + transform.m12() * newrect.toRect().left() + transform.m32() + itemOrigin.y());
293 QPointF topRight(transform.m11() * newrect.toRect().right() + transform.m21() * newrect.toRect().top() + transform.m31() + itemOrigin.x(), transform.m22() * newrect.toRect().top() + transform.m12() * newrect.toRect().right() + transform.m32() + itemOrigin.y());
294 QPointF bottomRight(transform.m11() * newrect.toRect().right() + transform.m21() * newrect.toRect().bottom() + transform.m31() + itemOrigin.x(), transform.m22() * newrect.toRect().bottom() + transform.m12() * newrect.toRect().right() + transform.m32() + itemOrigin.y());
295 // Convert the mouse coordinates applying inverted transformation
296 QPointF newPointRelative = newpoint - itemOrigin;
297 QPointF resizePoint(transform.inverted().m11() * newPointRelative.x() + transform.inverted().m21() * newPointRelative.y() + transform.inverted().m31(), transform.inverted().m22() * newPointRelative.y() + transform.inverted().m12() * newPointRelative.x() + transform.inverted().m32());
299 * Will check if the mouse is on the right of the limit lines with a
300 * determinant (it must be less than zero because the Y axis is
304 switch (m_resizeMode) {
306 determinant = (bottomRight.x() - newpoint.x()) * (topRight.y() - newpoint.y()) - (bottomRight.y() - newpoint.y()) * (topRight.x() - newpoint.x());
307 if (determinant < 0) {
308 determinant = (bottomLeft.x() - newpoint.x()) * (bottomRight.y() - newpoint.y()) - (bottomLeft.y() - newpoint.y()) * (bottomRight.x() - newpoint.x());
309 if (determinant < 0) {
310 // resizePoint is not working for some reason
311 newrect.setBottomRight(QPointF(newrect.width() - (transform.inverted().m11() * resizePoint.x() + transform.inverted().m21() * resizePoint.y() + transform.inverted().m31()), newrect.bottom() - (transform.inverted().m22() * resizePoint.y() + transform.inverted().m12() * resizePoint.x() + transform.inverted().m32())));
312 m_selectedItem->setPos(resizePoint + itemOrigin);
317 determinant = (bottomRight.x() - newpoint.x()) * (topRight.y() - newpoint.y()) - (bottomRight.y() - newpoint.y()) * (topRight.x() - newpoint.x());
318 if (determinant < 0) {
319 determinant = (topRight.x() - newpoint.x()) * (topLeft.y() - newpoint.y()) - (topRight.y() - newpoint.y()) * (topLeft.x() - newpoint.x());
320 if (determinant < 0) {
321 newrect.setBottomRight(QPointF(newrect.width() - resizePoint.x(), resizePoint.y()));
322 m_selectedItem->setPos(QPointF(transform.m11() * resizePoint.x() + transform.m21() * (newrect.bottom() - resizePoint.y()) + transform.m31() + itemOrigin.x(), transform.m22() * (newrect.bottom() - resizePoint.y()) + transform.m12() * resizePoint.x() + transform.m32() + itemOrigin.y()));
327 determinant = (topLeft.x() - newpoint.x()) * (bottomLeft.y() - newpoint.y()) - (topLeft.y() - newpoint.y()) * (bottomLeft.x() - newpoint.x());
328 if (determinant < 0) {
329 determinant = (bottomLeft.x() - newpoint.x()) * (bottomRight.y() - newpoint.y()) - (bottomLeft.y() - newpoint.y()) * (bottomRight.x() - newpoint.x());
330 if (determinant < 0) {
331 newrect.setBottomRight(QPointF(resizePoint.x(), newrect.bottom() - resizePoint.y()));
332 m_selectedItem->setPos(QPointF(transform.m11() * (newrect.width() - resizePoint.x()) + transform.m21() * resizePoint.y() + transform.m31() + itemOrigin.x(), transform.m22() * resizePoint.y() + transform.m12() * (newrect.width() - resizePoint.x()) + transform.m32() + itemOrigin.y()));
337 determinant = (topLeft.x() - newpoint.x()) * (bottomLeft.y() - newpoint.y()) - (topLeft.y() - newpoint.y()) * (bottomLeft.x() - newpoint.x());
338 if (determinant < 0) {
339 determinant = (topRight.x() - newpoint.x()) * (topLeft.y() - newpoint.y()) - (topRight.y() - newpoint.y()) * (topLeft.x() - newpoint.x());
341 newrect.setBottomRight(resizePoint);
345 determinant = (bottomRight.x() - newpoint.x()) * (topRight.y() - newpoint.y()) - (bottomRight.y() - newpoint.y()) * (topRight.x() - newpoint.x());
346 if (determinant < 0) {
347 newrect.setRight(newrect.width() - resizePoint.x());
348 m_selectedItem->setPos(QPointF(transform.m11() * resizePoint.x() + transform.m31() + itemOrigin.x(), transform.m12() * resizePoint.x() + transform.m32() + itemOrigin.y()));
352 determinant = (topLeft.x() - newpoint.x()) * (bottomLeft.y() - newpoint.y()) - (topLeft.y() - newpoint.y()) * (bottomLeft.x() - newpoint.x());
354 newrect.setRight(resizePoint.x());
357 determinant = (bottomLeft.x() - newpoint.x()) * (bottomRight.y() - newpoint.y()) - (bottomLeft.y() - newpoint.y()) * (bottomRight.x() - newpoint.x());
358 if (determinant < 0) {
359 newrect.setBottom(newrect.bottom() - resizePoint.y());
360 m_selectedItem->setPos(QPointF(transform.m21() * resizePoint.y() + transform.m31() + itemOrigin.x(), transform.m22() * resizePoint.y() + transform.m32() + itemOrigin.y()));
364 determinant = (topRight.x() - newpoint.x()) * (topLeft.y() - newpoint.y()) - (topRight.y() - newpoint.y()) * (topLeft.x() - newpoint.x());
366 newrect.setBottom(resizePoint.y());
369 QPointF diff = e->scenePos() - m_sceneClickPoint;
370 m_sceneClickPoint = e->scenePos();
371 m_selectedItem->moveBy(diff.x(), diff.y());
374 if (m_selectedItem->type() == 3 && m_resizeMode != NoResize) {
375 QGraphicsRectItem *gi = (QGraphicsRectItem*)m_selectedItem;
376 gi->setRect(newrect);
380 if (resizeMode == Left || resizeMode == Right ) s = m_selectedItem->boundingRect().width() / newrect.width();
381 else s = m_selectedItem->boundingRect().height() / newrect.height();
382 m_selectedItem->scale( 1 / s, 1 / s );
383 kDebug()<<"/// SCALING SVG, RESIZE MODE: "<<resizeMode<<", RECT:"<<m_selectedItem->boundingRect();
385 //gi->setPos(m_selectedItem->scenePos());
386 /*if (resizeMode == NoResize) {
387 QGraphicsScene::mouseMoveEvent(e);
390 } else if (m_selectedItem->type() == 8) {
391 QGraphicsTextItem *t = static_cast<QGraphicsTextItem *>(m_selectedItem);
392 if (t->textInteractionFlags() & Qt::TextEditorInteraction) {
393 QGraphicsScene::mouseMoveEvent(e);
396 QPointF diff = e->scenePos() - m_sceneClickPoint;
397 m_sceneClickPoint = e->scenePos();
398 m_selectedItem->moveBy(diff.x(), diff.y());
401 } else if (m_tool == TITLE_SELECT) {
402 QPointF p = e->scenePos();
404 m_resizeMode = NoResize;
405 bool itemFound = false;
406 foreach(const QGraphicsItem* g, items(QRectF(p , QSizeF(4, 4)).toRect())) {
407 if ((g->type() == 13 || g->type() == 7) && g->zValue() > -1000) {
409 setCursor(Qt::OpenHandCursor);
411 } else if (g->type() == 3 && g->zValue() > -1000) {
412 QRectF r = ((const QGraphicsRectItem*)g)->rect();
415 * The vertices of the rectangle (check for matrix
416 * transformation); to be replaced by QTransform::map()?
418 QPointF itemOrigin = g->scenePos();
419 QTransform transform = g->transform();
420 QPointF topLeft(transform.m11() * r.toRect().left() + transform.m21() * r.toRect().top() + transform.m31() + itemOrigin.x(), transform.m22() * r.toRect().top() + transform.m12() * r.toRect().left() + transform.m32() + itemOrigin.y());
421 QPointF bottomLeft(transform.m11() * r.toRect().left() + transform.m21() * r.toRect().bottom() + transform.m31() + itemOrigin.x(), transform.m22() * r.toRect().bottom() + transform.m12() * r.toRect().left() + transform.m32() + itemOrigin.y());
422 QPointF topRight(transform.m11() * r.toRect().right() + transform.m21() * r.toRect().top() + transform.m31() + itemOrigin.x(), transform.m22() * r.toRect().top() + transform.m12() * r.toRect().right() + transform.m32() + itemOrigin.y());
423 QPointF bottomRight(transform.m11() * r.toRect().right() + transform.m21() * r.toRect().bottom() + transform.m31() + itemOrigin.x(), transform.m22() * r.toRect().bottom() + transform.m12() * r.toRect().right() + transform.m32() + itemOrigin.y());
424 // The borders (using the transformed coordinates)
425 QGraphicsLineItem borderTop(topLeft.x(), topLeft.y(), topRight.x(), topRight.y());
426 QGraphicsLineItem borderRight(topRight.x(), topRight.y(), bottomRight.x(), bottomRight.y());
427 QGraphicsLineItem borderBottom(bottomRight.x(), bottomRight.y(), bottomLeft.x(), bottomLeft.y());
428 QGraphicsLineItem borderLeft(bottomLeft.x(), bottomLeft.y(), topLeft.x(), topLeft.y());
429 // The area interested by the mouse pointer
430 QPainterPath mouseArea;
431 mouseArea.addRect(e->scenePos().toPoint().x() - 3 / m_zoom, e->scenePos().toPoint().y() - 3 / m_zoom, 6 / m_zoom, 6 / m_zoom);
432 // Check for collisions between the mouse and the borders
433 if (borderLeft.collidesWithPath(mouseArea) && borderTop.collidesWithPath(mouseArea))
434 setCursor(QCursor(Qt::SizeFDiagCursor));
435 else if (borderLeft.collidesWithPath(mouseArea) && borderBottom.collidesWithPath(mouseArea))
436 setCursor(QCursor(Qt::SizeBDiagCursor));
437 else if (borderRight.collidesWithPath(mouseArea) && borderTop.collidesWithPath(mouseArea))
438 setCursor(QCursor(Qt::SizeBDiagCursor));
439 else if (borderRight.collidesWithPath(mouseArea) && borderBottom.collidesWithPath(mouseArea))
440 setCursor(QCursor(Qt::SizeFDiagCursor));
441 else if (borderLeft.collidesWithPath(mouseArea))
442 setCursor(Qt::SizeHorCursor);
443 else if (borderRight.collidesWithPath(mouseArea))
444 setCursor(Qt::SizeHorCursor);
445 else if (borderTop.collidesWithPath(mouseArea))
446 setCursor(Qt::SizeVerCursor);
447 else if (borderBottom.collidesWithPath(mouseArea))
448 setCursor(Qt::SizeVerCursor);
450 setCursor(Qt::OpenHandCursor);
453 if (!itemFound) setCursor(Qt::ArrowCursor);
455 QGraphicsScene::mouseMoveEvent(e);
456 } else if (m_tool == TITLE_RECTANGLE && e->buttons() & Qt::LeftButton) {
457 if (m_selectedItem == NULL && (m_clickPoint - e->screenPos()).manhattanLength() >= QApplication::startDragDistance()) {
458 // create new rect item
459 m_selectedItem = addRect(0, 0, e->scenePos().x() - m_sceneClickPoint.x(), e->scenePos().y() - m_sceneClickPoint.y());
460 emit newRect((QGraphicsRectItem *) m_selectedItem);
461 m_selectedItem->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
462 m_selectedItem->setPos(m_sceneClickPoint);
463 m_resizeMode = BottomRight;
464 QGraphicsScene::mouseMoveEvent(e);
469 void GraphicsSceneRectMove::wheelEvent(QGraphicsSceneWheelEvent * wheelEvent)
471 QList<QGraphicsView*> viewlist = views();
472 //kDebug() << wheelEvent->delta() << " " << zoom;
473 if (viewlist.size() > 0) {
474 if (wheelEvent->delta() < 0) emit sceneZoom(true);
475 else emit sceneZoom(false);
479 void GraphicsSceneRectMove::setScale(double s)
481 if (m_zoom < 1.0 / 7.0 && s < 1.0) return;
482 else if (m_zoom > 10.0 / 7.9 && s > 1.0) return;
483 QList<QGraphicsView*> viewlist = views();
484 if (viewlist.size() > 0) {
485 viewlist[0]->scale(s, s);
488 //kDebug()<<"////////// ZOOM: "<<zoom;
491 void GraphicsSceneRectMove::setZoom(double s)
493 QList<QGraphicsView*> viewlist = views();
494 if (viewlist.size() > 0) {
495 viewlist[0]->resetTransform();
496 viewlist[0]->scale(s, s);
500 //kDebug()<<"////////// ZOOM: "<<zoom;
503 void GraphicsSceneRectMove::setCursor(QCursor c)
505 const QList<QGraphicsView*> l = views();
506 foreach(QGraphicsView* v, l) {